UTHealth-CCB / clamp-support

Clinical Language Annotation Modeling and Processing toolkit
http://clamp.uth.edu/
16 stars 2 forks source link

OMOPEncoder: "this.term_parser" is null when using CLAMP_WIN 1.6.6 pipeline jar in ClampCmd_1.6.6 #76

Open dax-westerman opened 2 years ago

dax-westerman commented 2 years ago

Steps to Recreate

In CLAMP_WIN 1.6.6

Build following pipeline:

<Pipeline desc="DESCRIPTION:INPUT:OUTPUT:CATEGORY:">
  <NLPProcessor conf="Sentence detector/DF_Clamp_sentence_detector/"/>
  <NLPProcessor conf="Tokenizer/DF_Clamp_tokenizer/"/>
  <NLPProcessor conf="POS tagger/DF_OpenNLP_POS_tagger/"/>
  <NLPProcessor conf="Section identifier/DF_Create_sections_by_header_entities/"/>
  <NLPProcessor conf="Named entity recogizer/Deep_learning_core_concept_recognizer_renamed_collision/"/>
  <NLPProcessor conf="Named entity recogizer/Deep_learning_medication_recognizer_renamed_collision/"/>
  <NLPProcessor conf="Named entity recogizer/Date_Format_Matcher_renamed_collision/"/>
  <NLPProcessor conf="Assertion classifier/DF_NegEx_assertion/"/>
  <NLPProcessor conf="Temporal Recognizer/RNN_Temporal_Recognition_renamed_collision/"/>
  <NLPProcessor conf="Temporal Relation/RNN_Temporal_Relation_renamed_collision/"/>
  <NLPProcessor conf="Concept mapping/OMOP_encoder_renamed_collision/"/>
  <NLPProcessor conf="Concept mapping/Medex_RxNorm_encoder_renamed_collision/"/>
  <NLPProcessor conf="Concept mapping/Dictionary_based_UMLS_encoder_renamed_collision/"/>
</Pipeline>

Export to jar (__test_project.pipeline.jar__)

In CLAMP_CMD 1.6.6

Run clamp_cmd using new pipeline.

The following command (local paths and UMLS redacted) was run over a folder containing a sample document, sample_1041.txt.

java    -DCLAMPLicenceFile="/root/clamp_cmd/CLAMP.LICENSE" \
    -Xmx3g \
    -cp /root/clamp_cmd/bin/clamp-nlp-1.6.6-jar-with-dependencies.jar edu.uth.clamp.nlp.main.PipelineMain \
    -i /data/input \
    -o /data/output \
    -p /data/test_project.pipeline.jar \
    -I /root/clamp_cmd/resource/umls_index/ \
    -A xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx

Output


log4j: reset attribute= "false".
log4j: Threshold ="null".
log4j: Retreiving an instance of org.apache.log4j.Logger.
log4j: Setting [ProgressAppender] additivity to [false].
log4j: Level value for ProgressAppender is  [INFO].
log4j: ProgressAppender level set to INFO
log4j: Class name: [org.apache.log4j.ConsoleAppender]
log4j: Parsing layout of class: "org.apache.log4j.PatternLayout"
log4j: Setting property [conversionPattern] to [%m].
log4j: Adding appender named [noEolAppender] to category [ProgressAppender].
log4j: Retreiving an instance of org.apache.log4j.Logger.
log4j: Setting [ProgressDone] additivity to [false].
log4j: Level value for ProgressDone is  [INFO].
log4j: ProgressDone level set to INFO
log4j: Class name: [org.apache.log4j.ConsoleAppender]
log4j: Parsing layout of class: "org.apache.log4j.PatternLayout"
log4j: Setting property [conversionPattern] to [%m%n].
log4j: Adding appender named [eolAppender] to category [ProgressDone].
log4j: Level value for root is  [INFO].
log4j: root level set to INFO
log4j: Class name: [org.apache.log4j.ConsoleAppender]
log4j: Parsing layout of class: "org.apache.log4j.PatternLayout"
log4j: Setting property [conversionPattern] to [%d{dd MMM yyyy HH:mm:ss} %5p %c{1} - %m%n].
log4j: Adding appender named [consoleAppender] to category [root].
load dictionary finished. ts=[4], wordCount=[22], itemCount=[44]
load dictionary finished. ts=[0], wordCount=[31], itemCount=[73]
load dictionary finished. ts=[1], wordCount=[79], itemCount=[161]
load dictionary finished. ts=[0], wordCount=[20], itemCount=[22]
input files count=[1]
Aug 24, 2022 2:54:21 PM com.melax.rnn.WorkingQueue <init>
INFO: create WorkingQueue, num_threads=[4]
Aug 24, 2022 2:54:21 PM edu.uth.clamp.nlp.omop.OMOPEncoder getTopN
SEVERE: Cannot enter synchronized block because "this.term_parser" is null
java.lang.NullPointerException: Cannot enter synchronized block because "this.term_parser" is null
    at edu.uth.clamp.nlp.omop.OMOPEncoder.getTopN(OMOPEncoder.java:260)
    at edu.uth.clamp.nlp.omop.OMOPEncoder.encode(OMOPEncoder.java:396)
    at edu.uth.clamp.nlp.omop.OMOPEncoder.encode(OMOPEncoder.java:384)
    at edu.uth.clamp.nlp.omop.OMOPEncoderUIMA.process(OMOPEncoderUIMA.java:72)
    at edu.uth.clamp.nlp.main.PipelineMain.main(PipelineMain.java:87)

Error repeats 78 times

sample_1041.txt processed..
dax-westerman commented 2 years ago

Update

Dropping OMOP_encoder from pipeline allows CLAMP_CMD to process pipeline built in CLAMP_WIN.