def convert_to_annotations()

in CloudFormation/converter/app.py [0:0]


    def convert_to_annotations(index, jsonLine, input_file_name):
        annotations = []
        jsonObj = GroundTruth2Comprehend.parse_manifest_input(jsonLine)
        labeling_job_name = GroundTruth2Comprehend.get_labeling_job_name(jsonObj)
        number_of_labels = len(jsonObj[labeling_job_name]["annotations"]["entities"])
        labeling_job_info = jsonObj[labeling_job_name]["annotations"]["entities"]
        for ind in range(number_of_labels):
            annotations.append(
                (
                    input_file_name,
                    index,
                    labeling_job_info[ind]["startOffset"],
                    labeling_job_info[ind]["endOffset"],
                    labeling_job_info[ind]["label"].upper(),
                )
            )

        return annotations