edu.cmu.minorthird.ui
Class Recommended.TokenFE

java.lang.Object
  extended by edu.cmu.minorthird.text.learn.SpanFE
      extended by edu.cmu.minorthird.ui.Recommended.TokenPropUsingFE
          extended by edu.cmu.minorthird.ui.Recommended.TokenFE
All Implemented Interfaces:
MixupCompatible, SpanFeatureExtractor, CommandLineProcessor.Configurable, java.io.Serializable
Direct Known Subclasses:
Recommended.MultitokenSpanFE
Enclosing class:
Recommended

public static class Recommended.TokenFE
extends Recommended.TokenPropUsingFE
implements CommandLineProcessor.Configurable, java.io.Serializable

An extraction-oriented feature extractor, which should be applied to one-token spans. By default this extracts features for: the lower-case version of the single word inside that span; lexical properties of the word; and analogous features for tokens in a small window to either side of the word.

See Also:
Serialized Form

Nested Class Summary
 class Recommended.TokenFE.MyCLP
           
 
Nested classes/interfaces inherited from class edu.cmu.minorthird.text.learn.SpanFE
SpanFE.Filter, SpanFE.Function, SpanFE.Result, SpanFE.SetResult<T>, SpanFE.SpanResult, SpanFE.SpanSetResult, SpanFE.StringBagResult, SpanFE.TokenSetResult
 
Field Summary
protected  boolean useCharType
           
protected  boolean useCharTypePattern
           
protected  boolean useTokenValues
           
protected  int windowSize
           
 
Fields inherited from class edu.cmu.minorthird.ui.Recommended.TokenPropUsingFE
tokenPropertyFeatures
 
Fields inherited from class edu.cmu.minorthird.text.learn.SpanFE
annotatorLoader, instance, requiredAnnotation, requiredAnnotationFileToLoad, STORE_AS_BINARY, STORE_AS_COUNTS, STORE_COMPACTLY
 
Constructor Summary
Recommended.TokenFE()
           
 
Method Summary
 void extractFeatures(TextLabels labels, Span s)
          Implement this with a specific set of SpanFE 'pipelines'.
 CommandLineProcessor getCLP()
          Produce a command-line processor that configures this object.
 int getFeatureWindowSize()
           
 boolean getUseCharType()
           
 boolean getUseCharTypePattern()
           
 boolean getUseTokenValues()
           
 void setFeatureWindowSize(int n)
          Window size for features.
 void setUseCharType(boolean flag)
          If true, produce features like "token.charTypePattern.Aaaa" for the word "Bill"
 void setUseCharTypePattern(boolean flag)
          If true, produce features like "token.charTypePattern.Aa+" for the word "Bill".
 void setUseTokenValues(boolean flag)
          If true, produce features like "token.lc.bill" for the word "Bill".
 
Methods inherited from class edu.cmu.minorthird.ui.Recommended.TokenPropUsingFE
getTokenPropertyFeatures, setMyTokenPropertyList, setRequiredAnnotation, setTokenPropertyFeatures, setTokenPropertyFeatures
 
Methods inherited from class edu.cmu.minorthird.text.learn.SpanFE
emit, emit, emit, emit, extractFeatures, extractInstance, extractInstance, from, from, getAnnotationProvider, getRequiredAnnotation, requireMyAnnotation, setAnnotationProvider, setAnnotatorLoader, setFeatureStoragePolicy, setRequiredAnnotation, trace
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

windowSize

protected int windowSize

useCharType

protected boolean useCharType

useCharTypePattern

protected boolean useCharTypePattern

useTokenValues

protected boolean useTokenValues
Constructor Detail

Recommended.TokenFE

public Recommended.TokenFE()
Method Detail

setFeatureWindowSize

public void setFeatureWindowSize(int n)
Window size for features.


getFeatureWindowSize

public int getFeatureWindowSize()

setUseCharType

public void setUseCharType(boolean flag)
If true, produce features like "token.charTypePattern.Aaaa" for the word "Bill"


getUseCharType

public boolean getUseCharType()

setUseCharTypePattern

public void setUseCharTypePattern(boolean flag)
If true, produce features like "token.charTypePattern.Aa+" for the word "Bill".


getUseCharTypePattern

public boolean getUseCharTypePattern()

setUseTokenValues

public void setUseTokenValues(boolean flag)
If true, produce features like "token.lc.bill" for the word "Bill".


getUseTokenValues

public boolean getUseTokenValues()

getCLP

public CommandLineProcessor getCLP()
Description copied from interface: CommandLineProcessor.Configurable
Produce a command-line processor that configures this object.

Specified by:
getCLP in interface CommandLineProcessor.Configurable

extractFeatures

public void extractFeatures(TextLabels labels,
                            Span s)
Description copied from class: SpanFE
Implement this with a specific set of SpanFE 'pipelines'. Each pipeline will typically start with 'start(span)' and end with 'emit()'.

Specified by:
extractFeatures in class SpanFE