public class PresetSequenceClassifier<IN extends CoreMap> extends AbstractSequenceClassifier<IN>
classIndex, featureFactories, flags, knownLCWords, pad, windowSize| Constructor and Description |
|---|
PresetSequenceClassifier(Properties props) |
| Modifier and Type | Method and Description |
|---|---|
List<IN> |
classify(List<IN> document)
|
List<IN> |
classifyWithGlobalInformation(List<IN> tokenSeq,
CoreMap doc,
CoreMap sent)
|
void |
loadClassifier(ObjectInputStream ois,
Properties props)
Load a classifier from the specified input stream.
|
void |
serializeClassifier(ObjectOutputStream oos)
Serialize a sequence classifier to an object output stream
|
void |
serializeClassifier(String serializePath)
Serialize a sequence classifier to a file on the given path.
|
void |
train(Collection<List<IN>> objectBankWrapper,
DocumentReaderAndWriter<IN> readerAndWriter)
Trains a classifier from a Collection of sequences.
|
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, dumpFeatures, finalizeClassification, getKnownLCWords, getSampler, getSequenceModel, labels, loadClassifier, loadClassifier, loadClassifier, loadClassifier, loadClassifier, loadClassifier, loadClassifierNoExceptions, loadClassifierNoExceptions, loadClassifierNoExceptions, loadClassifierNoExceptions, loadClassifierNoExceptions, makeObjectBankFromFile, makeObjectBankFromFile, makeObjectBankFromFiles, makeObjectBankFromFiles, makeObjectBankFromFiles, makeObjectBankFromReader, makeObjectBankFromString, makePlainTextReaderAndWriter, makeReaderAndWriter, plainTextReaderAndWriter, printFeatureLists, printFeatures, printProbs, printProbs, printProbsDocument, printProbsDocuments, printResults, reinit, segmentString, segmentString, train, train, train, train, train, train, windowSize, writeAnswerspublic PresetSequenceClassifier(Properties props)
public void serializeClassifier(String serializePath)
serializeClassifier in class AbstractSequenceClassifier<IN extends CoreMap>serializePath - The path/filename to write the classifier to.public void serializeClassifier(ObjectOutputStream oos)
serializeClassifier in class AbstractSequenceClassifier<IN extends CoreMap>public void loadClassifier(ObjectInputStream ois, Properties props)
loadClassifier in class AbstractSequenceClassifier<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 classifierpublic List<IN> classify(List<IN> document)
AbstractSequenceClassifierList of something that extendsCoreMap.
The classifications are added in place to the items of the document,
which is also returned by this method.
Warning: In many circumstances, you should not call this method directly.
In particular, if you call this method directly, your document will not be preprocessed
to add things like word distributional similarity class or word shape features that your
classifier may rely on to work correctly. In such cases, you should call
classifySentence instead.classify in class AbstractSequenceClassifier<IN extends CoreMap>document - A List of something that extends CoreMap.List, but with the elements annotated with their
answers (stored under the
CoreAnnotations.AnswerAnnotation
key). The answers will be the class labels defined by the CRF
Classifier. They might be things like entity labels (in BIO
notation or not) or something like "1" vs. "0" on whether to
begin a new token here or not (in word segmentation).public List<IN> classifyWithGlobalInformation(List<IN> tokenSeq, CoreMap doc, CoreMap sent)
AbstractSequenceClassifierList of something that extends CoreMap using as
additional information whatever is stored in the document and sentence.
This is needed for SUTime (NumberSequenceClassifier), which requires
the document date to resolve relative dates.classifyWithGlobalInformation in class AbstractSequenceClassifier<IN extends CoreMap>tokenSeq - A List of something that extends CoreMappublic void train(Collection<List<IN>> objectBankWrapper, DocumentReaderAndWriter<IN> readerAndWriter)
train in class AbstractSequenceClassifier<IN extends CoreMap>objectBankWrapper - An ObjectBank or a collection of sequences of INreaderAndWriter - A DocumentReaderAndWriter to use when loading test files