edu.cmu.minorthird.text.learn
Class ClassifierAnnotator

java.lang.Object
  extended by edu.cmu.minorthird.text.AbstractAnnotator
      extended by edu.cmu.minorthird.text.learn.ClassifierAnnotator
All Implemented Interfaces:
Annotator, java.io.Serializable

public class ClassifierAnnotator
extends AbstractAnnotator
implements java.io.Serializable

An annotator that uses a learned Classifier to mark up document spans.

See Also:
Serialized Form

Constructor Summary
ClassifierAnnotator(SpanFeatureExtractor fe, Classifier c, java.lang.String spanType, java.lang.String spanProp)
           
ClassifierAnnotator(SpanFeatureExtractor fe, Classifier c, java.lang.String spanType, java.lang.String spanProp, java.lang.String candidateType)
           
 
Method Summary
 void doAnnotate(MonotonicTextLabels labels)
          The implementation for this method annotates labels in-line.
 java.lang.String explainAnnotation(TextLabels labels, Span documentSpan)
          The implementation for this method should explain how annotation would be added to some part of the text base.
 java.lang.String getCandidateType()
          If non-null, the spanType corresponding to candidate spans to be classified.
 Classifier getClassifier()
           
 SpanFeatureExtractor getFE()
          The feature extractor applied to candidate spans.
 java.lang.String getSpanProperty()
          If non-null, the property used to encode the output of the classifier.
 java.lang.String getSpanType()
          If non-null, the spanType used to encode the positive predictions of the classifier (which should be a BinaryClassifier).
 
Methods inherited from class edu.cmu.minorthird.text.AbstractAnnotator
annotate, annotatedCopy
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClassifierAnnotator

public ClassifierAnnotator(SpanFeatureExtractor fe,
                           Classifier c,
                           java.lang.String spanType,
                           java.lang.String spanProp,
                           java.lang.String candidateType)

ClassifierAnnotator

public ClassifierAnnotator(SpanFeatureExtractor fe,
                           Classifier c,
                           java.lang.String spanType,
                           java.lang.String spanProp)
Method Detail

getFE

public SpanFeatureExtractor getFE()
The feature extractor applied to candidate spans.


getClassifier

public Classifier getClassifier()

getSpanProperty

public java.lang.String getSpanProperty()
If non-null, the property used to encode the output of the classifier.


getSpanType

public java.lang.String getSpanType()
If non-null, the spanType used to encode the positive predictions of the classifier (which should be a BinaryClassifier).


getCandidateType

public java.lang.String getCandidateType()
If non-null, the spanType corresponding to candidate spans to be classified. If null, the document spans will be classified.


doAnnotate

public void doAnnotate(MonotonicTextLabels labels)
Description copied from class: AbstractAnnotator
The implementation for this method annotates labels in-line.

Specified by:
doAnnotate in class AbstractAnnotator

explainAnnotation

public java.lang.String explainAnnotation(TextLabels labels,
                                          Span documentSpan)
Description copied from class: AbstractAnnotator
The implementation for this method should explain how annotation would be added to some part of the text base.

Specified by:
explainAnnotation in interface Annotator
Specified by:
explainAnnotation in class AbstractAnnotator