edu.cmu.minorthird.text.learn
Class SegmentAnnotatorLearner

java.lang.Object
  extended by edu.cmu.minorthird.text.learn.AnnotatorLearner
      extended by edu.cmu.minorthird.text.learn.SegmentAnnotatorLearner
Direct Known Subclasses:
Recommended.SemiCRFAnnotatorLearner, Recommended.VPSMMLearner2

public class SegmentAnnotatorLearner
extends AnnotatorLearner

Learn an annotation model using a SegmentDataset dataset and a BatchSequenceClassifierLearner.

Author:
William Cohen

Nested Class Summary
static class SegmentAnnotatorLearner.SegmentAnnotator
           
 
Field Summary
protected  java.lang.String annotationType
           
protected  SegmentDataset dataset
           
protected  SpanFeatureExtractor fe
           
protected  BatchSegmenterLearner learner
           
protected  int maxWindowSize
           
 
Constructor Summary
SegmentAnnotatorLearner()
           
SegmentAnnotatorLearner(BatchSegmenterLearner learner, SpanFeatureExtractor fe)
           
SegmentAnnotatorLearner(BatchSegmenterLearner learner, SpanFeatureExtractor fe, int windowSize)
           
 
Method Summary
 java.lang.String getAnnotationType()
          Get the label used for annotations produced by the learner.
 Annotator getAnnotator()
          Return the learned annotator.
 boolean getCompressDataset()
          If set, try and compress the data.
 java.lang.String getCompressDatasetHelp()
           
 boolean getDisplayDatasetBeforeLearning()
          If set, try and pop up an interactive viewer of the sequential dataset before learning.
 java.lang.String getDisplayDatasetBeforeLearningHelp()
           
 int getHistorySize()
           
 BatchSegmenterLearner getSemiMarkovLearner()
           
 java.lang.String getSemiMarkovLearnerHelp()
           
 SpanFeatureExtractor getSpanFeatureExtractor()
          Return the span feature extractor used by this annotator.
 boolean hasNextQuery()
          Ask for labels on every document.
 Span nextQuery()
          Return the next unlabeled document.
 void reset()
           
 void setAnnotationType(java.lang.String s)
          Specify the type of annotation produced by this annotator - that is, the type associated with spans produced by it.
 void setAnswer(AnnotationExample answeredQuery)
          Accept the answer to the last query.
 void setCompressDataset(boolean flag)
           
 void setDisplayDatasetBeforeLearning(boolean newDisplayDatasetBeforeLearning)
           
 void setDocumentPool(java.util.Iterator<Span> documentLooper)
          Accept the pool of unlabeled documents.
 void setSemiMarkovLearner(BatchSegmenterLearner learner)
           
 void setSpanFeatureExtractor(SpanFeatureExtractor fe)
          Set the feature extractor used by this annotator.
 
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

annotationType

protected java.lang.String annotationType

dataset

protected SegmentDataset dataset

learner

protected BatchSegmenterLearner learner

fe

protected SpanFeatureExtractor fe

maxWindowSize

protected int maxWindowSize
Constructor Detail

SegmentAnnotatorLearner

public SegmentAnnotatorLearner()

SegmentAnnotatorLearner

public SegmentAnnotatorLearner(BatchSegmenterLearner learner,
                               SpanFeatureExtractor fe)

SegmentAnnotatorLearner

public SegmentAnnotatorLearner(BatchSegmenterLearner learner,
                               SpanFeatureExtractor fe,
                               int windowSize)
Method Detail

reset

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

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)

getDisplayDatasetBeforeLearningHelp

public java.lang.String getDisplayDatasetBeforeLearningHelp()

getCompressDataset

public boolean getCompressDataset()
If set, try and compress the data. This leads to longer loading and learning times but less memory usage.


setCompressDataset

public void setCompressDataset(boolean flag)

getCompressDatasetHelp

public java.lang.String getCompressDatasetHelp()

getHistorySize

public int getHistorySize()

getSemiMarkovLearner

public BatchSegmenterLearner getSemiMarkovLearner()

setSemiMarkovLearner

public void setSemiMarkovLearner(BatchSegmenterLearner learner)

getSemiMarkovLearnerHelp

public java.lang.String getSemiMarkovLearnerHelp()

getSpanFeatureExtractor

public SpanFeatureExtractor getSpanFeatureExtractor()
Description copied from class: AnnotatorLearner
Return the span feature extractor used by this annotator. This could be null if no such feature extractor exists.

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)
Specify the type of annotation produced by this annotator - that is, the type associated with spans produced by it.

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 Annotator getAnnotator()
Return the learned annotator.

Specified by:
getAnnotator in class AnnotatorLearner