You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ctakes.apache.org by tm...@apache.org on 2013/08/08 19:00:25 UTC

svn commit: r1511874 - /ctakes/trunk/ctakes-assertion/src/main/java/org/apache/ctakes/assertion/medfacts/cleartk/extractors/UncertaintyFeatureExtractor.java

Author: tmill
Date: Thu Aug  8 17:00:25 2013
New Revision: 1511874

URL: http://svn.apache.org/r1511874
Log:
Added feature extractor for uncertainty which so far just has the value of the negation attribute.

Added:
    ctakes/trunk/ctakes-assertion/src/main/java/org/apache/ctakes/assertion/medfacts/cleartk/extractors/UncertaintyFeatureExtractor.java   (with props)

Added: ctakes/trunk/ctakes-assertion/src/main/java/org/apache/ctakes/assertion/medfacts/cleartk/extractors/UncertaintyFeatureExtractor.java
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-assertion/src/main/java/org/apache/ctakes/assertion/medfacts/cleartk/extractors/UncertaintyFeatureExtractor.java?rev=1511874&view=auto
==============================================================================
--- ctakes/trunk/ctakes-assertion/src/main/java/org/apache/ctakes/assertion/medfacts/cleartk/extractors/UncertaintyFeatureExtractor.java (added)
+++ ctakes/trunk/ctakes-assertion/src/main/java/org/apache/ctakes/assertion/medfacts/cleartk/extractors/UncertaintyFeatureExtractor.java Thu Aug  8 17:00:25 2013
@@ -0,0 +1,26 @@
+package org.apache.ctakes.assertion.medfacts.cleartk.extractors;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.ctakes.typesystem.type.constants.CONST;
+import org.apache.ctakes.typesystem.type.textsem.IdentifiedAnnotation;
+import org.apache.uima.jcas.JCas;
+import org.apache.uima.jcas.tcas.Annotation;
+import org.cleartk.classifier.Feature;
+import org.cleartk.classifier.feature.extractor.CleartkExtractorException;
+import org.cleartk.classifier.feature.extractor.simple.SimpleFeatureExtractor;
+
+public class UncertaintyFeatureExtractor implements SimpleFeatureExtractor {
+
+  @Override
+  public List<Feature> extract(JCas view, Annotation focusAnnotation)
+      throws CleartkExtractorException {
+    List<Feature> featList = new ArrayList<Feature>();
+    
+    IdentifiedAnnotation mention = (IdentifiedAnnotation) focusAnnotation;
+    featList.add(new Feature("IsNegated", mention.getPolarity() == CONST.NE_POLARITY_NEGATION_PRESENT));
+    return featList;
+  }
+
+}

Propchange: ctakes/trunk/ctakes-assertion/src/main/java/org/apache/ctakes/assertion/medfacts/cleartk/extractors/UncertaintyFeatureExtractor.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain