edu.cmu.minorthird.text.learn.experiments
Class TextLabelsExperiment

java.lang.Object
  extended by 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)
           
 
Method Summary
 void doExperiment()
           
 ExtractionEvaluation getEvaluation()
           
 SampleFE.ExtractionFE getFE()
           
 TextLabels getTestLabels()
           
static void main(java.lang.String[] args)
           
 AnnotatorLearner toAnnotatorLearner(java.lang.String s)
           
 Viewer toGUI()
          Create a view of this object
static BatchSequenceClassifierLearner toSeqLearner(java.lang.String learnerName)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

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 examples
splitter - splitter for the documents in the labels to create test vs. train
learnerName - AnnotatorLearner algorithm object to use
spanType - 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 on
splitter - how to partition labels into train/test
testLabels - 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 user
inputType - 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
Method Detail

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)