LeftRightT - the type of both left and right items in the alignment@Beta public final class TypeConfusionInspector<LeftRightT> extends Object implements Inspector<Alignment<? extends LeftRightT,? extends LeftRightT>>
Alignment between system items on the left and gold standard items on the
right and creates a confusion matrix between them based on a specified confusion equivalence
and labelling.
To create the confusion matrix, the caller must specify:
Function mapping each observation to its row/column
in the confusion matrix. For example, in part of speech tagging, it would return the part of
speech tag itself.Equivalence that declares two observations to
be equal if they are equal in every relevant way except for the value that would be returned by
the confusion labeler. For example, in part of speech tagging, that equivalence should return
true if two observations refer to the same token in the same document, regardless of whether
the tags assigned to that token match.| Modifier and Type | Method and Description |
|---|---|
static <LeftRightT> |
createOutputtingTo(String name,
com.google.common.base.Function<? super LeftRightT,String> confusionLabeler,
com.google.common.base.Equivalence<LeftRightT> confusionEquivalence,
File outputDir)
Creates a new inspector.
|
void |
finish() |
void |
inspect(Alignment<? extends LeftRightT,? extends LeftRightT> alignment) |
public static <LeftRightT> TypeConfusionInspector<LeftRightT> createOutputtingTo(String name, com.google.common.base.Function<? super LeftRightT,String> confusionLabeler, com.google.common.base.Equivalence<LeftRightT> confusionEquivalence, File outputDir)
LeftRightT - the type of both left and right items in the alignmentname - a name to be used as a prefix for file outputconfusionLabeler - a function for mapping an observation to its label in the confusion matrixconfusionEquivalence - an equivalence between observations that are considered confusableoutputDir - directory for writing outputpublic void finish()
throws IOException
finish in interface FinishableIOExceptionpublic void inspect(Alignment<? extends LeftRightT,? extends LeftRightT> alignment)
inspect in interface Inspector<Alignment<? extends LeftRightT,? extends LeftRightT>>Copyright © 2016. All rights reserved.