edu.cmu.minorthird.classify.sequential
Class CRFLearner

java.lang.Object
  extended by edu.cmu.minorthird.classify.sequential.CRFLearner
All Implemented Interfaces:
BatchSequenceClassifierLearner, SequenceClassifier, SequenceClassifierLearner, SequenceConstants, Visible, java.io.Serializable
Direct Known Subclasses:
SegmentCRFLearner

public class CRFLearner
extends java.lang.Object
implements BatchSequenceClassifierLearner, SequenceConstants, SequenceClassifier, Visible, java.io.Serializable

Sequential learner based on the CRF algorithm. Source for the iitb.CRF package available from http://crf.sourceforge.net.

Author:
Sunita Sarawagi
See Also:
Serialized Form

Nested Class Summary
 class CRFLearner.MTFeatureGenImpl
           
 
Field Summary
 java.lang.String maxItersHelp
           
 java.lang.String useHighPrecisionArithmeticHelp
           
 
Fields inherited from interface edu.cmu.minorthird.classify.sequential.SequenceConstants
HISTORY_FEATURE, NULL_CLASS_NAME
 
Constructor Summary
CRFLearner()
           
CRFLearner(java.lang.String args)
           
CRFLearner(java.lang.String[] args)
           
CRFLearner(java.lang.String args, int histsize)
           
 
Method Summary
 SequenceClassifier batchTrain(SequenceDataset dataset)
           
 ClassLabel[] classification(Instance[] sequence)
          Return a predicted type for each element of the sequence.
 java.lang.String explain(Instance[] sequence)
          Return some string that 'explains' the classification
 Explanation getExplanation(Instance[] sequence)
          Return and explanation for a classification
 int getHistorySize()
          Return the number of previous predictions used as features in learning.
 int getMaxIters()
           
 java.lang.String getMaxItersHelp()
           
 ExampleSchema getSchema()
           
 boolean getUseHighPrecisionArithmetic()
           
 java.lang.String getUseHighPrecisionArithmeticHelp()
           
 void removeLogSpaceOption()
           
 void setLogSpaceOption()
           
 void setMaxIters(int newMaxIters)
           
 void setSchema(ExampleSchema schema)
           
 void setUseHighPrecisionArithmetic(boolean newUseHighPrecisionArithmetic)
           
 Viewer toGUI()
          Create a view of this object
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

maxItersHelp

public java.lang.String maxItersHelp

useHighPrecisionArithmeticHelp

public java.lang.String useHighPrecisionArithmeticHelp
Constructor Detail

CRFLearner

public CRFLearner()

CRFLearner

public CRFLearner(java.lang.String args)

CRFLearner

public CRFLearner(java.lang.String args,
                  int histsize)

CRFLearner

public CRFLearner(java.lang.String[] args)
Method Detail

setLogSpaceOption

public void setLogSpaceOption()

removeLogSpaceOption

public void removeLogSpaceOption()

setSchema

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

getSchema

public ExampleSchema getSchema()

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

setMaxIters

public void setMaxIters(int newMaxIters)

getMaxIters

public int getMaxIters()

getMaxItersHelp

public java.lang.String getMaxItersHelp()

getUseHighPrecisionArithmetic

public boolean getUseHighPrecisionArithmetic()

setUseHighPrecisionArithmetic

public void setUseHighPrecisionArithmetic(boolean newUseHighPrecisionArithmetic)

getUseHighPrecisionArithmeticHelp

public java.lang.String getUseHighPrecisionArithmeticHelp()

batchTrain

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

classification

public ClassLabel[] classification(Instance[] sequence)
Return a predicted type for each element of the sequence.

Specified by:
classification in interface SequenceClassifier

explain

public java.lang.String explain(Instance[] sequence)
Return some string that 'explains' the classification

Specified by:
explain in interface SequenceClassifier

getExplanation

public Explanation getExplanation(Instance[] sequence)
Description copied from interface: SequenceClassifier
Return and explanation for a classification

Specified by:
getExplanation in interface SequenceClassifier

toGUI

public Viewer toGUI()
Description copied from interface: Visible
Create a view of this object

Specified by:
toGUI in interface Visible