Flatten JSON

The SDK includes a tool for converting a JSON files from the NLP API into a collection of flattened tables in TSV or JSON format.

This tool can be run as emtellipro-flatten-json.

Files produced

A simple example of running the flatten JSON tool is the following:

emtellipro-flatten-json -O tsv --output ./output/ ./result1.json ./result2.json

The output directory must not already exist; the tool will create it for you. If the output directory already exists, you’ll get an error.

After running the above command, the output directory will contain the following files.

  • The concepts, with headings: ontology, concept_id, description.
concepts.tsv
  • The assumed entities, with headings: value.
entities-assumed.tsv
  • The found entities, with headings: sentences_text, text, section_name, polarity, uncertainty, measurement_unit, known_ambiguity, question_status, guidance.
entities-found.tsv
  • The concepts for each found entity, with headings: sentences_text, text, concept_id, description.
found-entity-concepts-emtelligent.tsv
found-entity-concepts-medcin.tsv
found-entity-concepts-radlex.tsv
found-entity-concepts-rad_playbook.tsv
found-entity-concepts-rxnorm.tsv
found-entity-concepts-snomed_icd10_cm.tsv
found-entity-concepts-snomed_icd10.tsv
found-entity-concepts-snomed.tsv
found-entity-concepts-umls_hgnc.tsv
found-entity-concepts-umls_loinc.tsv
found-entity-concepts-umls_nci.tsv
  • Found entity types, with headings: sentences_text, text, entity_type_value.
found-entity-entity-types-emtelligent.tsv
found-entity-entity-types-medcin.tsv
found-entity-entity-types-radlex.tsv
found-entity-entity-types-rad_playbook.tsv
found-entity-entity-types-rxnorm.tsv
found-entity-entity-types-snomed_icd10_cm.tsv
found-entity-entity-types-snomed_icd10.tsv
found-entity-entity-types-snomed.tsv
found-entity-entity-types-umls_hgnc.tsv
found-entity-entity-types-umls_loinc.tsv
found-entity-entity-types-umls_nci.tsv
found-entity-entity-types-umls.tsv
  • Relations, with headings matching the arguments and attributes for each relation. For example, the experiencer relation contains polarity, experienced, experiencer.
relations-experiencer.tsv
relations-follow-up.tsv
relations-imagelink.tsv
relations-measurement.tsv
relations-medication.tsv
relations-qualifier.tsv
relations-reportedevent.tsv
relations-temporality.tsv
  • The document sections, with headings: level, name, text.
sections.tsv
  • The sentences text, with headings: text.
sentences.tsv

Some command line options include extra headings. See the command line option documentation further down this page.

Command line tool options

The following is the output of emtellipro-flatten-json --help, which returns simple usage information for the tool.

See the emtellipro-flatten-json command reference for all options and arguments.