You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

Disclaimer

The views and opinions expressed in this blog entry are those of mine and do not reflect the official policy or position of CDISC.

I am learning about natural language processing (NLP) as part of my self-teaching journey in Data Science.

My set up is simple. Python and an NLP package. scispaCy is an open-source library for processing biomedical text. [1] It works with multiple pre-trained models, such as the The BioCreative V Chemical Disease Relation (BC5CDR) corpus for biomedical terms. [2] BioNLP13CG corpus is another example, which is a model for cancer genetics.

As a test run, I selected a small paragraph from the work-in-progress COVID-19 Interim User Guide. [3] This is a text about a data collection example for the disease's signs & symptoms:

Data collection may include questions about groups of symptoms, such as

  • GI symptoms (nausea, vomiting, diarrhea)
  • Cough (non-productive, productive, or haemoptisis)

The next step was to extract named entities by running the signs & symptoms text through the BC5CDR biomedical model, A named entity is text with a label of name of things. For BC5CDR, the entity types are DISEASE and CHEMICAL. This process is often referred as named entity recognition (NER). These are the results:

EntityEntity Type
nauseaDISEASE
vomitingDISEASE
diarrheaDISEASE
CoughDISEASE
haemoptisisDISEASE

The first surprise was a programmatic method to link discovered entity with Unified Medical Language System (UMLS). UMLS is maintained by U.S. National Library of Medicine (NLM). This is appealing, when a term or concept is curated in the UMLS, a formal definition exists. Each concept in the UMLS has a Concept Unique Identifier (CUI). [4] This process is typically called named entity linking (NEL).

Let's take a look at the outcome, with green shaded rows indicating my preferred match:

EntityCUINameDefinitionScore
nauseaC0027497NauseaAn unpleasant sensation in the stomach usually accompanied by the urge to vomit. Common causes are early pregnancy, sea and motion sickness, emotional stress, intense pain, food poisoning, and various enteroviruses.1.0
nauseaC4085862Bothered by NauseaA question about whether an individual is or was bothered by nausea.1.0
nauseaC4255480Nausea:Presence or Threshold:Point in time:^Patient:OrdinalNone1.0
nauseaC4084796How Often NauseaA question about how often an individual has or had nausea.1.0
nauseaC1963179Nausea Adverse EventNone1.0
vomitingC0042963VomitingThe forcible expulsion of the contents of the STOMACH through the MOUTH.1.0
vomitingC4084767Bothered by VomitingA question about whether an individual is or was bothered by vomiting.0.9999999403953552
vomitingC4084768Usual Severity VomitingA question about the usual severity of an individual's vomiting.0.9999999403953552
vomitingC1963281Vomiting Adverse EventNone0.9999999403953552
vomitingC4084766How Much Distress VomitingA question about an individual's distress from their vomiting.0.9999999403953552
diarrheaC0011991DiarrheaAn increased liquidity or decreased consistency of FECES, such as running stool. Fecal consistency is related to the ratio of water-holding capacity of insoluble solids to total water, rather than the amount of water present. Diarrhea is not hyperdefecation or increased fecal weight.1.0
diarrheaC4084784How Much Distress DiarrheaA question about an individual's distress from their diarrhea.1.0
diarrheaC4084802Usual Severity DiarrheaA question about the usual severity of an individual's diarrhea.1.0
diarrheaC1963091Diarrhea Adverse EventNone1.0
diarrheaC3641756Have DiarrheaA question about whether an individual has or had diarrhea.1.0
CoughC0010200CoughingA sudden, audible expulsion of air from the lungs through a partially closed glottis, preceded by inhalation. It is a protective response that serves to clear the trachea, bronchi, and/or lungs of irritants and secretions, or to prevent aspiration of foreign materials into the lungs.1.0
CoughC1961131Cough Adverse EventNone1.0
CoughC3274924Have Been CoughingA question about whether an individual is or has been coughing.1.0
CoughC3815497Cough (guaifenesin)None1.0
CoughC4084725Usual Severity CoughA question about the usual severity of an individual's cough.1.0
haemoptisisNone returned

Notice how the table above does not include any UMLS concept for the named entity haemoptisis. With some online searches, Ii came to me as another surprise that it is due to a typographical error. After correcting it to "hemoptysis,",a hit appears in the outcome, as follows:

EntityCUINameDefinitionScore
hemoptysis
C0019079HemoptysisExpectoration or spitting of blood originating from any part of the RESPIRATORY TRACT, usually from hemorrhage in the lung parenchyma (PULMONARY ALVEOLI) and the BRONCHIAL ARTERIES.1.0
hemoptysisC0030424ParagonimiasisInfection with TREMATODA of the genus PARAGONIMUS.0.7546218633651733

Suffice to mention, these CUIs are available on the NCI Metathesaurus. This is the URL template: https://ncim.nci.nih.gov/ncimbrowser/ConceptReport.jsp?dictionary=NCI%20Metathesaurus&code={CUI}

Visualization

spacy has built in visualization constructors to display part-of-speech tags and syntactic dependencies. This is the rendition using the text described above:

We discussed named entity recognition, which can be displayed as such:

Example Code

The Road Ahead

At this point, there seems to be a lot NLP opportunities and applications in standards development. Linkage to UMLS will allow team members to ensure semantic meaning by referencing the curated definition. Quality will increase as I demonstrated how spelling error detection was an unintended experience. I can certainly see it has a utility in CDISC 360's biomedical concept authoring. Named entities can be used as keywords or tags in Example Collection. 

Last Note

I want to share a note on installation. scispacy and spacy require Cython, a C-extension for Python. I spent too many hours in troubleshooting before realizing I had installed a 32-bit port of Python onto a PC with Windows 10 64-bit. This caused many compiler errors because all the Microsoft Visual Studio runtime redistributables and compilers were 64-bit. Installing the 64-bit binaries for Python corrected all the installation issues.

References

[1] scispaCy: https://allenai.github.io/scispacy/

[2] BC5CDR corpus. https://www.ncbi.nlm.nih.gov/research/bionlp/Data/

[3] CDISC Interim User Guide for COVID-19. https://wiki.cdisc.org/display/COVID19/

[4] Unique Identifiers in the Metathesaurus. https://www.nlm.nih.gov/research/umls/new_users/online_learning/Meta_005.html

  • No labels