Convert JSON to CSV using Python: Amazon Comprehend Medical

preview_player
Показать описание
Advanced JSON to CSV conversion that includes subdictionaries. I show how to convert an output from AWS Comprehend Medical Analysis in python into a dataframe (table), which can be saved in CSV or Excel format.

I am using the Pandas package for Python to convert the JSON into a set of dataframes first, and then save them. Amazon Comprehend Medical outputs have sub-dictionaries (Attributes, Traits, ICD-10-CM, and RxNorm concepts), which need to be extracted along with the main dictionary. I show the process in python in detail.

The analysis job outputs were downloaded from an S3 bucket, however, the format is similar to that of real-time processing in Comprehend Medical.

GitHub Repository with code, sample input text, and 4 outputs:

AWS Comprehend Medical NLP models:
1. Named Entities and Relationships
2. Protected Health Information (PHI)
3. ICD-10-CM standard medical diagnoses and symptoms
4. RxNorm start drug names

Chapters:
0:00 AWS Comprehend Medical Analysis Jon output conversion
0:39 JSON structure and how to convert into a Pandas dataframe
3:20 Named Entities and Relationship example
5:02 Export dataframes into Excel
7:31 Export dataframes into CSV files
9:09 RxNorm example
11:10 ICD-10-CM example
12:51 Protected Health Information example

Рекомендации по теме