One tool that has emerged as an industry leader when it comes to turning notes into searchable, meaningful data is Apache’s cTAKES™. To find out more about how cTAKES™ works, see the Apache cTAKES™ Wiki. cTAKES has the distinct and important ability to find negatives (such as “Patient does not have…”) in text analysis—which the RDoC parsing code we are using does not, as it considers any mention at all, either negative or positive, worthy of note.
This video is an excellent and relatively short introduction to cTAKES:
You can play with the web interface of cTAKES here. Please note that the cTAKES web interface is for demonstration purposes only and is not meant to be run on real clinical data.
Technical Details about cTAKES
If you watched the above video you are well on your way to understanding what Arcus Annotations will provide by way of rich clinical data. However, when you write for publication, you may have to provide greater detail. The following sections are for your use when you need to explain to someone exactly how cTAKES works with our note data.
- Pipeline. A complete sequence of cTAKES annotators performing a comprehensive NLP task.
- Analysis engine. A single cTAKES annotator used in a larger pipeline. A complete pipeline is sometimes referred to as an Aggregate Analysis Engine.
- Piper file. A plaintext file describing a pipeline
- CAS. “Common Analysis Structure.” This is the data structure through which the annotators in a pipeline communicate. The JCAS is the specific Java implementation of this data structure that is used in cTAKES.
Many of the terms you will encounter when reading about cTAKES come from the Apache UIMA project. UIMA is a larger Apache project for building systems to process unstructured text. To learn more, see the Apache UIMA introduction.
The cTAKES Pipeline as Implemented at CHOP
A given cTAKES configuration, called a pipeline, has multiple stages (annotators) that perform specific tasks like part-of-speech tagging or detecting term negation. The steps are run in sequence, and the annotations created by one annotator can be used by an annotator downstream of it in the pipeline.
You can set which annotators will run in a pipeline and you can set individual annotators’ configurations. Most notably, the named entity recognition (NER) annotator that tags text with mentions from ontologies (e.g. SNOMED CT and ICD 10) can be configured with different ontology dictionaries.
cTAKES (version 4.0.0) provides a pipeline, called the Default Clinical Pipeline, as a suggested starting point for processing clinical text data. From the cTAKES website:
The Default Clinical Pipeline produces the most commonly desired output from cTAKES. This includes annotations for Anatomical sites, Signs/Symptoms, Procedures, Diseases/Disorders and Medications. For each annotation there are normalized UMLS CUIs, plus values for negation, uncertainty and subject.
In order to create a set of annotations that will be useful to the widest audience of Arcus users, we have implemented the Default Clinical Pipeline to annotate raw note data at scale at CHOP (remember those hundred millions of notes? That’s the scale). We chose to use the recommended Default Clinical Pipeline for three main reasons:
- These annotations can be used as a baseline for groups doing their own NLP research.
- Ease in citation: If you use these annotations in your own research, it will be straightforward to cite the specific configuration of cTAKES that was used.
- Reproducibility and collaboration: It’s easy for people to share their findings and explain how they arrived at them because the model is commonly understood by many people doing research using raw text data.
The pipeline contains a series of annotators (I personally cannot get the image of annotating monkeys out of my head sitting Dr. Seuss-like at desks in a pipe, one above the other). We do not save the direct output of each annotator in Arcus, only the annotations referenced in your BigQuery schema definition. For example, we do not save part-of-speech or sentence boundary annotations. Nevertheless, these components run because their output is used in downstream annotators such as the named entity recognition annotator.
The Default Clinical Pipeline contains these components:
- SimpleSegmentAnnotator (the first monkey)
- SentenceDetector (the second monkey)
- TokenizerAnnotatorPTB (etc.)
- PolarityCleartkAnalysisEngine - This is a support vector machine model trained on data from the SHARPn project (contains notes from the Mayo Clinic from a variety of specialties).
- UncertaintyCleartkAnalysisEngine - This is a machine learning model
- HistoryCleartkAnalysisEngine - This is a machine learning model
The only modification we have made to the Default Clinical Pipeline is the ontology dictionaries used by the Named Entity Recognition annotator. We will use these:
- Human Phenotype Ontology (HPO—available in the alpha release)
- SNOMED CT (Coming soon)
- RxNorm - (Coming soon)
The version of each of these ontologies is as included in the 2018AB release of UMLS.
How to Access cTAKES Annotations: BigQuery
As notes are imported into Arcus, the cTAKES pipeline is run and the resulting annotations are inserted into a table in Google BigQuery. Early adopters of the Arcus platform will have access to this table via Google’s BigQuery UI and command line tools. You can see schema in yaml form here. This will soon be available in the Arcus Metadata Browser.
Here is an introductory video about BigQuery:
Useful Technical Stuff
This list contains useful references.
- Forum thread about the definition of some of the attribute annotators that are not well described in the cTAKES documentation
Fast Lookup Annotator (Named Entity Recognition Component)
Machine Learning Library
ClearTK is the machine learning library used within several of the cTAKES annotators in the default clinical pipeline.
- The ClearTK library is used in some of the machine learning annotators within cTAKES
- ClearTK journal article
- Negation detection journal article
- Forum post regarding the specifics of the negation detection annotator
- Forum discussion of the machine learning negation detector used in the default clinical pipeline versus the previous rule-based annotator
- Another discussion of the two available negation detection annotators
For reference, the main file that describes the pipeline can be found at DefaulFastPipeline.piper. It imports the following files:
You can’t yet run Arcus Annotations on your own text, but we will be supporting this functionality in the future. For now, we are running the pipeline only on notes as they are imported into Arcus. That saves you time when you want to access note data—they have already been annotated, likely while you were asleep.