ctakes-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tm...@apache.org
Subject svn commit: r1800149 - /ctakes/trunk/ctakes-core/src/main/java/org/apache/ctakes/core/ae/SentenceDetectorAnnotatorBIO.java
Date Wed, 28 Jun 2017 10:51:21 GMT
Author: tmill
Date: Wed Jun 28 10:51:21 2017
New Revision: 1800149

URL: http://svn.apache.org/viewvc?rev=1800149&view=rev
Log:
Fixes Issue CTAKES-447. Force an "I" tag to become a "B" tag if it follows an "O" tag.

Modified:
    ctakes/trunk/ctakes-core/src/main/java/org/apache/ctakes/core/ae/SentenceDetectorAnnotatorBIO.java

Modified: ctakes/trunk/ctakes-core/src/main/java/org/apache/ctakes/core/ae/SentenceDetectorAnnotatorBIO.java
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-core/src/main/java/org/apache/ctakes/core/ae/SentenceDetectorAnnotatorBIO.java?rev=1800149&r1=1800148&r2=1800149&view=diff
==============================================================================
--- ctakes/trunk/ctakes-core/src/main/java/org/apache/ctakes/core/ae/SentenceDetectorAnnotatorBIO.java
(original)
+++ ctakes/trunk/ctakes-core/src/main/java/org/apache/ctakes/core/ae/SentenceDetectorAnnotatorBIO.java
Wed Jun 28 10:51:21 2017
@@ -149,6 +149,12 @@ public class SentenceDetectorAnnotatorBI
             outcome = "I";
           }else{
             outcome = this.classifier.classify(feats);
+            // This shouldn't be necessary, but if the learning algorithm fails, we need
to correct it so
+            // that our accounting works. Only a B or O can follow an O, if classifier predicts
"I", switch
+            // it to a "B".
+            if(outcome.equals("I") && prevOutcome.equals("O")){
+              outcome = "B";
+            }
             if(outcome.equals("B")) startInd = casInd;
             else if(outcome.equals("O") && 
                 (prevOutcome.equals("I") || prevOutcome.equals("B"))){



Mime
View raw message