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