edu.cmu.minorthird.text.learn.experiments
Class TextLabelsExperiment
java.lang.Object
edu.cmu.minorthird.text.learn.experiments.TextLabelsExperiment
- All Implemented Interfaces:
- Visible
public class TextLabelsExperiment
- extends java.lang.Object
- implements Visible
Run an annotation-learning experiment based on pre-labeled text.
- Author:
- William Cohen
Constructor Summary |
TextLabelsExperiment(TextLabels labels,
Splitter<Span> splitter,
AnnotatorLearner learner,
java.lang.String inputType,
java.lang.String outputLabel)
|
TextLabelsExperiment(TextLabels labels,
Splitter<Span> splitter,
java.lang.String learnerName,
java.lang.String spanType,
java.lang.String spanProp,
java.lang.String outputLabel)
|
TextLabelsExperiment(TextLabels labels,
Splitter<Span> splitter,
java.lang.String learnerName,
java.lang.String spanType,
java.lang.String spanProp,
java.lang.String outputLabel,
Extraction2TaggingReduction reduce)
|
TextLabelsExperiment(TextLabels labels,
Splitter<Span> splitter,
TextLabels testLabels,
AnnotatorLearner learner,
java.lang.String inputType,
java.lang.String inputProp,
java.lang.String outputLabel)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
TextLabelsExperiment
public TextLabelsExperiment(TextLabels labels,
Splitter<Span> splitter,
java.lang.String learnerName,
java.lang.String spanType,
java.lang.String spanProp,
java.lang.String outputLabel)
- Parameters:
labels
- The labels and base to be annotated in the example These are the
training examplessplitter
- splitter for the documents in the labels to create test vs. trainlearnerName
- AnnotatorLearner algorithm object to usespanType
- spanType in the TextLabels to use as training data. (I.e., the
spanType to learn.spanProp
- span property in the TextLabels to use as training data.outputLabel
- the spanType that will be assigned to spans predicted to be of
type inputLabel by the learner (I.e., the output type associated
with the learned annotator.)
TextLabelsExperiment
public TextLabelsExperiment(TextLabels labels,
Splitter<Span> splitter,
java.lang.String learnerName,
java.lang.String spanType,
java.lang.String spanProp,
java.lang.String outputLabel,
Extraction2TaggingReduction reduce)
TextLabelsExperiment
public TextLabelsExperiment(TextLabels labels,
Splitter<Span> splitter,
AnnotatorLearner learner,
java.lang.String inputType,
java.lang.String outputLabel)
TextLabelsExperiment
public TextLabelsExperiment(TextLabels labels,
Splitter<Span> splitter,
TextLabels testLabels,
AnnotatorLearner learner,
java.lang.String inputType,
java.lang.String inputProp,
java.lang.String outputLabel)
- Parameters:
labels
- TextLabels to train onsplitter
- how to partition labels into train/testtestLabels
- if splitter is a FixedTestSetSplitter, these are the labels for
the test cases. Otherwise the labels for the test cases are given
in the "labels" input.learner
- the learner to userinputType
- the spanType to learn to extract (if non-null)inputProp
- the spanProp to learn to extract and label (if non-null)outputLabel
- the spanType/spanProp used for predictions
getFE
public SampleFE.ExtractionFE getFE()
doExperiment
public void doExperiment()
getEvaluation
public ExtractionEvaluation getEvaluation()
toGUI
public Viewer toGUI()
- Description copied from interface:
Visible
- Create a view of this object
- Specified by:
toGUI
in interface Visible
toAnnotatorLearner
public AnnotatorLearner toAnnotatorLearner(java.lang.String s)
toSeqLearner
public static BatchSequenceClassifierLearner toSeqLearner(java.lang.String learnerName)
getTestLabels
public TextLabels getTestLabels()
main
public static void main(java.lang.String[] args)