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_CLASSIFIERclassIndex, 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, getClassifierNoExceptions, getCliqueTree, getCliqueTree, getCliqueTrees, getDefaultClassifier, getDefaultClassifier, getJarClassifier, 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, train, updateWeightsForTest, writeWeightsapply, backgroundSymbol, classify, 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, getViterbiSearchGraph, labels, loadClassifier, loadClassifier, loadClassifier, loadClassifier, loadClassifier, loadClassifier, loadClassifierNoExceptions, loadClassifierNoExceptions, loadClassifierNoExceptions, loadClassifierNoExceptions, loadClassifierNoExceptions, loadJarClassifier, makeObjectBankFromFile, makeObjectBankFromFile, makeObjectBankFromFiles, makeObjectBankFromFiles, makeObjectBankFromFiles, makeObjectBankFromReader, makeObjectBankFromString, makePlainTextReaderAndWriter, makeReaderAndWriter, outputCalibrationInfo, plainTextReaderAndWriter, printFeatureLists, printFeatures, printProbs, printProbs, printProbsDocuments, printResults, reinit, segmentString, segmentString, train, train, train, train, train, train, windowSize, writeAnswersprotected CRFClassifierNonlinear()
public CRFClassifierNonlinear(java.util.Properties props)
public CRFClassifierNonlinear(SeqClassifierFlags flags)
public Triple<int[][][],int[],double[][][]> documentToDataAndLabels(java.util.List<IN> document)
CRFClassifierdocumentToDataAndLabels 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.Exceptionprotected void loadTextClassifier(java.io.BufferedReader br)
throws java.lang.Exception
loadTextClassifier in class CRFClassifier<IN extends CoreMap>java.lang.Exceptionpublic void serializeClassifier(java.io.ObjectOutputStream oos)
CRFClassifierserializeClassifier 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
CRFClassifierNote: 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