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 <chahal.ar...@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 <chahal.ar...@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/%
> > 3cb7d4354fde864bbba44d2427f281a...@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
> >
>

Reply via email to