MCPcopy Index your code
hub / github.com/OHNLP/MedTagger

github.com/OHNLP/MedTagger @v1.0.85

Chat with this repo
repository ↗ · DeepWiki ↗ · release v1.0.85 ↗ · + Follow
420 symbols 965 edges 57 files 97 documented · 23%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Build

MedTagger

MedTagger contains a suite of programs that the Mayo Clinic NLP program has developed in 2013. It includes three major components: MedTagger for indexing based on dictionaries, MedTaggerIE for information extraction based on patterns, and MedTaggerML for machine learning-based named entity recognition.

Build a Dictionary

The updated release includes a dictionary based on MedLex, a corpus-driven semantic lexicon, that maps to OMOP Concept identifiers. MedTagger for indexing is built upon a fast string matching algorithm leveraging lexical normalization. The contextual annotator enables the detection of local context for concept entries detected. The new release of the dictionary maps to the OMOP Concept identifiers. For the detailed information of those concept identifiers, please visit http://athena.ohdsi.org.

Custom Ruleset Use Case - COVID 19

MedTagger IE Pipelines use a custom ruleset format. An example ruleset of Coronavirus Diseases 19 (COVID 19) related symptoms (e.g. dry cough, fever, fatigue) can be found here under the /src/main/resources/medtaggerieresources/covid19 directory. These resources are what tells MedTagger what to do/extract, and this directory is expected as input for the RULEDIR parameter

Installation and Use

Live demo for COVID-19 ruleset: https://ohnlp.github.io/ohnlptk/

Video demo: https://vimeo.com/392331446

  1. Download the latest release from https://github.com/OHNLP/MedTagger/releases
  2. Extract the zip file
  3. Modify the INPUTDIR, OUTPUTDIR, and RULEDIR variables in run_medtagger_win.bat or run_medtagger_unix_mac.sh, as appropriate

    • INPUT_DIR: full directory path of input folder
    • OUTPUT_DIR: full directory path of output folder
    • RULES_DIR: full directory path of 'Rule' folder

    Example for Mac: INPUTDIR="$YOUR_INPUT_DIRECTORY" OUTPUTDIR="$YOUR_OUTPUT_DIRECTORY" RULEDIR="$YOUR_MEDTAGGER_HOME/medtaggerieresources/covid19"

    Example for Windows: INPUTDIR="C:\$YOUR_INPUT_DIRECTORY\input" OUTPUTDIR="C:\$YOUR_OUTPUT_DIRECTORY\output" RULEDIR="C:\YOUR_MEDTAGGER_HOME\medtaggerieresources\covid19"

  4. Run the batch file

    Mac/linux: run_medtagger_unix_mac.sh

    Windows:

    run_medtagger_win.bat

For Developers

  1. Clone this repository
  2. You will need JDK8 or above, Apache Maven, and Apache Ant installed
  3. To access github package repositories for dependency resolution, you will need to generate an appropriate github token with the read:packages permissions, and edit settings.xml appropriately by replacing ${env.SECRET_ACTOR} with your github username and ${env.SECRET_TOKEN} with the generated token.
  4. When your modifications are complete, from the project root directory:
    • Run mvn clean install -s settings.xml
    • Run ant dist
    • A distribution zip will be created at MedTagger.zip in the root directory

Reference

Liu H, Bielinski SJ, Sohn S, Murphy S, Wagholikar KB, Jonnalagadda SR, Ravikumar KE, Wu ST, Kullo IJ, Chute CG. An information extraction framework for cohort identification using electronic health records. AMIA Summits on Translational Science Proceedings. 2013;2013:149.

Wen A, Fu S, Moon S, El Wazir M, Rosenbaum A, Kaggal VC, Liu S, Sohn S, Liu H, Fan J. Desiderata for delivering NLP to accelerate healthcare AI advancement and a Mayo Clinic NLP-as-a-service implementation. npj Digital Medicine. 2019 Dec 17;2(1):1-7.

Extension points exported contracts — how you extend this code

AnnotationIndex (Interface)
The annotation index is a storage structure for AnnotationFS objects. As they are tied to individual {@link org. [6 implementers]
src/main/java/org/ohnlp/medtagger/perf/AnnotationIndex.java

Core symbols most depended-on inside this repo

get
called by 132
src/main/resources/medtaggermlresources/machinelearning/crfsuite/linux_x86_32/include/crfsuite.hpp
equals
called by 106
src/main/java/org/ohnlp/medtagger/ml/feature/Feature.java
length
called by 78
src/main/java/org/ohnlp/medtagger/ie/util/ResourceUtilManager.java
append
called by 47
src/main/resources/medtaggermlresources/machinelearning/crfsuite/linux_x86_32/include/crfsuite.hpp
put
called by 47
src/main/java/org/ohnlp/medtagger/dict/AhoCorasickDict.java
toString
called by 35
src/main/java/org/ohnlp/medtagger/ml/feature/Feature.java
getValue
called by 33
src/main/java/org/ohnlp/medtagger/ml/feature/Feature.java
hasNext
called by 29
src/main/java/org/ohnlp/medtagger/ie/cr/MedTaggerIEReader.java

Shape

Method 330
Class 82
Enum 5
Function 2
Interface 1

Languages

Java82%
C++18%

Modules by API surface

src/main/java/org/ohnlp/medtagger/context/impl/ConTexTSettings.java24 symbols
src/main/resources/medtaggermlresources/machinelearning/crfsuite/linux_x86_64/include/crfsuite.hpp23 symbols
src/main/resources/medtaggermlresources/machinelearning/crfsuite/linux_x86_32/include/crfsuite.hpp23 symbols
src/main/java/org/ohnlp/medtagger/ie/util/ResourceUtilManager.java21 symbols
src/main/java/org/ohnlp/medtagger/context/impl/structs/KeywordTrie.java16 symbols
src/main/java/org/ohnlp/medtagger/ml/feature/Feature.java13 symbols
src/main/java/org/ohnlp/medtagger/dict/AhoCorasickDict.java12 symbols
src/main/java/org/ohnlp/medtagger/perf/AnnotationLeaf.java11 symbols
src/main/java/org/ohnlp/medtagger/ml/util/FeatureGenerator.java11 symbols
src/main/java/org/ohnlp/medtagger/backbone/MedTaggerBackboneTransform.java11 symbols
src/main/resources/medtaggermlresources/machinelearning/crfsuite/linux_x86_64/include/crfsuite_api.hpp10 symbols
src/main/resources/medtaggermlresources/machinelearning/crfsuite/linux_x86_32/include/crfsuite_api.hpp10 symbols

For agents

$ claude mcp add MedTagger \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact