You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ctakes.apache.org by Chahal Arora <ch...@raxa.com> on 2017/11/30 12:50:16 UTC
Drug NER - Empty Dosage/Strength/Frequency Values
Hi All,
I am trying to use the Drug NER using the pipeline. I am able to get the
medication mention
(org.apache.ctakes.typesystem.type.textsem.MedicationMention) and get the
value for drug but the issue is that I am getting null values for
medication dosage/frequency/strength/duration.
I have looked into some of the solution provided in the mailing list but
still the same result-
1)
http://mail-archives.apache.org/mod_mbox/ctakes-user/201711.mbox/%3Cb7d4354fde864bbba44d2427f281ae94@BLRKECMBX34.ad.infosys.com%3E
2)
http://dev.ctakes.apache.narkive.com/ixUkpiO5/enabling-drugner-pipeline-and-identifying-dates#post14
Some sample input text that I have tested on -
1) ASAT 10mg Tablet(Atorvastatin): Take 1 Tablet Four times daily, after
meals and at bedtime for 5 days.
2) The patient started study treatment of Thalomid 200mg (days 1-21), and
Epirubicin, 20 mg /m2 (days 1, 8, and 15) on 06/07/02 for the treatment of
hepatocellular carcinoma.
3) ASAT 10mg Four times daily
4) paracetamol BID AC 10d PO, aspirin BD
Regards
Chahal Arora
Software Engineer
Raxa
RE: Drug NER - Empty Dosage/Strength/Frequency Values [EXTERNAL]
Posted by "Finan, Sean" <Se...@childrens.harvard.edu>.
Hi Chalal Arora,
You can change values in a piper file in two ways.
To set a value "globally" use the "set" command:
set DISTANCE=14
set BOUNDARY_ANN_TYPE=14
To set a value just for one annotator enter it on the "add" line:
add DrugMentionAnnotator DISTANCE=14 BOUNDARY_ANN_TYPE=14
If the DrugMentionAnnotator has not been refactored to a uimafit component then it may not work ... I haven't looked at that code but some of the older annotators do strange things.
https://cwiki.apache.org/confluence/display/CTAKES/Piper+Files
Sean
-----Original Message-----
From: Chahal Arora [mailto:chahal.arora@raxa.com]
Sent: Friday, December 01, 2017 8:24 AM
To: dev@ctakes.apache.org
Subject: Re: Drug NER - Empty Dosage/Strength/Frequency Values [EXTERNAL]
Hi All,
While debugging DrugMentionAnnotator.java, I found that the issue was coming because the value of variables iWindowSize, iBoundaryAnnType have been set to -1 by default. The value of these variables does not change because in the following code I get null values for
*windowSize* and *boundaryAnnTypeName
*in the initialize method of DrugMentionAnnotator*.*
String windowSize = (String)annotCtx.getConfigParameterValue(DISTANCE);
String boundaryAnnTypeName
=(String)annotCtx.getConfigParameterValue(BOUNDARY_ANN_TYPE);
if(windowSize != null)
iWindowSize = Integer.parseInt(windowSize);
if(boundaryAnnTypeName != null)
iBoundaryAnnType = JCasUtil.getType(boundaryAnnTypeName);
The DrugNer worked for me when I changed the value of *iWindowSize*,
*iBoundaryAnnType* to the length of the input string.
Does anyone know how can I add this change from piper file and as far I can see the right way to do it is by changing the values of *DISTANCE* and
*BOUNDARY_ANN_TYPE* but I am not sure about this and don't know how to do it?
Can anyone help me with this?
Regards
Chahal Arora
Software Engineer
Raxa
Regards
Chahal Arora
Software Engineer
Raxa
On Thu, Nov 30, 2017 at 6:20 PM, Chahal Arora <ch...@raxa.com> wrote:
> Hi All,
>
> I am trying to use the Drug NER using the pipeline. I am able to get
> the medication mention
> (org.apache.ctakes.typesystem.type.textsem.MedicationMention)
> and get the value for drug but the issue is that I am getting null
> values for medication dosage/frequency/strength/duration.
>
> I have looked into some of the solution provided in the mailing list
> but still the same result-
>
> 1)
> https://urldefense.proofpoint.com/v2/url?u=http-3A__mail-2Darchives.ap
> ache.org_mod-5Fmbox_ctakes-2Duser_201711.mbox_-25&d=DwIBaQ&c=qS4goWBT7
> poplM69zy_3xhKwEW14JZMSdioCoppxeFU&r=fs67GvlGZstTpyIisCYNYmQCP6r0bcpKG
> d4f7d4gTao&m=-2rrvnxOquKSuy0j8mA2pAlrOSOTTCmQfJZda96Q_v8&s=S06l1VQ4SgP
> cBk2000e7WZYb55MKeayF5rFGmgjMxMY&e=
> 3Cb7d4354fde864bbba44d2427f281ae94@BLRKECMBX34.ad.infosys.com%3E
>
> 2)
> https://urldefense.proofpoint.com/v2/url?u=http-3A__dev.ctakes.apache.
> narkive.com_ixUkpiO5_enabling-2D&d=DwIBaQ&c=qS4goWBT7poplM69zy_3xhKwEW
> 14JZMSdioCoppxeFU&r=fs67GvlGZstTpyIisCYNYmQCP6r0bcpKGd4f7d4gTao&m=-2rr
> vnxOquKSuy0j8mA2pAlrOSOTTCmQfJZda96Q_v8&s=0wFElBI6WRQmVZQUWAVuCxyYsR0U
> ctxpvVa617s_0qk&e=
> drugner-pipeline-and-identifying-dates#post14
>
> Some sample input text that I have tested on -
>
> 1) ASAT 10mg Tablet(Atorvastatin): Take 1 Tablet Four times daily,
> after meals and at bedtime for 5 days.
>
> 2) The patient started study treatment of Thalomid 200mg (days 1-21),
> and Epirubicin, 20 mg /m2 (days 1, 8, and 15) on 06/07/02 for the
> treatment of hepatocellular carcinoma.
>
> 3) ASAT 10mg Four times daily
>
> 4) paracetamol BID AC 10d PO, aspirin BD
>
>
> Regards
> Chahal Arora
> Software Engineer
> Raxa
>
Re: Drug NER - Empty Dosage/Strength/Frequency Values
Posted by Chahal Arora <ch...@raxa.com>.
Hi Sean and Taylor,
Thank you for the help.
@Taylor I was gettting exactly same output and exception described by you
and the adding " add org.apache.ctakes.drugner.ae.DrugMentionAnnotator
STATUS_BOUNDARY_ANN_TYPE="org.apache.ctakes.typesystem.type.textsem.MedicationMention"
" in the piper file worked for me.
Regards
Chahal Arora
Software Engineer
Raxa
On Mon, Dec 4, 2017 at 2:21 PM, Taylor Cassidy <ta...@gmail.com>
wrote:
> Chahal,
>
> By the way, I was having a similar problem, but I don't
> think iBoundaryAnnType has to do with offsets, but rather refers to an
> Annotation type.
>
> when it's set to -1, generateDrugMentionsAndAnnotations throws an
> exception, which is ArrayOutOfBounds stemming from
> getNarrativeSpansContainingGivenSpanType:
>
> Iterator iter = indexes.getAnnotationIndex(annotType).iterator();
>
> (where annotType is iBoundaryAnnType.)
>
> It should be set by passing a string, which is the name of a class, e.g.,
>
> add org.apache.ctakes.drugner.ae.DrugMentionAnnotator
> STATUS_BOUNDARY_ANN_TYPE="org.apache.ctakes.typesystem.type.
> textsem.MedicationMention"
>
> (note that you have to use STATUS_BOUNDARY_ANN_TYPE)
>
> Also, I think it's fine to leave DISTANCE at -1, as it looks to me like it
> is more of a maximum than a minimum value.
>
> -Taylor
>
>
>
>
> On Fri, Dec 1, 2017 at 5:23 AM Chahal Arora <ch...@raxa.com> wrote:
>
> > Hi All,
> >
> > While debugging DrugMentionAnnotator.java, I found that the issue was
> > coming because the value of variables iWindowSize, iBoundaryAnnType have
> > been set to -1 by default. The value of these variables does not
> > change because in the following code I get null values for
> > *windowSize* and *boundaryAnnTypeName
> > *in the initialize method of DrugMentionAnnotator*.*
> >
> > String windowSize = (String)annotCtx.getConfigParameterValue(DISTANCE);
> > String boundaryAnnTypeName
> > =(String)annotCtx.getConfigParameterValue(BOUNDARY_ANN_TYPE);
> >
> > if(windowSize != null)
> > iWindowSize = Integer.parseInt(windowSize);
> >
> > if(boundaryAnnTypeName != null)
> > iBoundaryAnnType = JCasUtil.getType(boundaryAnnTypeName);
> >
> >
> > The DrugNer worked for me when I changed the value of *iWindowSize*,
> > *iBoundaryAnnType* to the length of the input string.
> >
> > Does anyone know how can I add this change from piper file and as far I
> can
> > see the right way to do it is by changing the values of *DISTANCE* and
> > *BOUNDARY_ANN_TYPE* but I am not sure about this and don't know how to do
> > it?
> >
> > Can anyone help me with this?
> >
> > Regards
> > Chahal Arora
> > Software Engineer
> > Raxa
> >
> > Regards
> > Chahal Arora
> > Software Engineer
> > Raxa
> >
> > On Thu, Nov 30, 2017 at 6:20 PM, Chahal Arora <ch...@raxa.com>
> > wrote:
> >
> > > Hi All,
> > >
> > > I am trying to use the Drug NER using the pipeline. I am able to get
> the
> > > medication mention
> > (org.apache.ctakes.typesystem.type.textsem.MedicationMention)
> > > and get the value for drug but the issue is that I am getting null
> values
> > > for medication dosage/frequency/strength/duration.
> > >
> > > I have looked into some of the solution provided in the mailing list
> but
> > > still the same result-
> > >
> > > 1) http://mail-archives.apache.org/mod_mbox/ctakes-user/201711.mbox/%
> > > 3Cb7d4354fde864bbba44d2427f281ae94@BLRKECMBX34.ad.infosys.com%3E
> > >
> > > 2) http://dev.ctakes.apache.narkive.com/ixUkpiO5/enabling-
> > > drugner-pipeline-and-identifying-dates#post14
> > >
> > > Some sample input text that I have tested on -
> > >
> > > 1) ASAT 10mg Tablet(Atorvastatin): Take 1 Tablet Four times daily,
> after
> > > meals and at bedtime for 5 days.
> > >
> > > 2) The patient started study treatment of Thalomid 200mg (days 1-21),
> and
> > > Epirubicin, 20 mg /m2 (days 1, 8, and 15) on 06/07/02 for the treatment
> > of
> > > hepatocellular carcinoma.
> > >
> > > 3) ASAT 10mg Four times daily
> > >
> > > 4) paracetamol BID AC 10d PO, aspirin BD
> > >
> > >
> > > Regards
> > > Chahal Arora
> > > Software Engineer
> > > Raxa
> > >
> >
>
Re: Drug NER - Empty Dosage/Strength/Frequency Values
Posted by Taylor Cassidy <ta...@gmail.com>.
Chahal,
By the way, I was having a similar problem, but I don't
think iBoundaryAnnType has to do with offsets, but rather refers to an
Annotation type.
when it's set to -1, generateDrugMentionsAndAnnotations throws an
exception, which is ArrayOutOfBounds stemming from
getNarrativeSpansContainingGivenSpanType:
Iterator iter = indexes.getAnnotationIndex(annotType).iterator();
(where annotType is iBoundaryAnnType.)
It should be set by passing a string, which is the name of a class, e.g.,
add org.apache.ctakes.drugner.ae.DrugMentionAnnotator
STATUS_BOUNDARY_ANN_TYPE="org.apache.ctakes.typesystem.type.textsem.MedicationMention"
(note that you have to use STATUS_BOUNDARY_ANN_TYPE)
Also, I think it's fine to leave DISTANCE at -1, as it looks to me like it
is more of a maximum than a minimum value.
-Taylor
On Fri, Dec 1, 2017 at 5:23 AM Chahal Arora <ch...@raxa.com> wrote:
> Hi All,
>
> While debugging DrugMentionAnnotator.java, I found that the issue was
> coming because the value of variables iWindowSize, iBoundaryAnnType have
> been set to -1 by default. The value of these variables does not
> change because in the following code I get null values for
> *windowSize* and *boundaryAnnTypeName
> *in the initialize method of DrugMentionAnnotator*.*
>
> String windowSize = (String)annotCtx.getConfigParameterValue(DISTANCE);
> String boundaryAnnTypeName
> =(String)annotCtx.getConfigParameterValue(BOUNDARY_ANN_TYPE);
>
> if(windowSize != null)
> iWindowSize = Integer.parseInt(windowSize);
>
> if(boundaryAnnTypeName != null)
> iBoundaryAnnType = JCasUtil.getType(boundaryAnnTypeName);
>
>
> The DrugNer worked for me when I changed the value of *iWindowSize*,
> *iBoundaryAnnType* to the length of the input string.
>
> Does anyone know how can I add this change from piper file and as far I can
> see the right way to do it is by changing the values of *DISTANCE* and
> *BOUNDARY_ANN_TYPE* but I am not sure about this and don't know how to do
> it?
>
> Can anyone help me with this?
>
> Regards
> Chahal Arora
> Software Engineer
> Raxa
>
> Regards
> Chahal Arora
> Software Engineer
> Raxa
>
> On Thu, Nov 30, 2017 at 6:20 PM, Chahal Arora <ch...@raxa.com>
> wrote:
>
> > Hi All,
> >
> > I am trying to use the Drug NER using the pipeline. I am able to get the
> > medication mention
> (org.apache.ctakes.typesystem.type.textsem.MedicationMention)
> > and get the value for drug but the issue is that I am getting null values
> > for medication dosage/frequency/strength/duration.
> >
> > I have looked into some of the solution provided in the mailing list but
> > still the same result-
> >
> > 1) http://mail-archives.apache.org/mod_mbox/ctakes-user/201711.mbox/%
> > 3Cb7d4354fde864bbba44d2427f281ae94@BLRKECMBX34.ad.infosys.com%3E
> >
> > 2) http://dev.ctakes.apache.narkive.com/ixUkpiO5/enabling-
> > drugner-pipeline-and-identifying-dates#post14
> >
> > Some sample input text that I have tested on -
> >
> > 1) ASAT 10mg Tablet(Atorvastatin): Take 1 Tablet Four times daily, after
> > meals and at bedtime for 5 days.
> >
> > 2) The patient started study treatment of Thalomid 200mg (days 1-21), and
> > Epirubicin, 20 mg /m2 (days 1, 8, and 15) on 06/07/02 for the treatment
> of
> > hepatocellular carcinoma.
> >
> > 3) ASAT 10mg Four times daily
> >
> > 4) paracetamol BID AC 10d PO, aspirin BD
> >
> >
> > Regards
> > Chahal Arora
> > Software Engineer
> > Raxa
> >
>
Re: Drug NER - Empty Dosage/Strength/Frequency Values
Posted by Chahal Arora <ch...@raxa.com>.
Hi All,
While debugging DrugMentionAnnotator.java, I found that the issue was
coming because the value of variables iWindowSize, iBoundaryAnnType have
been set to -1 by default. The value of these variables does not
change because in the following code I get null values for
*windowSize* and *boundaryAnnTypeName
*in the initialize method of DrugMentionAnnotator*.*
String windowSize = (String)annotCtx.getConfigParameterValue(DISTANCE);
String boundaryAnnTypeName
=(String)annotCtx.getConfigParameterValue(BOUNDARY_ANN_TYPE);
if(windowSize != null)
iWindowSize = Integer.parseInt(windowSize);
if(boundaryAnnTypeName != null)
iBoundaryAnnType = JCasUtil.getType(boundaryAnnTypeName);
The DrugNer worked for me when I changed the value of *iWindowSize*,
*iBoundaryAnnType* to the length of the input string.
Does anyone know how can I add this change from piper file and as far I can
see the right way to do it is by changing the values of *DISTANCE* and
*BOUNDARY_ANN_TYPE* but I am not sure about this and don't know how to do
it?
Can anyone help me with this?
Regards
Chahal Arora
Software Engineer
Raxa
Regards
Chahal Arora
Software Engineer
Raxa
On Thu, Nov 30, 2017 at 6:20 PM, Chahal Arora <ch...@raxa.com> wrote:
> Hi All,
>
> I am trying to use the Drug NER using the pipeline. I am able to get the
> medication mention (org.apache.ctakes.typesystem.type.textsem.MedicationMention)
> and get the value for drug but the issue is that I am getting null values
> for medication dosage/frequency/strength/duration.
>
> I have looked into some of the solution provided in the mailing list but
> still the same result-
>
> 1) http://mail-archives.apache.org/mod_mbox/ctakes-user/201711.mbox/%
> 3Cb7d4354fde864bbba44d2427f281ae94@BLRKECMBX34.ad.infosys.com%3E
>
> 2) http://dev.ctakes.apache.narkive.com/ixUkpiO5/enabling-
> drugner-pipeline-and-identifying-dates#post14
>
> Some sample input text that I have tested on -
>
> 1) ASAT 10mg Tablet(Atorvastatin): Take 1 Tablet Four times daily, after
> meals and at bedtime for 5 days.
>
> 2) The patient started study treatment of Thalomid 200mg (days 1-21), and
> Epirubicin, 20 mg /m2 (days 1, 8, and 15) on 06/07/02 for the treatment of
> hepatocellular carcinoma.
>
> 3) ASAT 10mg Four times daily
>
> 4) paracetamol BID AC 10d PO, aspirin BD
>
>
> Regards
> Chahal Arora
> Software Engineer
> Raxa
>