public class NERClassifierCombiner extends ClassifierCombiner<CoreLabel>
Modifier and Type | Class and Description |
---|---|
static class |
NERClassifierCombiner.Language |
Modifier and Type | Field and Description |
---|---|
static boolean |
APPLY_NUMERIC_CLASSIFIERS_DEFAULT |
static java.lang.String |
APPLY_NUMERIC_CLASSIFIERS_PROPERTY |
static java.util.Set<java.lang.String> |
DEFAULT_PASS_DOWN_PROPERTIES |
static NERClassifierCombiner.Language |
NER_LANGUAGE_DEFAULT |
static java.lang.String |
NER_LANGUAGE_PROPERTY |
static java.lang.String |
NER_LANGUAGE_PROPERTY_BASE |
static java.lang.String |
USE_PRESET_NER_PROPERTY |
classIndex, featureFactories, flags, knownLCWords, pad, windowSize
Constructor and Description |
---|
NERClassifierCombiner(AbstractSequenceClassifier<CoreLabel>... classifiers) |
NERClassifierCombiner(boolean applyNumericClassifiers,
boolean useSUTime,
AbstractSequenceClassifier<CoreLabel>... classifiers) |
NERClassifierCombiner(boolean applyNumericClassifiers,
boolean useSUTime,
java.lang.String... loadPaths) |
NERClassifierCombiner(boolean applyNumericClassifiers,
NERClassifierCombiner.Language nerLanguage,
boolean useSUTime,
java.util.Properties nscProps,
java.lang.String... loadPaths) |
NERClassifierCombiner(java.io.ObjectInputStream ois,
java.util.Properties props) |
NERClassifierCombiner(java.util.Properties props) |
NERClassifierCombiner(java.lang.String... loadPaths) |
Modifier and Type | Method and Description |
---|---|
boolean |
appliesNumericClassifiers() |
java.util.List<CoreLabel> |
classify(java.util.List<CoreLabel> tokens)
Generates the AnswerAnnotation labels of the combined model for the given
tokens, storing them in place in the tokens.
|
java.util.List<CoreLabel> |
classifyWithGlobalInformation(java.util.List<CoreLabel> tokens,
CoreMap document,
CoreMap sentence)
Classify a
List of something that extends CoreMap using as
additional information whatever is stored in the document and sentence. |
static NERClassifierCombiner |
createNERClassifierCombiner(java.lang.String name,
java.util.Properties properties)
This factory method is used to create the NERClassifierCombiner used in NERCombinerAnnotator
(and, thence, in StanfordCoreNLP).
|
static NERClassifierCombiner |
createNERClassifierCombiner(java.lang.String name,
java.util.Set<java.lang.String> passDownProperties,
java.util.Properties properties)
This factory method is used to create the NERClassifierCombiner used in NERCombinerAnnotator
(and, thence, in StanfordCoreNLP).
|
void |
finalizeAnnotation(Annotation annotation) |
static NERClassifierCombiner |
getClassifier(java.io.ObjectInputStream ois,
java.util.Properties props) |
static NERClassifierCombiner |
getClassifier(java.lang.String loadPath,
java.util.Properties props)
Static method for getting an NERClassifierCombiner from a string path.
|
static void |
main(java.lang.String[] args)
The main method.
|
void |
serializeClassifier(java.io.ObjectOutputStream oos)
Serialize a sequence classifier to an object output stream
|
static void |
showNCCInfo(NERClassifierCombiner ncc)
Method for displaying info about an NERClassifierCombiner.
|
boolean |
usesSUTime() |
examineCRF, extractCombinationMode, extractCombinationModeSafe, labels, loadClassifier, loadClassifierFromPath, serializeClassifier, showCCInfo, train
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, 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, printProbsDocument, printProbsDocuments, printResults, reinit, segmentString, segmentString, train, train, train, train, train, train, windowSize, writeAnswers
public static final boolean APPLY_NUMERIC_CLASSIFIERS_DEFAULT
public static final java.lang.String APPLY_NUMERIC_CLASSIFIERS_PROPERTY
public static final NERClassifierCombiner.Language NER_LANGUAGE_DEFAULT
public static final java.lang.String NER_LANGUAGE_PROPERTY
public static final java.lang.String NER_LANGUAGE_PROPERTY_BASE
public static final java.lang.String USE_PRESET_NER_PROPERTY
public static final java.util.Set<java.lang.String> DEFAULT_PASS_DOWN_PROPERTIES
public NERClassifierCombiner(java.util.Properties props) throws java.io.IOException
java.io.IOException
public NERClassifierCombiner(java.lang.String... loadPaths) throws java.io.IOException
java.io.IOException
public NERClassifierCombiner(boolean applyNumericClassifiers, boolean useSUTime, java.lang.String... loadPaths) throws java.io.IOException
java.io.IOException
public NERClassifierCombiner(boolean applyNumericClassifiers, NERClassifierCombiner.Language nerLanguage, boolean useSUTime, java.util.Properties nscProps, java.lang.String... loadPaths) throws java.io.IOException
java.io.IOException
@SafeVarargs public NERClassifierCombiner(AbstractSequenceClassifier<CoreLabel>... classifiers) throws java.io.IOException
java.io.IOException
@SafeVarargs public NERClassifierCombiner(boolean applyNumericClassifiers, boolean useSUTime, AbstractSequenceClassifier<CoreLabel>... classifiers) throws java.io.IOException
java.io.IOException
public NERClassifierCombiner(java.io.ObjectInputStream ois, java.util.Properties props) throws java.io.IOException, java.lang.ClassCastException, java.lang.ClassNotFoundException
java.io.IOException
java.lang.ClassCastException
java.lang.ClassNotFoundException
public static NERClassifierCombiner createNERClassifierCombiner(java.lang.String name, java.util.Properties properties)
name
- A "x.y" format property name prefix (the "x" part). This is commonly null,
and then "ner" is used. If it is the empty string, then no property prefix is used.properties
- Various properties, including a list in "ner.model".
The used ones start with name + "." or are in passDownPropertiespublic static NERClassifierCombiner createNERClassifierCombiner(java.lang.String name, java.util.Set<java.lang.String> passDownProperties, java.util.Properties properties)
name
- A "x.y" format property name prefix (the "x" part). This is commonly null,
and then "ner" is used. If it is the empty string, then no property prefix is used.passDownProperties
- Property names for which the property should be passed down
to the NERClassifierCombiner. The default is not to pass down, but pass down is
useful for things like charset encoding.properties
- Various properties, including a list in "ner.model".
The used ones start with name + "." or are in passDownPropertiespublic boolean appliesNumericClassifiers()
public boolean usesSUTime()
public java.util.List<CoreLabel> classify(java.util.List<CoreLabel> tokens)
ClassifierCombiner
classify
in class ClassifierCombiner<CoreLabel>
tokens
- A List of INpublic java.util.List<CoreLabel> classifyWithGlobalInformation(java.util.List<CoreLabel> tokens, CoreMap document, CoreMap sentence)
AbstractSequenceClassifier
List
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 ClassifierCombiner<CoreLabel>
tokens
- A List
of something that extends CoreMap
public void finalizeAnnotation(Annotation annotation)
public void serializeClassifier(java.io.ObjectOutputStream oos)
AbstractSequenceClassifier
serializeClassifier
in class ClassifierCombiner<CoreLabel>
public static NERClassifierCombiner getClassifier(java.lang.String loadPath, java.util.Properties props) throws java.io.IOException, java.lang.ClassNotFoundException, java.lang.ClassCastException
java.io.IOException
java.lang.ClassNotFoundException
java.lang.ClassCastException
public static NERClassifierCombiner getClassifier(java.io.ObjectInputStream ois, java.util.Properties props) throws java.io.IOException, java.lang.ClassNotFoundException, java.lang.ClassCastException
java.io.IOException
java.lang.ClassNotFoundException
java.lang.ClassCastException
public static void showNCCInfo(NERClassifierCombiner ncc)
public static void main(java.lang.String[] args) throws java.lang.Exception
java.lang.Exception