edu.cmu.minorthird.text.learn
Class OnlineBinaryTextClassifierLearner

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

public class OnlineBinaryTextClassifierLearner
extends AbstractAnnotator
implements OnlineTextClassifierLearner, java.io.Serializable

Provides a way to Edit document labels and add them to the learner

Author:
Cameron Williams
See Also:
Serialized Form

Field Summary
 OnlineClassifierLearner learner
           
 java.lang.String outputType
           
 java.lang.String spanType
           
 
Constructor Summary
OnlineBinaryTextClassifierLearner(OnlineClassifierLearner learner, java.lang.String spanType)
           
OnlineBinaryTextClassifierLearner(OnlineClassifierLearner learner, java.lang.String spanType, TextLabels labeledData)
           
OnlineBinaryTextClassifierLearner(OnlineClassifierLearner learner, java.lang.String spanType, TextLabels labeledData, SpanFeatureExtractor fe)
           
 
Method Summary
 void addDocument(java.lang.String label, java.lang.String text)
          Provide document string with a label and add to the learner
 void completeTraining()
          Tells the learner that no more examples are coming
 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.
 ClassifierAnnotator getAnnotator()
           
 Classifier getClassifier()
          Returns the Classifier
 TextClassifier getTextClassifier()
          Returns the TextClassifier
 java.lang.String[] getTypes()
          Returns an array of spanTypes that can be added to the learner
 void reset()
          Erases all previous data from the learner
 
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
 
Methods inherited from interface edu.cmu.minorthird.text.learn.OnlineTextClassifierLearner
annotatedCopy
 

Field Detail

learner

public OnlineClassifierLearner learner

spanType

public java.lang.String spanType

outputType

public java.lang.String outputType
Constructor Detail

OnlineBinaryTextClassifierLearner

public OnlineBinaryTextClassifierLearner(OnlineClassifierLearner learner,
                                         java.lang.String spanType)

OnlineBinaryTextClassifierLearner

public OnlineBinaryTextClassifierLearner(OnlineClassifierLearner learner,
                                         java.lang.String spanType,
                                         TextLabels labeledData)

OnlineBinaryTextClassifierLearner

public OnlineBinaryTextClassifierLearner(OnlineClassifierLearner learner,
                                         java.lang.String spanType,
                                         TextLabels labeledData,
                                         SpanFeatureExtractor fe)
Method Detail

addDocument

public void addDocument(java.lang.String label,
                        java.lang.String text)
Provide document string with a label and add to the learner

Specified by:
addDocument in interface OnlineTextClassifierLearner

getTextClassifier

public TextClassifier getTextClassifier()
Returns the TextClassifier

Specified by:
getTextClassifier in interface OnlineTextClassifierLearner

getClassifier

public Classifier getClassifier()
Description copied from interface: OnlineTextClassifierLearner
Returns the Classifier

Specified by:
getClassifier in interface OnlineTextClassifierLearner

completeTraining

public void completeTraining()
Tells the learner that no more examples are coming

Specified by:
completeTraining in interface OnlineTextClassifierLearner

reset

public void reset()
Erases all previous data from the learner

Specified by:
reset in interface OnlineTextClassifierLearner

getTypes

public java.lang.String[] getTypes()
Description copied from interface: OnlineTextClassifierLearner
Returns an array of spanTypes that can be added to the learner

Specified by:
getTypes in interface OnlineTextClassifierLearner

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

getAnnotator

public ClassifierAnnotator getAnnotator()
Specified by:
getAnnotator in interface OnlineTextClassifierLearner