Package opennlp.tools.cmdline
Class EvaluationErrorPrinter<T>
java.lang.Object
opennlp.tools.cmdline.EvaluationErrorPrinter<T>
- All Implemented Interfaces:
EvaluationMonitor<T>
- Direct Known Subclasses:
ChunkEvaluationErrorListener,DetokenEvaluationErrorListener,DoccatEvaluationErrorListener,LanguageDetectorEvaluationErrorListener,LemmaEvaluationErrorListener,NameEvaluationErrorListener,POSEvaluationErrorListener,SentenceEvaluationErrorListener,TokenEvaluationErrorListener
@Internal
public abstract class EvaluationErrorPrinter<T>
extends Object
implements EvaluationMonitor<T>
Note: Do not use this class, internal use only!
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedEvaluationErrorPrinter(OutputStream outputStream) protectedEvaluationErrorPrinter(PrintStream printStream) -
Method Summary
Modifier and TypeMethodDescriptionvoidcorrectlyClassified(T reference, T prediction) private voidfindErrors(Span[] references, Span[] predictions, List<Span> falseNegatives, List<Span> falsePositives) Outputs falseNegatives and falsePositives spans from the references and predictions list.abstract voidmisclassified(T reference, T prediction) private StringAuxiliary method to print spansprotected voidprintError(String[] references, String[] predictions, T referenceSample, T predictedSample, String[] sentenceTokens) protected voidprintError(String id, Span[] references, Span[] predictions, T referenceSample, T predictedSample, String[] sentenceTokens) protected voidprintError(Span[] references, Span[] predictions, T referenceSample, T predictedSample, String sentence) protected voidprintError(Span[] references, Span[] predictions, T referenceSample, T predictedSample, String[] sentenceTokens) protected voidprintError(T referenceSample, T predictedSample) private voidAuxiliary method to print tag errorsprivate voidAuxiliary method to print span errorsprivate voidAuxiliary method to print span errorsprivate <S> voidprintSamples(S referenceSample, S predictedSample) Auxiliary method to print expected and predicted samples.
-
Field Details
-
printStream
-
-
Constructor Details
-
EvaluationErrorPrinter
-
EvaluationErrorPrinter
-
-
Method Details
-
printError
-
printError
-
printError
-
printError
-
printError
-
printErrors
private void printErrors(List<String> filteredDoc, List<String> filteredRefs, List<String> filteredPreds) Auxiliary method to print tag errors- Parameters:
filteredDoc- the document tokens which were tagged wrongfilteredRefs- the reference tagsfilteredPreds- the predicted tags
-
printErrors
Auxiliary method to print span errors- Parameters:
falsePositives- false positives spanfalseNegatives- false negative spandoc- the document text
-
printErrors
Auxiliary method to print span errors- Parameters:
falsePositives- false positives spanfalseNegatives- false negative spantoks- the document tokens
-
print
Auxiliary method to print spans- Parameters:
spans- the span listtoks- the tokens array- Returns:
- the spans as string
-
printSamples
private <S> void printSamples(S referenceSample, S predictedSample) Auxiliary method to print expected and predicted samples.- Parameters:
referenceSample- TheEvaluationErrorPrinterfrom the references.predictedSample- TheEvaluationErrorPrinterof the predictions.
-
findErrors
private void findErrors(Span[] references, Span[] predictions, List<Span> falseNegatives, List<Span> falsePositives) Outputs falseNegatives and falsePositives spans from the references and predictions list. -
correctlyClassified
- Specified by:
correctlyClassifiedin interfaceEvaluationMonitor<T>
-
misclassified
- Specified by:
misclassifiedin interfaceEvaluationMonitor<T>
-