The Drug-ner module was created before my time, and I haven't ever had reason to use it.
I think that your oob exception is, as you guess, coming from missing or bad parameters. You can try using the following in your piper file: package org.apache.ctakes.drugner.ae set DISTANCE_ANN_TYPE=org.apache.ctakes.typesystem.type.syntax.BaseToken set STATUS_BOUNDARY_ANN_TYPE=org.apache.ctakes.typesystem.type.textspan.Segment add DrugMentionAnnotator DISTANCE="10" Distance "10" is quoted because the code is old and doesn't accept integer values. I have no idea what values would be useful, let alone optimal, for the parameters. I couldn't find any documentation and there aren't default values. The crash (I got it too before noticing that parameters were required) was unexpected and not explained. There is a readme in the module that mentions free text and cda, but I am not willing to do any research confirming what works or what is best. I hate to say it, but unless somebody reading this can offer some advice you should probably throw up those hands and look for another solution to extracting drug attributes. Definitely less interesting than sunken treasure. Sean ________________________________ From: Peter Abramowitsch <pabramowit...@gmail.com> Sent: Wednesday, December 4, 2024 12:58 PM To: dev@ctakes.apache.org <dev@ctakes.apache.org> Subject: Re: Question about DrugNerAnnotator [EXTERNAL] * External Email - Caution * Hi Sean et al Problem still is though, that even when processing it creates nothing at all due to an out of bounds exception that may be due to some parameters that need passing to the annotator, but I don't see any pipeline or piper examples where these are passed. It generates DrugMentions, then it should pass through a loop where the attributes of the drug mention are transferred over to the MedicationMentions that were created upstream. Then it deletes all the DrugMentions before exiting. Problem is that that transfer code is never executed. The out of bounds exception is generated here, preventing the transfer code to execute int[] localSpan = getNarrativeSpansContainingGivenSpanType(jcas, drugTokenAnt.getBegin(), iBoundaryAnnType); where iBoundaryAnnType defaults to -1. It could be given the ID of a boundary annotation through a run-time param, but I have no clue what the basis would be for choosing a boundary type as the whole thing's pretty large, opaque and dated. I've devoted as much time as I can afford and am reaching the throw-up-my hands moment. I'm not even sure if it handles free text or is designed only for processing CDAs It feels like the moment the antikythera machine was found, but less interesting Peter On Wed, Dec 4, 2024 at 4:33 PM Finan, Sean <sean.fi...@childrens.harvard.edu.invalid> wrote: > Thanks for the update. We can add it a "known issues" in the wiki > https://urldefense.com/v3/__https://github.com/apache/ctakes/wiki__;!!NZvER7FxgEiBAiR_!vj-icS4HEyslSHEYJfEQyyi4SxnUbd59-BnMSTsAZc3YcBFmkVBBJzqPDgm6VgINUkIOJbPK7IlDetzjjEk7NJqsYGDRSbnT7A$ > . I thought that we had one at > some point, but it may have been removed. > > ________________________________ > From: Peter Abramowitsch <pabramowit...@gmail.com> > Sent: Wednesday, December 4, 2024 10:25 AM > To: dev@ctakes.apache.org <dev@ctakes.apache.org> > Subject: Re: Question about DrugNerAnnotator [EXTERNAL] > > * External Email - Caution * > > > Turns out that this problem was indeed due to the fact that package names > had changed from v4.x.x to v5.x.x from ...drugner... to ..drug.ner.. > But across the sources and typesystem files it had not been completely done > and had been left in a halfway state. By reverting the package spec of > resources in the drugner jar > > from *resources/org/apache/drug/ner/**<typesystem stuff>* > to *resources/org/apache/drugner/<**typesystem stuff>* > > It started working again > > Peter > > On Tue, Dec 3, 2024 at 11:50 PM Finan, Sean > <sean.fi...@childrens.harvard.edu.invalid> wrote: > > > Hi Peter, > > > > This looks like the same problem encountered here: > > > https://urldefense.com/v3/__https://github.com/apache/ctakes/issues/23__;!!NZvER7FxgEiBAiR_!uPGJp5DJ9cxqun2v3tcwAuyJAadTrq-_HtGJOt8Iw0wYntcesSesFNYRbAzIbUXbJgLuGWdlUktKeT-w9nVgFzCXhJpp9uVZHw$ > > > > It was fixed for -standard- ctakes workflows in 6.0.0, but if you don't > > use the PiperFileRunner or have a custom reader then you may still see > the > > problem. > > > > The root cause is still an open issue in uima, so if anybody out there > has > > a general solution please share. > > > https://urldefense.com/v3/__https://github.com/apache/uima-uimaj/issues/234__;!!NZvER7FxgEiBAiR_!uPGJp5DJ9cxqun2v3tcwAuyJAadTrq-_HtGJOt8Iw0wYntcesSesFNYRbAzIbUXbJgLuGWdlUktKeT-w9nVgFzCXhJoefaOEnQ$ > > > > > > Sean > > > > ________________________________ > > From: Peter Abramowitsch <pabramowit...@gmail.com> > > Sent: Tuesday, December 3, 2024 3:29 PM > > To: dev@ctakes.apache.org <dev@ctakes.apache.org> > > Subject: Question about DrugNerAnnotator [EXTERNAL] > > > > * External Email - Caution * > > > > > > Hi All > > > > If anyone has tried using the Drugner in 5.1.0 have they run into this > > error when its process() method is run. > > > > message: JCas type > > "org.apache.ctakes.drugner.type.FractionStrengthAnnotation" used in > > Java code, but was not declared in the XML type descriptor > > > > The thing is that this attribute is declared in the annotator's Xml > > Type Description, and because FractionStrengthAnnotation is also the > > first one that the code attempts to access, I'm assuming that none of > > the other attributes are found either. > > attribute defs will actually be found > > > > <typeDescription> > > > > <name>org.apache.ctakes.drugner.type.FractionStrengthAnnotation</name> > > > > <description>The fraction portion of dosages strength determination for > the > > Drug NER profile.</description> > > > > <supertypeName>uima.tcas.Annotation</supertypeName> > > > > </typeDescription> > > > > etc > > > > I've looked for a rogue > > *org.apache.ctakes.drugner.types.TypeSystem.xml* elswhere in my > > classpath and there isn't one. But there is an issue that some bits > > of the configuration & src of this annotator refer to the package as > > *org.apache.ctakes.drugner*. and others as > > *org.apache.ctakes.drug.ner.* The use of both "stringifyied package > > names" and actual packages in the FIT architecture always confuses me. > > This discrepancy is something that crept into certain annotators whose > > packages changed in 5.0.x. At that time I fixed all of these so they > > would compile, but it seems there are still issues. > > > > Any thoughts? > > > > Peter > > >