You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ctakes.apache.org by "Bruce Tietjen (JIRA)" <ji...@apache.org> on 2013/10/22 22:56:45 UTC

[jira] [Created] (CTAKES-251) Infinite recursion in DrugMentionAnnotator.java

Bruce Tietjen created CTAKES-251:
------------------------------------

             Summary: Infinite recursion in DrugMentionAnnotator.java
                 Key: CTAKES-251
                 URL: https://issues.apache.org/jira/browse/CTAKES-251
             Project: cTAKES
          Issue Type: Bug
          Components: ctakes-drug-ner
    Affects Versions: 3.0-incubating, 3.1, 3.2, 3.1.1
            Reporter: Bruce Tietjen
            Priority: Critical


Test document text (minimal text necessary to trigger the bug):
                 aspirin decreased from 2:00 PM.

NOTE: My testing indicates that the proposed fix should also fix example 1> in Jira 246.

Call path:
   generageDrugMentionsAndAnnotations
      statusChangePhraseGenerator

(infinite recursion starts here)
         generateAdditionalNER
            generateDrugMentionsAndAnnotations
               statusChangePhraseGenerator
                  generateAdditionalNER
                     ...


I believe the problem occurs in generateAdditionalNER() at ~line 2213 with getAdjustedWindowSpan() returning -1.
This causes the call to generateDrugMentionsAndAnnotations() to process the whole document again rather than the remaining portion of the text.

Source code snippet:

        } else if (drugChangeStatus.getChangeStatus().compareTo(
                DrugChangeStatusToken.DECREASEFROM) == 0)
        {
            if (noPriorMention) {//Look for lowest value on right side
                beginChunk = getAdjustedWindowSpan(jcas,  beginChunk, endSpan, true)[0];
            }
            String [] changeStatusArray = new String [] {DrugChangeStatusToken.DECREASE, new Integer (drugChangeStatus.getBegin()).toString(), new Integer(drugChangeStatus.getEnd()).toString()};
            generateDrugMentionsAndAnnotations(jcas,
                    buildNewNER, beginChunk, endSpan,
                    tokenDrugNER, changeStatusArray, count, globalNER);


A simple fix might be to add the two lines:

            if (noPriorMention) {//Look for lowest value on right side
                beginChunk = getAdjustedWindowSpan(jcas,  beginChunk, endSpan, true)[0];
-->                if (beginChunk == -1)
-->                   beginChunk = drugChangeStatus.getEnd();
            }

Changing the logic inside getAdjustedWindowSpan() might be a more correct and complete fix, but requires a much more detailed knowledge of the code.






--
This message was sent by Atlassian JIRA
(v6.1#6144)