edu.cmu.minorthird.text.learn
Class FeatureBuffer
java.lang.Object
edu.cmu.minorthird.text.learn.SpanFE
edu.cmu.minorthird.text.learn.FeatureBuffer
- All Implemented Interfaces:
- MixupCompatible, SpanFeatureExtractor, java.io.Serializable
public class FeatureBuffer
- extends SpanFE
Buffers features constructed using the SpanFE.SpanResult subclasses.
This is intended to be used as an alternative to using the SpanFE class to
build an Span2Instance converter, eg
fe=new Span2Instance(){
public extractInstance(Span s){
FeatureBuffer buf=new FeatureBuffer();
SpanFE.from(s,buf).tokens().emit();
SpanFE.from(s,buf).left().subspan(-2,2).emit();
SpanFE.from(s,buf).right().subspan(0,2).emit();
buf.getInstance();
}
}
- Author:
- William Cohen
- See Also:
- Serialized Form
Methods inherited from class edu.cmu.minorthird.text.learn.SpanFE |
emit, emit, emit, emit, extractInstance, extractInstance, from, from, getAnnotationProvider, getRequiredAnnotation, requireMyAnnotation, setAnnotationProvider, setAnnotatorLoader, setFeatureStoragePolicy, setRequiredAnnotation, setRequiredAnnotation, trace |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
FeatureBuffer
public FeatureBuffer(TextLabels labels,
Span span)
FeatureBuffer
public FeatureBuffer(Span span)
getInstance
public Instance getInstance()
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
extractFeatures
public void extractFeatures(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()'.
- Overrides:
extractFeatures
in class SpanFE