You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ctakes.apache.org by Graham Pitson <gp...@alphalink.com.au> on 2015/12/16 20:57:35 UTC

SideEffectAnnotator issues

Hi,

I'm hoping for some more insights into using the side effect annotator.

As per Pie Chen's suggestion I've added the side effect annotator to the 
default AggregatePlaintextFastUMLSProcessor. The xml changes are shown 
below.

Initially I was getting 'URI is not hierarchical' errors. After some 
searching I thought this might be due to a missing dictionary file and 
added sideEffect_dictionary.txt at 
'apache-ctakes-3.2.2\resources\org\apache\ctakes\sideeffect\lookup'. 
This stopped the URI errors. I put some dummy content in the dictionary 
(shown below; using the full content from here didn't help either - 
https://svn.apache.org/repos/asf/ctakes/trunk/ctakes-side-effect-res/src/main/resources/org/apache/ctakes/sideeffect/lookup/sideEffect_dictionary.txt).

Now as per the log files, I'm getting null pointer exceptions within 
sideEffectAnnotator.java - at 2 different locations as shown below. 
Getting an exception is dependent on the text analysed:
'Seen today. On tamoxifen 20 mg daily which caused headaches.' causes an 
exception.
'Seen today. On tamoxifen 20 mg daily which caused something.' does not 
(of course there is no clinical finding in the second text).

Given that others are using the side effect annotator, I'm guessing this 
is some kind of issue with my configuration/dictionary and would 
appreciate any advice.

I'm running the latest version of cTakes 'as is'.

Thanks in advance.


Graham Pitson

-----------------------------AggregatePlaintextFastUMLSProcessor.xml---------------------------------------------

<delegateAnalysisEngine key="SideEffectAnnotator">
      <import location="SideEffectAnnotator.xml"/>
</delegateAnalysisEngine>

	<node>ConstituencyParser</node>

	<node>SideEffectAnnotator</node>

         <!-- <node>AssertionAnnotator</node> -->
         <!-- <node>StatusAnnotator</node> -->
        	<!-- <node>NegationAnnotator</node> -->
        	<node>GenericCleartkAnalysisEngine</node>

-------------------------test text-------------------------------

'Seen today. On tamoxifen 20 mg daily which caused headaches.'

-------------------------------------------error logs (2 different 
exception 
locations)-----------------------------------------------------------


17/12/15 6:21:24 AM - 14: 
org.apache.uima.tools.cvd.MainFrame.handleException(526): SEVERE: 
Annotator processing failed.
org.apache.uima.analysis_engine.AnalysisEngineProcessException: 
Annotator processing failed.
     at 
org.apache.uima.analysis_engine.impl.PrimitiveAnalysisEngine_impl.callAnalysisComponentProcess(PrimitiveAnalysisEngine_impl.java:391)
     at 
org.apache.uima.analysis_engine.impl.PrimitiveAnalysisEngine_impl.processAndOutputNewCASes(PrimitiveAnalysisEngine_impl.java:296)
     at 
org.apache.uima.analysis_engine.asb.impl.ASB_impl$AggregateCasIterator.processUntilNextOutputCas(ASB_impl.java:567)
     at 
org.apache.uima.analysis_engine.asb.impl.ASB_impl$AggregateCasIterator.<init>(ASB_impl.java:409)
     at 
org.apache.uima.analysis_engine.asb.impl.ASB_impl.process(ASB_impl.java:342)
     at 
org.apache.uima.analysis_engine.impl.AggregateAnalysisEngine_impl.processAndOutputNewCASes(AggregateAnalysisEngine_impl.java:267)
     at 
org.apache.uima.analysis_engine.impl.AnalysisEngineImplBase.process(AnalysisEngineImplBase.java:267)
     at 
org.apache.uima.tools.cvd.MainFrame.internalRunAE(MainFrame.java:1526)
     at org.apache.uima.tools.cvd.MainFrame.runAE(MainFrame.java:429)
     at 
org.apache.uima.tools.cvd.control.AnnotatorRerunEventHandler.actionPerformed(AnnotatorRerunEventHandler.java:40)
     at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
     at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
     at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
     at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
     at javax.swing.AbstractButton.doClick(Unknown Source)
     at javax.swing.plaf.basic.BasicMenuItemUI.doClick(Unknown Source)
     at 
javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(Unknown Source)
     at java.awt.Component.processMouseEvent(Unknown Source)
     at javax.swing.JComponent.processMouseEvent(Unknown Source)
     at java.awt.Component.processEvent(Unknown Source)
     at java.awt.Container.processEvent(Unknown Source)
     at java.awt.Component.dispatchEventImpl(Unknown Source)
     at java.awt.Container.dispatchEventImpl(Unknown Source)
     at java.awt.Component.dispatchEvent(Unknown Source)
     at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
     at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
     at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
     at java.awt.Container.dispatchEventImpl(Unknown Source)
     at java.awt.Window.dispatchEventImpl(Unknown Source)
     at java.awt.Component.dispatchEvent(Unknown Source)
     at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
     at java.awt.EventQueue.access$200(Unknown Source)
     at java.awt.EventQueue$3.run(Unknown Source)
     at java.awt.EventQueue$3.run(Unknown Source)
     at java.security.AccessController.doPrivileged(Native Method)
     at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown 
Source)
     at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown 
Source)
     at java.awt.EventQueue$4.run(Unknown Source)
     at java.awt.EventQueue$4.run(Unknown Source)
     at java.security.AccessController.doPrivileged(Native Method)
     at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown 
Source)
     at java.awt.EventQueue.dispatchEvent(Unknown Source)
     at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
     at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
     at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
     at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
     at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
     at java.awt.EventDispatchThread.run(Unknown Source)
Caused by: java.lang.NullPointerException
     at 
org.apache.ctakes.sideeffect.ae.SideEffectAnnotator.isInAllergySection(SideEffectAnnotator.java:759)
     at 
org.apache.ctakes.sideeffect.ae.SideEffectAnnotator.getSideEffectsWithPrioritizedRule(SideEffectAnnotator.java:342)
     at 
org.apache.ctakes.sideeffect.ae.SideEffectAnnotator.process(SideEffectAnnotator.java:180)
     at 
org.apache.uima.analysis_component.JCasAnnotator_ImplBase.process(JCasAnnotator_ImplBase.java:48)
     at 
org.apache.uima.analysis_engine.impl.PrimitiveAnalysisEngine_impl.callAnalysisComponentProcess(PrimitiveAnalysisEngine_impl.java:375)
     ... 47 more


     at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
     at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
     at java.awt.EventDispatchThread.run(Unknown Source)
Caused by: java.lang.NullPointerException
     at 
org.apache.ctakes.sideeffect.ae.SideEffectAnnotator.getPotentialSideEffects(SideEffectAnnotator.java:296)
     at 
org.apache.ctakes.sideeffect.ae.SideEffectAnnotator.process(SideEffectAnnotator.java:177)
     at 
org.apache.uima.analysis_component.JCasAnnotator_ImplBase.process(JCasAnnotator_ImplBase.java:48)
     at 
org.apache.uima.analysis_engine.impl.PrimitiveAnalysisEngine_impl.callAnalysisComponentProcess(PrimitiveAnalysisEngine_impl.java:375)
     ... 47 more

--------------------------------------------dummy 
dictionary----------------------------------------------------

//FORMAT: generic drug|brand drug|side effect1, side effect2,...
Tamoxifen|Nolvadex,Tam|Hot flushes, nausea, endometrial cancer



RE: SideEffectAnnotator issues

Posted by "Savova, Guergana" <Gu...@childrens.harvard.edu>.
The side effects annotator is really old (circa 2010). It was initially developed for psychiatric drugs and their side effects. Description is in this publication: http://jamia.oxfordjournals.org/content/18/Supplement_1/i144.abstract 
I am not quite sure how well the annotator works now... We are working on other methods for side effect extraction and are likely to publish them in spring of 2016.

I hope this helps.
--Guergana

Guergana Savova, PhD, FACMI
Associate Professor
PI Natural Language Processing Lab
Boston Children's Hospital and Harvard Medical School
300 Longwood Avenue
Mailstop: BCH3092
Enders 144.1
Boston, MA 02115
Tel: (617) 919-2972
Fax: (617) 730-0817
Harvard Scholar: http://scholar.harvard.edu/guergana_k_savova/biocv

-----Original Message-----
From: Graham Pitson [mailto:gpitson@alphalink.com.au] 
Sent: Wednesday, December 16, 2015 2:58 PM
To: user@ctakes.apache.org
Subject: SideEffectAnnotator issues

Hi,

I'm hoping for some more insights into using the side effect annotator.

As per Pie Chen's suggestion I've added the side effect annotator to the default AggregatePlaintextFastUMLSProcessor. The xml changes are shown below.

Initially I was getting 'URI is not hierarchical' errors. After some searching I thought this might be due to a missing dictionary file and added sideEffect_dictionary.txt at 'apache-ctakes-3.2.2\resources\org\apache\ctakes\sideeffect\lookup'. 
This stopped the URI errors. I put some dummy content in the dictionary (shown below; using the full content from here didn't help either - https://urldefense.proofpoint.com/v2/url?u=https-3A__svn.apache.org_repos_asf_ctakes_trunk_ctakes-2Dside-2Deffect-2Dres_src_main_resources_org_apache_ctakes_sideeffect_lookup_sideEffect-5Fdictionary.txt&d=BQICaQ&c=qS4goWBT7poplM69zy_3xhKwEW14JZMSdioCoppxeFU&r=SeLHlpmrGNnJ9mI2WCgf_wwQk9zL4aIrVmfBoSi-j0kfEcrO4yRGmRCJNAr-rCmP&m=cq3dLDFzFSH1DRnh30N1vwFozDMinGQA_mbzqpzsuXA&s=wosr80zHuzsbhDmk3ABFQB5BJckImO8OO9S1nrLQWMU&e= ).

Now as per the log files, I'm getting null pointer exceptions within sideEffectAnnotator.java - at 2 different locations as shown below. 
Getting an exception is dependent on the text analysed:
'Seen today. On tamoxifen 20 mg daily which caused headaches.' causes an exception.
'Seen today. On tamoxifen 20 mg daily which caused something.' does not (of course there is no clinical finding in the second text).

Given that others are using the side effect annotator, I'm guessing this is some kind of issue with my configuration/dictionary and would appreciate any advice.

I'm running the latest version of cTakes 'as is'.

Thanks in advance.


Graham Pitson

-----------------------------AggregatePlaintextFastUMLSProcessor.xml---------------------------------------------

<delegateAnalysisEngine key="SideEffectAnnotator">
      <import location="SideEffectAnnotator.xml"/>
</delegateAnalysisEngine>

	<node>ConstituencyParser</node>

	<node>SideEffectAnnotator</node>

         <!-- <node>AssertionAnnotator</node> -->
         <!-- <node>StatusAnnotator</node> -->
        	<!-- <node>NegationAnnotator</node> -->
        	<node>GenericCleartkAnalysisEngine</node>

-------------------------test text-------------------------------

'Seen today. On tamoxifen 20 mg daily which caused headaches.'

-------------------------------------------error logs (2 different exception
locations)-----------------------------------------------------------


17/12/15 6:21:24 AM - 14: 
org.apache.uima.tools.cvd.MainFrame.handleException(526): SEVERE: 
Annotator processing failed.
org.apache.uima.analysis_engine.AnalysisEngineProcessException: 
Annotator processing failed.
     at
org.apache.uima.analysis_engine.impl.PrimitiveAnalysisEngine_impl.callAnalysisComponentProcess(PrimitiveAnalysisEngine_impl.java:391)
     at
org.apache.uima.analysis_engine.impl.PrimitiveAnalysisEngine_impl.processAndOutputNewCASes(PrimitiveAnalysisEngine_impl.java:296)
     at
org.apache.uima.analysis_engine.asb.impl.ASB_impl$AggregateCasIterator.processUntilNextOutputCas(ASB_impl.java:567)
     at
org.apache.uima.analysis_engine.asb.impl.ASB_impl$AggregateCasIterator.<init>(ASB_impl.java:409)
     at
org.apache.uima.analysis_engine.asb.impl.ASB_impl.process(ASB_impl.java:342)
     at
org.apache.uima.analysis_engine.impl.AggregateAnalysisEngine_impl.processAndOutputNewCASes(AggregateAnalysisEngine_impl.java:267)
     at
org.apache.uima.analysis_engine.impl.AnalysisEngineImplBase.process(AnalysisEngineImplBase.java:267)
     at
org.apache.uima.tools.cvd.MainFrame.internalRunAE(MainFrame.java:1526)
     at org.apache.uima.tools.cvd.MainFrame.runAE(MainFrame.java:429)
     at
org.apache.uima.tools.cvd.control.AnnotatorRerunEventHandler.actionPerformed(AnnotatorRerunEventHandler.java:40)
     at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
     at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
     at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
     at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
     at javax.swing.AbstractButton.doClick(Unknown Source)
     at javax.swing.plaf.basic.BasicMenuItemUI.doClick(Unknown Source)
     at
javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(Unknown Source)
     at java.awt.Component.processMouseEvent(Unknown Source)
     at javax.swing.JComponent.processMouseEvent(Unknown Source)
     at java.awt.Component.processEvent(Unknown Source)
     at java.awt.Container.processEvent(Unknown Source)
     at java.awt.Component.dispatchEventImpl(Unknown Source)
     at java.awt.Container.dispatchEventImpl(Unknown Source)
     at java.awt.Component.dispatchEvent(Unknown Source)
     at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
     at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
     at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
     at java.awt.Container.dispatchEventImpl(Unknown Source)
     at java.awt.Window.dispatchEventImpl(Unknown Source)
     at java.awt.Component.dispatchEvent(Unknown Source)
     at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
     at java.awt.EventQueue.access$200(Unknown Source)
     at java.awt.EventQueue$3.run(Unknown Source)
     at java.awt.EventQueue$3.run(Unknown Source)
     at java.security.AccessController.doPrivileged(Native Method)
     at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown
Source)
     at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown
Source)
     at java.awt.EventQueue$4.run(Unknown Source)
     at java.awt.EventQueue$4.run(Unknown Source)
     at java.security.AccessController.doPrivileged(Native Method)
     at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown
Source)
     at java.awt.EventQueue.dispatchEvent(Unknown Source)
     at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
     at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
     at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
     at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
     at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
     at java.awt.EventDispatchThread.run(Unknown Source) Caused by: java.lang.NullPointerException
     at
org.apache.ctakes.sideeffect.ae.SideEffectAnnotator.isInAllergySection(SideEffectAnnotator.java:759)
     at
org.apache.ctakes.sideeffect.ae.SideEffectAnnotator.getSideEffectsWithPrioritizedRule(SideEffectAnnotator.java:342)
     at
org.apache.ctakes.sideeffect.ae.SideEffectAnnotator.process(SideEffectAnnotator.java:180)
     at
org.apache.uima.analysis_component.JCasAnnotator_ImplBase.process(JCasAnnotator_ImplBase.java:48)
     at
org.apache.uima.analysis_engine.impl.PrimitiveAnalysisEngine_impl.callAnalysisComponentProcess(PrimitiveAnalysisEngine_impl.java:375)
     ... 47 more


     at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
     at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
     at java.awt.EventDispatchThread.run(Unknown Source) Caused by: java.lang.NullPointerException
     at
org.apache.ctakes.sideeffect.ae.SideEffectAnnotator.getPotentialSideEffects(SideEffectAnnotator.java:296)
     at
org.apache.ctakes.sideeffect.ae.SideEffectAnnotator.process(SideEffectAnnotator.java:177)
     at
org.apache.uima.analysis_component.JCasAnnotator_ImplBase.process(JCasAnnotator_ImplBase.java:48)
     at
org.apache.uima.analysis_engine.impl.PrimitiveAnalysisEngine_impl.callAnalysisComponentProcess(PrimitiveAnalysisEngine_impl.java:375)
     ... 47 more

--------------------------------------------dummy
dictionary----------------------------------------------------

//FORMAT: generic drug|brand drug|side effect1, side effect2,...
Tamoxifen|Nolvadex,Tam|Hot flushes, nausea, endometrial cancer