OHNLP / MedTagger

MedTagger is a light weight clinical NLP system built upon Apache UIMA.
Apache License 2.0
63 stars 19 forks source link

Facing exceptions while running the project #14

Closed BeardyMan37 closed 4 years ago

BeardyMan37 commented 4 years ago

Hello, I followed the video for running the project, but I'm facing some exceptions.

Input Dir: /home/upm/Desktop/Projects/14.MedTagger/input Output Dir: /home/upm/Desktop/Projects/14.MedTagger/output IE Rules: /home/upm/Desktop/Projects/14.MedTagger/src/main/resources/medtaggerieresources/pad 2020-08-11 14:49:55 INFO LvgLookup:144 - loading LVG condensed dictionary from dictStream 2020-08-11 14:49:55 INFO LvgLookup:162 - loaded resource, lines=87272 Aug 11, 2020 2:49:55 PM opennlp.uima.chunker.Chunker initialize(113) INFO: Initializing the OpenNLP Chunker annotator. Aug 11, 2020 2:49:55 PM opennlp.uima.tokenize.AbstractTokenizer initialize(71) INFO: Initializing the OpenNLP Tokenizer annotator. Aug 11, 2020 2:49:55 PM opennlp.uima.util.AnnotatorUtil getOptionalParameter(422) INFO: opennlp.uima.IsRemoveExistingAnnotations = not set Aug 11, 2020 2:49:55 PM opennlp.uima.sentdetect.AbstractSentenceDetector initialize(61) INFO: Initializing the OpenNLP Sentence annotator. Aug 11, 2020 2:49:55 PM opennlp.uima.util.AnnotatorUtil getOptionalParameter(422) INFO: opennlp.uima.IsRemoveExistingAnnotations = not set 2020-08-11 14:49:55 INFO LvgLookup:144 - loading LVG condensed dictionary from dictStream 2020-08-11 14:49:55 INFO LvgLookup:162 - loaded resource, lines=87272 Aug 11, 2020 2:49:55 PM opennlp.uima.postag.POSTagger initialize(111) INFO: Initializing the OpenNLP Part of Speech annotator. Aug 11, 2020 2:49:55 PM opennlp.uima.util.AnnotatorUtil getOptionalParameter(422) INFO: opennlp.uima.BeamSize = not set Exception in thread "main" org.apache.uima.resource.ResourceInitializationException: Initialization of annotator class "org.ohnlp.medtagger.ie.ae.MedTaggerIEAnnotator" failed. (Descriptor: file:/home/upm/Desktop/Projects/14.MedTagger/src/main/resources/org/ohnlp/medtagger/ie/aes/MedTaggerIEAnnotatorAE.xml) at org.apache.uima.analysis_engine.impl.PrimitiveAnalysisEngine_impl.initializeAnalysisComponent(PrimitiveAnalysisEngine_impl.java:272) at org.apache.uima.analysis_engine.impl.PrimitiveAnalysisEngine_impl.initialize(PrimitiveAnalysisEngine_impl.java:172) at org.apache.uima.impl.AnalysisEngineFactory_impl.produceResource(AnalysisEngineFactory_impl.java:94) at org.apache.uima.impl.CompositeResourceFactory_impl.produceResource(CompositeResourceFactory_impl.java:62) at org.apache.uima.UIMAFramework.produceResource(UIMAFramework.java:279) at org.apache.uima.UIMAFramework.produceAnalysisEngine(UIMAFramework.java:407) at org.apache.uima.analysis_engine.asb.impl.ASB_impl.setup(ASB_impl.java:256) at org.apache.uima.analysis_engine.impl.AggregateAnalysisEngine_impl.initASB(AggregateAnalysisEngine_impl.java:435) at org.apache.uima.analysis_engine.impl.AggregateAnalysisEngine_impl.initializeAggregateAnalysisEngine(AggregateAnalysisEngine_impl.java:379) at org.apache.uima.analysis_engine.impl.AggregateAnalysisEngine_impl.initialize(AggregateAnalysisEngine_impl.java:192) at org.apache.uima.impl.AnalysisEngineFactory_impl.produceResource(AnalysisEngineFactory_impl.java:94) at org.apache.uima.impl.CompositeResourceFactory_impl.produceResource(CompositeResourceFactory_impl.java:62) at org.apache.uima.UIMAFramework.produceResource(UIMAFramework.java:279) at org.apache.uima.UIMAFramework.produceAnalysisEngine(UIMAFramework.java:407) at org.apache.uima.analysis_engine.asb.impl.ASB_impl.setup(ASB_impl.java:256) at org.apache.uima.analysis_engine.impl.AggregateAnalysisEngine_impl.initASB(AggregateAnalysisEngine_impl.java:435) at org.apache.uima.analysis_engine.impl.AggregateAnalysisEngine_impl.initializeAggregateAnalysisEngine(AggregateAnalysisEngine_impl.java:379) at org.apache.uima.analysis_engine.impl.AggregateAnalysisEngine_impl.initialize(AggregateAnalysisEngine_impl.java:192) at org.apache.uima.impl.AnalysisEngineFactory_impl.produceResource(AnalysisEngineFactory_impl.java:94) at org.apache.uima.impl.CompositeResourceFactory_impl.produceResource(CompositeResourceFactory_impl.java:62) at org.apache.uima.UIMAFramework.produceResource(UIMAFramework.java:279) at org.apache.uima.UIMAFramework.produceResource(UIMAFramework.java:331) at org.apache.uima.UIMAFramework.produceAnalysisEngine(UIMAFramework.java:448) at org.ohnlp.medtagger.fit.SimpleCliPipeline.runPipeline(SimpleCliPipeline.java:54) at org.ohnlp.medtagger.fit.Main.main(Main.java:49) Caused by: java.lang.IllegalArgumentException: Missing scheme at java.base/java.nio.file.Path.of(Path.java:199) at java.base/java.nio.file.Paths.get(Paths.java:97) at org.ohnlp.medtagger.ie.util.ResourceUtilManager.readResourcesFiles(ResourceUtilManager.java:102) at org.ohnlp.medtagger.ie.util.ResourceUtilManager.<init>(ResourceUtilManager.java:85) at org.ohnlp.medtagger.ie.ae.MedTaggerIEAnnotator.initialize(MedTaggerIEAnnotator.java:90) at org.apache.uima.analysis_engine.impl.PrimitiveAnalysisEngine_impl.initializeAnalysisComponent(PrimitiveAnalysisEngine_impl.java:267) ... 24 more

qqndrew commented 4 years ago

Try adding a file:///./relative/path/to/your/rule/folder instead - this might have been introduced by a recent change to use URIs instead.

BeardyMan37 commented 4 years ago

Sorry, having a bit difficulty in understanding. Should I change my bash file? Here is the current bash file. `#!/bin/bash

INPUTDIR="/home/upm/Desktop/Projects/14.MedTagger/input" OUTPUTDIR="/home/upm/Desktop/Projects/14.MedTagger/output" RULEDIR="/home/upm/Desktop/Projects/14.MedTagger/src/main/resources/medtaggerieresources/pad"

MEDTAGGER_DIR=$(cd dirname $0 && pwd) cd $MEDTAGGER_DIR

java -cp MedTagger.jar org.ohnlp.medtagger.fit.Main $INPUTDIR $OUTPUTDIR $RULEDIR`

qqndrew commented 4 years ago

Please try the newly released v1.0.7 build, which should address this issue.

BeardyMan37 commented 4 years ago

Thank you. I was able to run the project successfully on Pad ruleset. But when I tried to run the covid19 ruleset, I faced some problems. Attaching the log below. Input Dir: /home/upm/Desktop/Projects/Symptom-Collection/1.MedTagger/input Output Dir: /home/upm/Desktop/Projects/Symptom-Collection/1.MedTagger/output IE Rules: file:///home/upm/Desktop/Projects/Symptom-Collection/1.MedTagger/src/main/resources/medtaggerieresources/covid19/ 2020-08-12 14:22:07 INFO LvgLookup:144 - loading LVG condensed dictionary from dictStream 2020-08-12 14:22:08 INFO LvgLookup:162 - loaded resource, lines=87272 Aug 12, 2020 2:22:08 PM opennlp.uima.chunker.Chunker initialize(113) INFO: Initializing the OpenNLP Chunker annotator. Aug 12, 2020 2:22:08 PM opennlp.uima.tokenize.AbstractTokenizer initialize(71) INFO: Initializing the OpenNLP Tokenizer annotator. Aug 12, 2020 2:22:08 PM opennlp.uima.util.AnnotatorUtil getOptionalParameter(422) INFO: opennlp.uima.IsRemoveExistingAnnotations = not set Aug 12, 2020 2:22:08 PM opennlp.uima.sentdetect.AbstractSentenceDetector initialize(61) INFO: Initializing the OpenNLP Sentence annotator. Aug 12, 2020 2:22:08 PM opennlp.uima.util.AnnotatorUtil getOptionalParameter(422) INFO: opennlp.uima.IsRemoveExistingAnnotations = not set 2020-08-12 14:22:08 INFO LvgLookup:144 - loading LVG condensed dictionary from dictStream 2020-08-12 14:22:08 INFO LvgLookup:162 - loaded resource, lines=87272 Aug 12, 2020 2:22:08 PM opennlp.uima.postag.POSTagger initialize(111) INFO: Initializing the OpenNLP Part of Speech annotator. Aug 12, 2020 2:22:08 PM opennlp.uima.util.AnnotatorUtil getOptionalParameter(422) INFO: opennlp.uima.BeamSize = not set 2020-08-12 14:22:08 INFO ResourceUtilManager:129 - Adding regexp from resource: reLYMPHOPENIA 2020-08-12 14:22:08 INFO ResourceUtilManager:129 - Adding regexp from resource: reSORETHROAT 2020-08-12 14:22:08 INFO ResourceUtilManager:129 - Adding regexp from resource: reGROUNDGLASSINFILTRATES 2020-08-12 14:22:08 INFO ResourceUtilManager:129 - Adding regexp from resource: reELEVATEDLDH 2020-08-12 14:22:08 INFO ResourceUtilManager:129 - Adding regexp from resource: reDIARRHEA 2020-08-12 14:22:08 INFO ResourceUtilManager:129 - Adding regexp from resource: reNASALCONGESTION 2020-08-12 14:22:08 INFO ResourceUtilManager:129 - Adding regexp from resource: reDRYCOUGH 2020-08-12 14:22:08 INFO ResourceUtilManager:129 - Adding regexp from resource: reFATIGUE 2020-08-12 14:22:08 INFO ResourceUtilManager:129 - Adding regexp from resource: reDYSPNEA 2020-08-12 14:22:08 INFO ResourceUtilManager:129 - Adding regexp from resource: reFEVER 2020-08-12 14:22:08 INFO ResourceUtilManager:129 - Adding regexp from resource: reHEADACHE 2020-08-12 14:22:08 INFO ResourceUtilManager:129 - Adding regexp from resource: reMYALGIA 2020-08-12 14:22:08 INFO ResourceUtilManager:129 - Adding regexp from resource: reABDOMINALPAIN 2020-08-12 14:22:08 INFO ResourceUtilManager:129 - Adding regexp from resource: rePATCHYINFILTRATES 2020-08-12 14:22:08 INFO ResourceUtilManager:129 - Adding regexp from resource: rePROLONGEDPROTOTHROMBIN 2020-08-12 14:22:08 INFO ResourceUtilManager:129 - Adding regexp from resource: reFLUEXPLICIT 2020-08-12 14:22:08 INFO ResourceUtilManager:129 - Adding regexp from resource: reAPPETITELOSS 2020-08-12 14:22:08 INFO ResourceUtilManager:129 - Adding regexp from resource: reFLUSHOT 2020-08-12 14:22:08 INFO ResourceUtilManager:129 - Adding rules from resource: matchrules 2020-08-12 14:22:08 ERROR ResourceUtilManager:188 - Error creating rule:cm_moletest

qqndrew commented 4 years ago

Please try replacing what is in covid19/used_resources.txt with https://github.com/OHNLP/MedTagger/blob/master/src/main/resources/medtaggerieresources/covid19/used_resources.txt and let me know if that works.

BeardyMan37 commented 4 years ago

Excellent. Worked perfectly. Closing the issue.