edu.cmu.minorthird.classify.sequential
Class CollinsPerceptronLearner

java.lang.Object
  extended by edu.cmu.minorthird.classify.sequential.CollinsPerceptronLearner
All Implemented Interfaces:
BatchSequenceClassifierLearner, SequenceClassifierLearner, SequenceConstants
Direct Known Subclasses:
MarginPerceptronLearner, Recommended.VPTagLearner

public class CollinsPerceptronLearner
extends java.lang.Object
implements BatchSequenceClassifierLearner, SequenceConstants

Sequential learner based on the perceptron algorithm, as described in Discriminative Training Methods for Hidden Markov Models: Theory and Experiments with Perceptron Algorithms, Mike Collins, EMNLP 2002.

Author:
William Cohen

Nested Class Summary
static class CollinsPerceptronLearner.MultiClassVPClassifier
           
 
Field Summary
protected static boolean DEBUG
           
protected  java.lang.String[] history
           
protected  int historySize
           
protected static org.apache.log4j.Logger log
           
protected  int numberOfEpochs
           
 
Fields inherited from interface edu.cmu.minorthird.classify.sequential.SequenceConstants
HISTORY_FEATURE, NULL_CLASS_NAME
 
Constructor Summary
CollinsPerceptronLearner()
           
CollinsPerceptronLearner(int numberOfEpochs)
           
CollinsPerceptronLearner(int historySize, int numberOfEpochs)
           
 
Method Summary
 SequenceClassifier batchTrain(SequenceDataset dataset)
           
 int getHistorySize()
          Return the number of previous predictions used as features in learning.
 java.lang.String getHistorySizeHelp()
           
 int getNumberOfEpochs()
           
 void setHistorySize(int newHistorySize)
           
 void setNumberOfEpochs(int newNumberOfEpochs)
           
 void setSchema(ExampleSchema schema)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected static org.apache.log4j.Logger log

DEBUG

protected static final boolean DEBUG

historySize

protected int historySize

numberOfEpochs

protected int numberOfEpochs

history

protected java.lang.String[] history
Constructor Detail

CollinsPerceptronLearner

public CollinsPerceptronLearner()

CollinsPerceptronLearner

public CollinsPerceptronLearner(int numberOfEpochs)

CollinsPerceptronLearner

public CollinsPerceptronLearner(int historySize,
                                int numberOfEpochs)
Method Detail

getNumberOfEpochs

public int getNumberOfEpochs()

setNumberOfEpochs

public void setNumberOfEpochs(int newNumberOfEpochs)

getHistorySize

public int getHistorySize()
Description copied from interface: SequenceClassifierLearner
Return the number of previous predictions used as features in learning.

Specified by:
getHistorySize in interface SequenceClassifierLearner

setHistorySize

public void setHistorySize(int newHistorySize)

getHistorySizeHelp

public java.lang.String getHistorySizeHelp()

setSchema

public void setSchema(ExampleSchema schema)
Specified by:
setSchema in interface SequenceClassifierLearner

batchTrain

public SequenceClassifier batchTrain(SequenceDataset dataset)
Specified by:
batchTrain in interface BatchSequenceClassifierLearner