ctakes-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From stevenbeth...@apache.org
Subject svn commit: r1486166 - in /ctakes/trunk/ctakes-temporal/src/main: java/org/apache/ctakes/temporal/ae/feature/ resources/ resources/org/ resources/org/apache/ resources/org/apache/ctakes/ resources/org/apache/ctakes/temporal/
Date Fri, 24 May 2013 18:52:42 GMT
Author: stevenbethard
Date: Fri May 24 18:52:42 2013
New Revision: 1486166

URL: http://svn.apache.org/r1486166
Log:
Adds a feature extractor for identifying non-eventive propbank predicates

Added:
    ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/feature/FramesetCategoryExtractor.java
  (with props)
    ctakes/trunk/ctakes-temporal/src/main/resources/
    ctakes/trunk/ctakes-temporal/src/main/resources/org/
    ctakes/trunk/ctakes-temporal/src/main/resources/org/apache/
    ctakes/trunk/ctakes-temporal/src/main/resources/org/apache/ctakes/
    ctakes/trunk/ctakes-temporal/src/main/resources/org/apache/ctakes/temporal/
    ctakes/trunk/ctakes-temporal/src/main/resources/org/apache/ctakes/temporal/propbank_noneventive_framesets.txt
  (with props)

Added: ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/feature/FramesetCategoryExtractor.java
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/feature/FramesetCategoryExtractor.java?rev=1486166&view=auto
==============================================================================
--- ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/feature/FramesetCategoryExtractor.java
(added)
+++ ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/feature/FramesetCategoryExtractor.java
Fri May 24 18:52:42 2013
@@ -0,0 +1,53 @@
+package org.apache.ctakes.temporal.ae.feature;
+
+import java.io.IOException;
+import java.net.URL;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.ctakes.typesystem.type.textsem.Predicate;
+import org.apache.uima.jcas.JCas;
+import org.apache.uima.jcas.tcas.Annotation;
+import org.apache.uima.resource.ResourceInitializationException;
+import org.cleartk.classifier.Feature;
+import org.cleartk.classifier.feature.extractor.CleartkExtractorException;
+import org.cleartk.classifier.feature.extractor.simple.SimpleFeatureExtractor;
+import org.uimafit.util.JCasUtil;
+
+import com.google.common.base.Charsets;
+import com.google.common.collect.Lists;
+import com.google.common.collect.Maps;
+import com.google.common.io.Resources;
+
+public class FramesetCategoryExtractor implements SimpleFeatureExtractor {
+  
+  private Map<String, String> frameSetCategories;
+  
+  public FramesetCategoryExtractor() throws ResourceInitializationException {
+    String path = "/org/apache/ctakes/temporal/propbank_noneventive_framesets.txt";
+    URL uri = FramesetCategoryExtractor.class.getResource(path);
+    this.frameSetCategories = Maps.newHashMap();
+    try {
+      for (String line : Resources.readLines(uri, Charsets.US_ASCII)) {
+        String[] tagAndFrameset = line.split("\\s+");
+        this.frameSetCategories.put(tagAndFrameset[1], tagAndFrameset[0]);
+      }
+    } catch (IOException e) {
+      throw new ResourceInitializationException(e);
+    }
+  }
+
+  @Override
+  public List<Feature> extract(JCas view, Annotation focusAnnotation)
+      throws CleartkExtractorException {
+    List<Feature> features = Lists.newArrayList();
+    for (Predicate predicate : JCasUtil.selectCovered(view, Predicate.class, focusAnnotation))
{
+      String category = this.frameSetCategories.get(predicate.getFrameSet());
+      if (category != null) {
+        features.add(new Feature("FramesetCategory", category));
+      }
+    }
+    return features;
+  }
+
+}

Propchange: ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/feature/FramesetCategoryExtractor.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/feature/FramesetCategoryExtractor.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: ctakes/trunk/ctakes-temporal/src/main/resources/org/apache/ctakes/temporal/propbank_noneventive_framesets.txt
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-temporal/src/main/resources/org/apache/ctakes/temporal/propbank_noneventive_framesets.txt?rev=1486166&view=auto
==============================================================================
--- ctakes/trunk/ctakes-temporal/src/main/resources/org/apache/ctakes/temporal/propbank_noneventive_framesets.txt
(added)
+++ ctakes/trunk/ctakes-temporal/src/main/resources/org/apache/ctakes/temporal/propbank_noneventive_framesets.txt
Fri May 24 18:52:42 2013
@@ -0,0 +1,75 @@
+COPULAR appear.02
+COPULAR be.01
+COPULAR come_across.15
+COPULAR come_off.24
+COPULAR come_out.09
+COPULAR end_up.03
+COPULAR get.03
+COPULAR go.08
+COPULAR grow.02
+COPULAR fall.07
+COPULAR feel.05
+COPULAR look.02
+COPULAR remain.01
+COPULAR resemble.01
+COPULAR seem.01
+COPULAR smell.02
+COPULAR sound.01
+COPULAR stand.04
+COPULAR taste.02
+COPULAR turn_out.11
+COPULAR wax.03
+COPULAR become.03
+BORDERLINE_COPULAR come.04
+BORDERLINE_COPULAR lie.01
+BORDERLINE_COPULAR play.02
+BORDERLINE_COPULAR plead.02
+BORDERLINE_COPULAR rest.02
+BORDERLINE_COPULAR stay.01
+MODAL get.06
+MODAL go.04
+MODAL have.02
+MODAL have.07
+MODAL use.03
+MODAL like.02
+MODAL love.02
+AUXILIARY be.03
+AUXILIARY become.03
+AUXILIARY do.01
+AUXILIARY have.01
+AUXILIARY get.24
+ASPECTUAL begin.02
+ASPECTUAL go_on.15
+ASPECTUAL keep_on.08
+ASPECTUAL leave_off.07
+BORDERLINE_ASPECTUAL carry_on.02
+BORDERLINE_ASPECTUAL cease.01
+BORDERLINE_ASPECTUAL conclude.02
+BORDERLINE_ASPECTUAL commence.01
+BORDERLINE_ASPECTUAL complete.01
+BORDERLINE_ASPECTUAL continue.01
+BORDERLINE_ASPECTUAL delay.01
+BORDERLINE_ASPECTUAL discontinue.01
+BORDERLINE_ASPECTUAL finish.01
+BORDERLINE_ASPECTUAL keep.02
+BORDERLINE_ASPECTUAL procrastinate.01
+BORDERLINE_ASPECTUAL put_off.06
+BORDERLINE_ASPECTUAL quit.01
+BORDERLINE_ASPECTUAL recommence.01
+BORDERLINE_ASPECTUAL resume.01
+BORDERLINE_ASPECTUAL start.01
+BORDERLINE_ASPECTUAL start_off.02
+BORDERLINE_ASPECTUAL stop.01
+BORDERLINE_ASPECTUAL carry_over.04
+BORDERLINE_ASPECTUAL cessate.01
+BORDERLINE_ASPECTUAL drag_on.02
+BORDERLINE_ASPECTUAL end.01
+BORDERLINE_ASPECTUAL fall_off.02
+BORDERLINE_ASPECTUAL get_off.11
+BORDERLINE_ASPECTUAL halt.01
+BORDERLINE_ASPECTUAL have.06
+BORDERLINE_ASPECTUAL pause.01
+BORDERLINE_ASPECTUAL persist.01
+BORDERLINE_ASPECTUAL procede.01
+BORDERLINE_ASPECTUAL restart.01
+BORDERLINE_ASPECTUAL terminate.01

Propchange: ctakes/trunk/ctakes-temporal/src/main/resources/org/apache/ctakes/temporal/propbank_noneventive_framesets.txt
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: ctakes/trunk/ctakes-temporal/src/main/resources/org/apache/ctakes/temporal/propbank_noneventive_framesets.txt
------------------------------------------------------------------------------
    svn:mime-type = text/plain



Mime
View raw message