edu.cmu.minorthird.text.learn
Class SequenceAnnotatorLearner
java.lang.Object
edu.cmu.minorthird.text.learn.AnnotatorLearner
edu.cmu.minorthird.text.learn.AbstractBatchAnnotatorLearner
edu.cmu.minorthird.text.learn.SequenceAnnotatorLearner
- Direct Known Subclasses:
- Recommended.CRFAnnotatorLearner, Recommended.HMMAnnotatorLearner, Recommended.MEMMLearner, Recommended.SVMCMMLearner, Recommended.VPCMMLearner, Recommended.VPHMMLearner
public class SequenceAnnotatorLearner
- extends AbstractBatchAnnotatorLearner
Learn an annotation model using a sequence dataset and a
BatchSequenceClassifierLearner. This class reduces extraction learning to
sequential classification of tokens. The scheme for mapping extraction
learning to token learning is determined by the Extraction2TaggingReduction.
- Author:
- William Cohen
Methods inherited from class edu.cmu.minorthird.text.learn.AbstractBatchAnnotatorLearner |
getAnnotationType, getSequenceDataset, getSpanFeatureExtractor, getTaggingReduction, getTaggingReductionHelp, hasNextQuery, nextQuery, reset, setAnnotationType, setAnswer, setDocumentPool, setSpanFeatureExtractor, setTaggingReduction |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
seqLearner
protected BatchSequenceClassifierLearner seqLearner
SequenceAnnotatorLearner
public SequenceAnnotatorLearner()
SequenceAnnotatorLearner
public SequenceAnnotatorLearner(BatchSequenceClassifierLearner seqLearner,
SpanFeatureExtractor fe)
SequenceAnnotatorLearner
public SequenceAnnotatorLearner(BatchSequenceClassifierLearner seqLearner,
SpanFeatureExtractor fe,
Extraction2TaggingReduction reduction)
getDisplayDatasetBeforeLearning
public boolean getDisplayDatasetBeforeLearning()
- If set, try and pop up an interactive viewer of the sequential dataset
before learning.
setDisplayDatasetBeforeLearning
public void setDisplayDatasetBeforeLearning(boolean newDisplayDatasetBeforeLearning)
getSequenceClassifierLearner
public BatchSequenceClassifierLearner getSequenceClassifierLearner()
setSequenceClassifierLearner
public void setSequenceClassifierLearner(BatchSequenceClassifierLearner learner)
getDisplayDatasetBeforeLearningHelp
public java.lang.String getDisplayDatasetBeforeLearningHelp()
getSequenceClassifierLearnerHelp
public java.lang.String getSequenceClassifierLearnerHelp()
getAnnotator
public Annotator getAnnotator()
- Return the learned annotator.
- Specified by:
getAnnotator
in class AbstractBatchAnnotatorLearner
prepareSequenceData
public static SequenceDataset prepareSequenceData(TextLabels labels,
java.lang.String spanType,
java.lang.String spanProp,
SpanFeatureExtractor fe,
int historySize,
Extraction2TaggingReduction reduction)
- A useful subroutine - prepare sequence data the way a
SequenceAnnotatorLearner would prepare it when trained by a
TextLabelsAnnotatorTeacher.
main
public static void main(java.lang.String[] args)