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 String |
APPLY_NUMERIC_CLASSIFIERS_PROPERTY |
static Set<String> |
DEFAULT_PASS_DOWN_PROPERTIES |
static NERClassifierCombiner.Language |
NER_LANGUAGE_DEFAULT |
static String |
NER_LANGUAGE_PROPERTY |
static String |
NER_LANGUAGE_PROPERTY_BASE |
static 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,
String... loadPaths) |
NERClassifierCombiner(boolean applyNumericClassifiers,
NERClassifierCombiner.Language nerLanguage,
boolean useSUTime,
Properties nscProps,
String... loadPaths) |
NERClassifierCombiner(ObjectInputStream ois,
Properties props) |
NERClassifierCombiner(Properties props) |
NERClassifierCombiner(String... loadPaths) |
Modifier and Type | Method and Description |
---|---|
boolean |
appliesNumericClassifiers() |
List<CoreLabel> |
classify(List<CoreLabel> tokens)
Generates the AnswerAnnotation labels of the combined model for the given
tokens, storing them in place in the tokens.
|
List<CoreLabel> |
classifyWithGlobalInformation(List<CoreLabel> tokens,
CoreMap document,
CoreMap sentence)
|
static NERClassifierCombiner |
createNERClassifierCombiner(String name,
Properties properties)
This factory method is used to create the NERClassifierCombiner used in NERCombinerAnnotator
(and, thence, in StanfordCoreNLP).
|
static NERClassifierCombiner |
createNERClassifierCombiner(String name,
Set<String> passDownProperties,
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(ObjectInputStream ois,
Properties props) |
static NERClassifierCombiner |
getClassifier(String loadPath,
Properties props)
Static method for getting an NERClassifierCombiner from a string path.
|
static void |
main(String[] args)
The main method.
|
void |
serializeClassifier(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, 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 String APPLY_NUMERIC_CLASSIFIERS_PROPERTY
public static final NERClassifierCombiner.Language NER_LANGUAGE_DEFAULT
public static final String NER_LANGUAGE_PROPERTY
public static final String NER_LANGUAGE_PROPERTY_BASE
public static final String USE_PRESET_NER_PROPERTY
public NERClassifierCombiner(Properties props) throws IOException
IOException
public NERClassifierCombiner(String... loadPaths) throws IOException
IOException
public NERClassifierCombiner(boolean applyNumericClassifiers, boolean useSUTime, String... loadPaths) throws IOException
IOException
public NERClassifierCombiner(boolean applyNumericClassifiers, NERClassifierCombiner.Language nerLanguage, boolean useSUTime, Properties nscProps, String... loadPaths) throws IOException
IOException
@SafeVarargs public NERClassifierCombiner(AbstractSequenceClassifier<CoreLabel>... classifiers) throws IOException
IOException
@SafeVarargs public NERClassifierCombiner(boolean applyNumericClassifiers, boolean useSUTime, AbstractSequenceClassifier<CoreLabel>... classifiers) throws IOException
IOException
public NERClassifierCombiner(ObjectInputStream ois, Properties props) throws IOException, ClassCastException, ClassNotFoundException
public static NERClassifierCombiner createNERClassifierCombiner(String name, 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(String name, Set<String> passDownProperties, 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 List<CoreLabel> classify(List<CoreLabel> tokens)
ClassifierCombiner
classify
in class ClassifierCombiner<CoreLabel>
tokens
- A List of INpublic List<CoreLabel> classifyWithGlobalInformation(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(ObjectOutputStream oos)
AbstractSequenceClassifier
serializeClassifier
in class ClassifierCombiner<CoreLabel>
public static NERClassifierCombiner getClassifier(String loadPath, Properties props) throws IOException, ClassNotFoundException, ClassCastException
public static NERClassifierCombiner getClassifier(ObjectInputStream ois, Properties props) throws IOException, ClassNotFoundException, ClassCastException
public static void showNCCInfo(NERClassifierCombiner ncc)