edu.stanford.nlp.ie
Class NERClassifierCombiner

java.lang.Object
  extended by edu.stanford.nlp.ie.AbstractSequenceClassifier<IN>
      extended by edu.stanford.nlp.ie.ClassifierCombiner<CoreLabel>
          extended by edu.stanford.nlp.ie.NERClassifierCombiner
All Implemented Interfaces:
Function<java.lang.String,java.lang.String>

public class NERClassifierCombiner
extends ClassifierCombiner<CoreLabel>

Subclass of ClassifierCombiner that behaves like a NER, by copying the AnswerAnnotation labels to NERAnnotation Also, it runs an additional classifier (QuantifiableEntityNormalizer) to recognize numeric entities

Author:
Mihai Surdeanu

Field Summary
static boolean APPLY_NUMERIC_CLASSIFIERS_DEFAULT
           
static java.lang.String APPLY_NUMERIC_CLASSIFIERS_PROPERTY
           
 
Fields inherited from class edu.stanford.nlp.ie.AbstractSequenceClassifier
classIndex, featureFactory, flags, knownLCWords, pad, windowSize
 
Constructor Summary
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.util.Properties props)
           
NERClassifierCombiner(java.lang.String... loadPaths)
           
 
Method Summary
 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.
 boolean isApplyNumericClassifiers()
           
 
Methods inherited from class edu.stanford.nlp.ie.ClassifierCombiner
labels, loadClassifier, loadClassifierFromPath, main, printProbsDocument, serializeClassifier, train
 
Methods inherited from class edu.stanford.nlp.ie.AbstractSequenceClassifier
apply, backgroundSymbol, classify, classifyAndWriteAnswers, classifyAndWriteAnswers, classifyAndWriteAnswers, classifyAndWriteAnswers, classifyAndWriteAnswers, classifyAndWriteAnswers, classifyAndWriteAnswers, classifyAndWriteAnswersKBest, classifyAndWriteAnswersKBest, classifyAndWriteViterbiSearchGraph, classifyFile, classifyKBest, classifyRaw, classifySentence, classifySentenceWithGlobalInformation, classifyStdin, classifyStdin, classifyToCharacterOffsets, classifyToString, classifyToString, classifyWithInlineXML, countResults, countResults, countResultsIOB, countResultsIOB2, defaultReaderAndWriter, getSampler, getSequenceModel, getViterbiSearchGraph, loadClassifier, loadClassifier, loadClassifier, loadClassifier, loadClassifier, loadClassifier, loadClassifierNoExceptions, loadClassifierNoExceptions, loadClassifierNoExceptions, loadClassifierNoExceptions, loadClassifierNoExceptions, loadJarClassifier, makeObjectBankFromFile, makeObjectBankFromFiles, makeObjectBankFromFiles, makeObjectBankFromFiles, makeObjectBankFromReader, makeObjectBankFromString, makePlainTextReaderAndWriter, makeReaderAndWriter, plainTextReaderAndWriter, printFeatureLists, printFeatures, printProbs, printProbsDocuments, printResults, reinit, segmentString, segmentString, tallyOneEntityIOB, train, train, train, train, train, train, windowSize, writeAnswers
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

APPLY_NUMERIC_CLASSIFIERS_DEFAULT

public static final boolean APPLY_NUMERIC_CLASSIFIERS_DEFAULT
See Also:
Constant Field Values

APPLY_NUMERIC_CLASSIFIERS_PROPERTY

public static final java.lang.String APPLY_NUMERIC_CLASSIFIERS_PROPERTY
See Also:
Constant Field Values
Constructor Detail

NERClassifierCombiner

public NERClassifierCombiner(java.util.Properties props)
                      throws java.io.FileNotFoundException
Throws:
java.io.FileNotFoundException

NERClassifierCombiner

public NERClassifierCombiner(java.lang.String... loadPaths)
                      throws java.io.FileNotFoundException
Throws:
java.io.FileNotFoundException

NERClassifierCombiner

public NERClassifierCombiner(boolean applyNumericClassifiers,
                             boolean useSUTime,
                             java.lang.String... loadPaths)
                      throws java.io.FileNotFoundException
Throws:
java.io.FileNotFoundException

NERClassifierCombiner

public NERClassifierCombiner(boolean applyNumericClassifiers,
                             boolean useSUTime,
                             java.util.Properties nscProps,
                             java.lang.String... loadPaths)
                      throws java.io.FileNotFoundException
Throws:
java.io.FileNotFoundException

NERClassifierCombiner

public NERClassifierCombiner(AbstractSequenceClassifier<CoreLabel>... classifiers)
                      throws java.io.FileNotFoundException
Throws:
java.io.FileNotFoundException

NERClassifierCombiner

public NERClassifierCombiner(boolean applyNumericClassifiers,
                             boolean useSUTime,
                             AbstractSequenceClassifier<CoreLabel>... classifiers)
                      throws java.io.FileNotFoundException
Throws:
java.io.FileNotFoundException
Method Detail

isApplyNumericClassifiers

public boolean isApplyNumericClassifiers()

classify

public java.util.List<CoreLabel> classify(java.util.List<CoreLabel> tokens)
Description copied from class: ClassifierCombiner
Generates the AnswerAnnotation labels of the combined model for the given tokens, storing them in place in the tokens.

Overrides:
classify in class ClassifierCombiner<CoreLabel>
Parameters:
tokens - A List of IN
Returns:
The passed in parameters, which will have the AnswerAnnotation field added/overwritten

classifyWithGlobalInformation

public java.util.List<CoreLabel> classifyWithGlobalInformation(java.util.List<CoreLabel> tokens,
                                                               CoreMap document,
                                                               CoreMap sentence)
Description copied from class: AbstractSequenceClassifier
Classify a 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.

Overrides:
classifyWithGlobalInformation in class ClassifierCombiner<CoreLabel>
Returns:
Classified version of the input tokenSequence


Stanford NLP Group