public class CRFClassifierNonlinear<IN extends CoreMap> extends CRFClassifier<IN>
CRFClassifier
for implementing the nonlinear architecture in [Wang and Manning IJCNLP-2013 Effect of Nonlinear ...].DEFAULT_CLASSIFIER
classIndex, featureFactories, flags, knownLCWords, pad, windowSize
Modifier | Constructor and Description |
---|---|
protected |
CRFClassifierNonlinear() |
|
CRFClassifierNonlinear(java.util.Properties props) |
|
CRFClassifierNonlinear(SeqClassifierFlags flags) |
Modifier and Type | Method and Description |
---|---|
Triple<int[][][],int[],double[][][]> |
documentToDataAndLabels(java.util.List<IN> document)
Convert a document List into arrays storing the data features and labels.
|
protected CliquePotentialFunction |
getCliquePotentialFunctionForTest() |
void |
loadClassifier(java.io.ObjectInputStream ois,
java.util.Properties props)
Loads a classifier from the specified InputStream.
|
protected void |
loadTextClassifier(java.io.BufferedReader br) |
void |
serializeClassifier(java.io.ObjectOutputStream oos)
Serialize the classifier to the given ObjectOutputStream.
|
protected void |
serializeTextClassifier(java.io.PrintWriter pw) |
protected double[] |
trainWeights(int[][][][] data,
int[][] labels,
Evaluator[] evaluators,
int pruneFeatureItr,
double[][][][] featureVals) |
addProcessedData, allLabels, classify, classifyGibbs, classifyGibbs, classifyMaxEnt, classifyWithGlobalInformation, combine, documentsToDataAndLabels, documentsToDataAndLabelsList, dropFeaturesBelowThreshold, dumpFeatures, extractDatumSequence, getClassifier, getClassifier, getClassifier, getClassifier, getClassifier, getClassifier, getClassifierNoExceptions, getCliqueTree, getCliqueTree, getCliqueTrees, getDefaultClassifier, getDefaultClassifier, getMinimizer, getMinimizer, getNumWeights, getObjectiveFunction, getSequenceModel, loadAuxiliaryData, loadClassIndexFromFile, loadDefaultClassifier, loadDefaultClassifier, loadFeatureIndexFromFile, loadProcessedData, loadTagIndex, loadTextClassifier, loadWeightsFromFile, main, makeAnswerArraysAndTagIndex, makeDatum, printFactorTable, printFactorTableDocument, printFactorTableDocuments, printFeatures, printFirstOrderProbs, printFirstOrderProbsDocument, printFirstOrderProbsDocuments, printLabelInformation, printLabelValue, printProbsDocument, pruneNodeFeatureIndices, saveProcessedData, scaleWeights, serializeClassifier, serializeClassIndex, serializeFeatureIndex, serializeTextClassifier, serializeWeights, to2D, topWeights, toString, train, updateWeightsForTest, writeWeights, zeroOrderProbabilities
apply, backgroundSymbol, classify, classifyAndWriteAnswers, classifyAndWriteAnswers, classifyAndWriteAnswers, classifyAndWriteAnswers, classifyAndWriteAnswers, classifyAndWriteAnswers, classifyAndWriteAnswers, classifyAndWriteAnswersKBest, classifyAndWriteAnswersKBest, classifyAndWriteViterbiSearchGraph, classifyFile, classifyFilesAndWriteAnswers, classifyFilesAndWriteAnswers, classifyKBest, classifyRaw, classifySentence, classifySentenceWithGlobalInformation, classifyStdin, classifyStdin, classifyToCharacterOffsets, classifyToString, classifyToString, classifyWithInlineXML, countResults, countResultsSegmenter, defaultReaderAndWriter, finalizeClassification, getKnownLCWords, getSampler, labels, loadClassifier, loadClassifier, loadClassifier, loadClassifier, loadClassifier, loadClassifier, loadClassifierNoExceptions, loadClassifierNoExceptions, loadClassifierNoExceptions, loadClassifierNoExceptions, loadClassifierNoExceptions, makeObjectBankFromFile, makeObjectBankFromFile, makeObjectBankFromFiles, makeObjectBankFromFiles, makeObjectBankFromFiles, makeObjectBankFromReader, makeObjectBankFromString, makePlainTextReaderAndWriter, makePlainTextReaderAndWriter, makeReaderAndWriter, plainTextReaderAndWriter, printFeatureLists, printFeatures, printProbs, printProbs, printProbsDocuments, printResults, reinit, segmentString, segmentString, train, train, train, train, train, train, windowSize, writeAnswers
protected CRFClassifierNonlinear()
public CRFClassifierNonlinear(java.util.Properties props)
public CRFClassifierNonlinear(SeqClassifierFlags flags)
public Triple<int[][][],int[],double[][][]> documentToDataAndLabels(java.util.List<IN> document)
CRFClassifier
documentToDataAndLabels
in class CRFClassifier<IN extends CoreMap>
document
- Testing documentsprotected CliquePotentialFunction getCliquePotentialFunctionForTest()
getCliquePotentialFunctionForTest
in class CRFClassifier<IN extends CoreMap>
protected double[] trainWeights(int[][][][] data, int[][] labels, Evaluator[] evaluators, int pruneFeatureItr, double[][][][] featureVals)
trainWeights
in class CRFClassifier<IN extends CoreMap>
protected void serializeTextClassifier(java.io.PrintWriter pw) throws java.lang.Exception
serializeTextClassifier
in class CRFClassifier<IN extends CoreMap>
java.lang.Exception
protected void loadTextClassifier(java.io.BufferedReader br) throws java.lang.Exception
loadTextClassifier
in class CRFClassifier<IN extends CoreMap>
java.lang.Exception
public void serializeClassifier(java.io.ObjectOutputStream oos)
CRFClassifier
serializeClassifier
in class CRFClassifier<IN extends CoreMap>
public void loadClassifier(java.io.ObjectInputStream ois, java.util.Properties props) throws java.lang.ClassCastException, java.io.IOException, java.lang.ClassNotFoundException
CRFClassifier
Note: This method does not close the ObjectInputStream. (But earlier versions of the code used to, so beware....)
loadClassifier
in class CRFClassifier<IN extends CoreMap>
ois
- The InputStream to load the serialized classifier fromprops
- This Properties object will be used to update the
SeqClassifierFlags which are read from the serialized classifierjava.lang.ClassCastException
- If there are problems interpreting the serialized datajava.io.IOException
- If there are problems accessing the input streamjava.lang.ClassNotFoundException
- If there are problems interpreting the serialized data