edu.cmu.minorthird.text.learn
Class AbstractBatchAnnotatorLearner

java.lang.Object
  extended by edu.cmu.minorthird.text.learn.AnnotatorLearner
      extended by edu.cmu.minorthird.text.learn.AbstractBatchAnnotatorLearner
Direct Known Subclasses:
SequenceAnnotatorLearner

public abstract class AbstractBatchAnnotatorLearner
extends AnnotatorLearner

Learn an annotation model using a sequence dataset and some sort of batch learner.

Author:
William Cohen

Field Summary
protected  java.lang.String annotationType
           
protected  SpanFeatureExtractor fe
           
protected  Extraction2TaggingReduction reduction
           
protected  SequenceDataset seqData
           
 
Constructor Summary
AbstractBatchAnnotatorLearner()
           
AbstractBatchAnnotatorLearner(SpanFeatureExtractor fe, Extraction2TaggingReduction reduction)
           
 
Method Summary
 java.lang.String getAnnotationType()
          Get the label used for annotations produced by the learner.
abstract  Annotator getAnnotator()
          Return the learned annotator.
 SequenceDataset getSequenceDataset()
          Get the constructed sequence data.
 SpanFeatureExtractor getSpanFeatureExtractor()
          Feature extractor used for tokens
 Extraction2TaggingReduction getTaggingReduction()
          Scheme for reducing extraction to a token-classification problem
 java.lang.String getTaggingReductionHelp()
           
 boolean hasNextQuery()
          Ask for labels on every document.
 Span nextQuery()
          Return the next unlabeled document.
 void reset()
           
 void setAnnotationType(java.lang.String s)
          The spanType of the annotation produced by the learned annotator.
 void setAnswer(AnnotationExample answeredQuery)
          Accept the answer to the last query.
 void setDocumentPool(java.util.Iterator<Span> documentLooper)
          Accept the pool of unlabeled documents.
 void setSpanFeatureExtractor(SpanFeatureExtractor fe)
          Set the feature extractor used by this annotator.
 void setTaggingReduction(Extraction2TaggingReduction reduction)
           
 
Methods inherited from class edu.cmu.minorthird.text.learn.AnnotatorLearner
getAnnotationTypeHelp, getSpanFeatureExtractorHelp
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

fe

protected SpanFeatureExtractor fe

annotationType

protected java.lang.String annotationType

seqData

protected SequenceDataset seqData

reduction

protected Extraction2TaggingReduction reduction
Constructor Detail

AbstractBatchAnnotatorLearner

public AbstractBatchAnnotatorLearner()

AbstractBatchAnnotatorLearner

public AbstractBatchAnnotatorLearner(SpanFeatureExtractor fe,
                                     Extraction2TaggingReduction reduction)
Method Detail

reset

public void reset()
Specified by:
reset in class AnnotatorLearner

getTaggingReduction

public Extraction2TaggingReduction getTaggingReduction()
Scheme for reducing extraction to a token-classification problem


setTaggingReduction

public void setTaggingReduction(Extraction2TaggingReduction reduction)

getTaggingReductionHelp

public java.lang.String getTaggingReductionHelp()

getSpanFeatureExtractor

public SpanFeatureExtractor getSpanFeatureExtractor()
Feature extractor used for tokens

Specified by:
getSpanFeatureExtractor in class AnnotatorLearner

setSpanFeatureExtractor

public void setSpanFeatureExtractor(SpanFeatureExtractor fe)
Description copied from class: AnnotatorLearner
Set the feature extractor used by this annotator. This may have no action if no such feature extractor exists.

Specified by:
setSpanFeatureExtractor in class AnnotatorLearner

setAnnotationType

public void setAnnotationType(java.lang.String s)
The spanType of the annotation produced by the learned annotator.

Specified by:
setAnnotationType in class AnnotatorLearner

getAnnotationType

public java.lang.String getAnnotationType()
Description copied from class: AnnotatorLearner
Get the label used for annotations produced by the learner.

Specified by:
getAnnotationType in class AnnotatorLearner

setDocumentPool

public void setDocumentPool(java.util.Iterator<Span> documentLooper)
Accept the pool of unlabeled documents.

Specified by:
setDocumentPool in class AnnotatorLearner

hasNextQuery

public boolean hasNextQuery()
Ask for labels on every document.

Specified by:
hasNextQuery in class AnnotatorLearner

nextQuery

public Span nextQuery()
Return the next unlabeled document.

Specified by:
nextQuery in class AnnotatorLearner

setAnswer

public void setAnswer(AnnotationExample answeredQuery)
Accept the answer to the last query.

Specified by:
setAnswer in class AnnotatorLearner

getAnnotator

public abstract Annotator getAnnotator()
Return the learned annotator.

Specified by:
getAnnotator in class AnnotatorLearner

getSequenceDataset

public SequenceDataset getSequenceDataset()
Get the constructed sequence data.