public class AnnotationStatistics<OUTCOME_TYPE extends Comparable<? super OUTCOME_TYPE>> extends Object implements Serializable
Annotations extracted by a system to gold
Annotations.
| Constructor and Description |
|---|
AnnotationStatistics()
Create an AnnotationStatistics that compares
Annotations based on their begin and end
offsets, plus a Feature of the Annotation that represents the outcome or label. |
| Modifier and Type | Method and Description |
|---|---|
<ANNOTATION_TYPE extends Annotation> |
add(Collection<? extends ANNOTATION_TYPE> referenceAnnotations,
Collection<? extends ANNOTATION_TYPE> predictedAnnotations)
Update the statistics, comparing the reference annotations to the predicted annotations.
|
<ANNOTATION_TYPE,SPAN_TYPE> |
add(Collection<? extends ANNOTATION_TYPE> referenceAnnotations,
Collection<? extends ANNOTATION_TYPE> predictedAnnotations,
Function<ANNOTATION_TYPE,SPAN_TYPE> annotationToSpan,
Function<ANNOTATION_TYPE,OUTCOME_TYPE> annotationToOutcome)
Update the statistics, comparing the reference annotations to the predicted annotations.
|
void |
addAll(AnnotationStatistics<OUTCOME_TYPE> that)
Adds all the statistics collected by another AnnotationStatistics to this one.
|
static <OUTCOME_TYPE extends Comparable<? super OUTCOME_TYPE>> |
addAll(Iterable<AnnotationStatistics<OUTCOME_TYPE>> statistics)
Add all statistics together.
|
static <ANNOTATION_TYPE extends TOP> |
annotationToFeatureValue(String featureName)
|
static <ANNOTATION_TYPE,OUTCOME_TYPE> |
annotationToNull()
Creates a
Function that always returns null. |
static <ANNOTATION_TYPE extends Annotation> |
annotationToSpan()
Creates a
Function that converts an Annotation into a hashable representation
of its begin and end offsets. |
ConfusionMatrix<OUTCOME_TYPE> |
confusions()
Returns the
ConfusionMatrix tabulating reference outcomes matched to predicted
outcomes. |
int |
countCorrectOutcomes() |
int |
countCorrectOutcomes(OUTCOME_TYPE outcome) |
int |
countFalseNegatives(OUTCOME_TYPE... positiveOutcomes) |
int |
countFalsePositives(OUTCOME_TYPE... positiveOutcomes) |
int |
countPredictedOutcomes() |
int |
countPredictedOutcomes(OUTCOME_TYPE outcome) |
int |
countReferenceOutcomes() |
int |
countReferenceOutcomes(OUTCOME_TYPE outcome) |
int |
countTrueNegatives(OUTCOME_TYPE... positiveOutcomes) |
int |
countTruePositives(OUTCOME_TYPE... positiveOutcomes) |
double |
f(double beta) |
double |
f(double beta,
OUTCOME_TYPE outcome) |
double |
f1() |
double |
f1(OUTCOME_TYPE outcome) |
double |
precision() |
double |
precision(OUTCOME_TYPE outcome) |
double |
recall() |
double |
recall(OUTCOME_TYPE outcome) |
String |
toString() |
public AnnotationStatistics()
Annotations based on their begin and end
offsets, plus a Feature of the Annotation that represents the outcome or label.public <ANNOTATION_TYPE extends Annotation> void add(Collection<? extends ANNOTATION_TYPE> referenceAnnotations, Collection<? extends ANNOTATION_TYPE> predictedAnnotations)
confusions()) will be null.referenceAnnotations - The reference annotations, typically identified by humans.predictedAnnotations - The predicted annotations, typically identified by a model.public <ANNOTATION_TYPE,SPAN_TYPE> void add(Collection<? extends ANNOTATION_TYPE> referenceAnnotations, Collection<? extends ANNOTATION_TYPE> predictedAnnotations, Function<ANNOTATION_TYPE,SPAN_TYPE> annotationToSpan, Function<ANNOTATION_TYPE,OUTCOME_TYPE> annotationToOutcome)
annotationToSpan) and if they have the same outcome (according to
annotationToOutcome).referenceAnnotations - The reference annotations, typically identified by humans.predictedAnnotations - The predicted annotations, typically identified by a model.annotationToSpan - A function that defines how to convert an annotation into a hashable object that
represents the span of that annotation. The annotationToSpan() method
provides an example function that could be used here.annotationToOutcome - A function that defines how to convert an annotation into an object that represents
the outcome (or "label") assigned to that annotation. The
annotationToFeatureValue(String) method provides a sample function that could
be used here.public void addAll(AnnotationStatistics<OUTCOME_TYPE> that)
that - The other statistics that should be added to this one.public static <OUTCOME_TYPE extends Comparable<? super OUTCOME_TYPE>> AnnotationStatistics<OUTCOME_TYPE> addAll(Iterable<AnnotationStatistics<OUTCOME_TYPE>> statistics)
Evaluation_ImplBase.crossValidation(List, int).statistics - The sequence of statistics that should be combined.public static <ANNOTATION_TYPE extends TOP> Function<ANNOTATION_TYPE,String> annotationToFeatureValue(String featureName)
Function that extracts a feature value from a TOP.
The Function created by this method is suitable for passing to the second
Function argument of add(Collection, Collection, Function, Function).featureName - The name of the feature whose value is to be extracted.public static <ANNOTATION_TYPE,OUTCOME_TYPE> Function<ANNOTATION_TYPE,OUTCOME_TYPE> annotationToNull()
Function that always returns null.
This may be useful when only the span of the offset is important, but you still need to pass in
the final argument of add(Collection, Collection, Function, Function).public static <ANNOTATION_TYPE extends Annotation> Function<ANNOTATION_TYPE,org.cleartk.eval.AnnotationStatistics.Span> annotationToSpan()
Function that converts an Annotation into a hashable representation
of its begin and end offsets.
The Function created by this method is suitable for passing to the first
Function argument of add(Collection, Collection, Function, Function).public ConfusionMatrix<OUTCOME_TYPE> confusions()
ConfusionMatrix tabulating reference outcomes matched to predicted
outcomes.public int countCorrectOutcomes()
public int countCorrectOutcomes(OUTCOME_TYPE outcome)
public int countFalseNegatives(OUTCOME_TYPE... positiveOutcomes)
public int countFalsePositives(OUTCOME_TYPE... positiveOutcomes)
public int countPredictedOutcomes()
public int countPredictedOutcomes(OUTCOME_TYPE outcome)
public int countReferenceOutcomes()
public int countReferenceOutcomes(OUTCOME_TYPE outcome)
public int countTrueNegatives(OUTCOME_TYPE... positiveOutcomes)
public int countTruePositives(OUTCOME_TYPE... positiveOutcomes)
public double f(double beta)
public double f(double beta, OUTCOME_TYPE outcome)
public double f1()
public double f1(OUTCOME_TYPE outcome)
public double precision()
public double precision(OUTCOME_TYPE outcome)
public double recall()
public double recall(OUTCOME_TYPE outcome)
Copyright © 2014. All rights reserved.