public class NERClassifierCombiner extends ClassifierCombiner<CoreLabel>
| Modifier and Type | Field and Description |
|---|---|
static boolean |
APPLY_NUMERIC_CLASSIFIERS_DEFAULT |
static java.lang.String |
APPLY_NUMERIC_CLASSIFIERS_PROPERTY |
static java.lang.String |
APPLY_NUMERIC_CLASSIFIERS_PROPERTY_BASE |
static java.util.Set<java.lang.String> |
DEFAULT_PASS_DOWN_PROPERTIES |
initPropsclassIndex, 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.util.Properties nscProps,
java.lang.String... loadPaths) |
NERClassifierCombiner(boolean applyNumericClassifiers,
boolean useSUTime,
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 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) |
boolean |
usesSUTime() |
examineCRF, extractCombinationMode, extractCombinationModeSafe, labels, loadClassifier, loadClassifierFromPath, serializeClassifier, showCCInfo, trainapply, 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, dumpFeatures, finalizeClassification, getKnownLCWords, getSampler, getSequenceModel, getViterbiSearchGraph, 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, printProbsDocument, printProbsDocuments, printResults, reinit, segmentString, segmentString, train, train, train, train, train, train, windowSize, writeAnswerspublic static final boolean APPLY_NUMERIC_CLASSIFIERS_DEFAULT
public static final java.lang.String APPLY_NUMERIC_CLASSIFIERS_PROPERTY
public static final java.lang.String APPLY_NUMERIC_CLASSIFIERS_PROPERTY_BASE
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.IOExceptionpublic NERClassifierCombiner(java.lang.String... loadPaths)
throws java.io.IOException
java.io.IOExceptionpublic NERClassifierCombiner(boolean applyNumericClassifiers,
boolean useSUTime,
java.lang.String... loadPaths)
throws java.io.IOException
java.io.IOExceptionpublic NERClassifierCombiner(boolean applyNumericClassifiers,
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.IOExceptionpublic NERClassifierCombiner(java.io.ObjectInputStream ois,
java.util.Properties props)
throws java.io.IOException,
java.lang.ClassCastException,
java.lang.ClassNotFoundException
java.io.IOExceptionjava.lang.ClassCastExceptionjava.lang.ClassNotFoundExceptionpublic 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)
ClassifierCombinerclassify in class ClassifierCombiner<CoreLabel>tokens - A List of INpublic java.util.List<CoreLabel> classifyWithGlobalInformation(java.util.List<CoreLabel> tokens, CoreMap document, CoreMap sentence)
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 ClassifierCombiner<CoreLabel>public void finalizeAnnotation(Annotation annotation)
public void serializeClassifier(java.io.ObjectOutputStream oos)
AbstractSequenceClassifierserializeClassifier 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.IOExceptionjava.lang.ClassNotFoundExceptionjava.lang.ClassCastExceptionpublic static NERClassifierCombiner getClassifier(java.io.ObjectInputStream ois, java.util.Properties props) throws java.io.IOException, java.lang.ClassNotFoundException, java.lang.ClassCastException
java.io.IOExceptionjava.lang.ClassNotFoundExceptionjava.lang.ClassCastExceptionpublic static void showNCCInfo(NERClassifierCombiner ncc)
public static void main(java.lang.String[] args)
throws java.lang.Exception
java.lang.Exception