edu.washington.cs.knowitall.extractor.conf
Class ReVerbClassifierTrainer

java.lang.Object
  extended by edu.washington.cs.knowitall.extractor.conf.ReVerbClassifierTrainer

public class ReVerbClassifierTrainer
extends java.lang.Object

Used to train the ReVerb confidence function using the features described by ReVerbFeatures. Given a set of LabeledBinaryExtraction instances, this class featurizes them and trains a logistic regression classifier using Weka's Logistic class. This class can be called from the command-line to train a classifier and save the resulting model to a file.

Author:
afader

Constructor Summary
ReVerbClassifierTrainer(java.lang.Iterable<LabeledBinaryExtraction> examples)
          Constructs and trains a new Logistic classifier using the given examples.
 
Method Summary
 weka.classifiers.functions.Logistic getClassifier()
           
 WekaDataSet<ChunkedBinaryExtraction> getDataSet()
           
static void main(java.lang.String[] args)
          Trains a logistic regression classifier using the examples in the given file, and saves the model to disk.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ReVerbClassifierTrainer

public ReVerbClassifierTrainer(java.lang.Iterable<LabeledBinaryExtraction> examples)
                        throws java.lang.Exception
Constructs and trains a new Logistic classifier using the given examples.

Parameters:
examples -
Throws:
java.lang.Exception
Method Detail

getDataSet

public WekaDataSet<ChunkedBinaryExtraction> getDataSet()
Returns:
the data set used to train the classifier

getClassifier

public weka.classifiers.functions.Logistic getClassifier()
Returns:
the trained classifier.

main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception
Trains a logistic regression classifier using the examples in the given file, and saves the model to disk. The examples must be in the format described in LabeledBinaryExtractionReader. An optional third parameter can be passed that writes the training data in Weka's ARFF file format to disk.

Parameters:
args -
Throws:
java.lang.Exception