in comprehend_groundtruth_integration/src/comprehend_customer_scripts/GroundTruth/DocumentClassifier/groundtruth_format_conversion_handler.py [0:0]
def read_write_multiclass_dataset(self):
with open('output.manifest', 'r', encoding='utf-8') as groundtruth_output_file, \
open(self.dataset_filename, 'a', encoding='utf8') as multiclass_dataset:
for index, jsonLine in enumerate(groundtruth_output_file):
class_name, source = self.convert_object.convert_to_multiclass_dataset(index, jsonLine)
source = json.dumps(source).strip('"')
multiclass_dataset.write(class_name + ',"' + source + '"')
multiclass_dataset.write("\n")