public class MentionAnnotatorEvaluation extends AnnotatorEvaluation
AnnotatorEvaluation.Measure| Modifier and Type | Field and Description |
|---|---|
protected TreeMap<AnnotatorEvaluation.Measure,org.nd4j.linalg.primitives.Counter<Integer>> |
counts |
protected static org.slf4j.Logger |
log |
countAnnotations, countDocs, countExamples, countSentences, countTokens, expectedSource, experimentName, predictedSource| Constructor and Description |
|---|
MentionAnnotatorEvaluation(String experimentName,
Annotation.Match matchingStrategy) |
MentionAnnotatorEvaluation(String experimentName,
Annotation.Source expected,
Annotation.Source predicted,
Annotation.Match matchingStrategy) |
| Modifier and Type | Method and Description |
|---|---|
void |
calculateScores(Collection<Document> docs) |
void |
calculateScores(Dataset dataset) |
void |
calculateScoresFromAnnotations(Collection<Document> docs,
Class<? extends Annotation> annotationClass) |
protected void |
clear() |
protected double |
div(double n,
double d)
safe division, where n/0 = 0
|
protected void |
fixCounters()
required to update totalCount() - fixed in next Nd4j https://github.com/deeplearning4j/nd4j/commit/2698b2e23d8ccf6cf71c3bf6fc325e9638877ae8
|
double |
getAccuracy()
Micro/Macro Accuracy
|
protected double |
getAccuracy(int c)
Accuracy per class
|
protected double |
getCount(AnnotatorEvaluation.Measure m,
int classIdx) |
protected double |
getF1(int i)
F1 score per document
|
double |
getFN() |
double |
getFN(Document d,
Class<? extends Annotation> annotationClass) |
double |
getFP() |
double |
getFP(Document d,
Class<? extends Annotation> annotationClass) |
double |
getMacroF1()
Macro F1 score (average F1 over all classes).
|
double |
getMacroPrecision()
Macro Precision (average Precision over all classes).
|
double |
getMacroRecall()
Macro Recall (average recall over all classes).
|
double |
getMicroF1()
Micro F1 score (average F1 over all examples).
|
double |
getMicroPrecision()
Micro Precision (average precision over all examples).
|
double |
getMicroRecall()
Micro Recall (average recall over all examples).
|
protected double |
getPrecision(int c)
Precision per class
|
protected double |
getRecall(int c)
Recall per class
|
double |
getScore() |
double |
getTN() |
double |
getTN(Document d,
Class<? extends Annotation> annotationClass) |
double |
getTokenAccuracy(Dataset data)
This is CoNLL2003 Accuracy
|
double |
getTP() |
double |
getTP(Document d,
Class<? extends Annotation> annotationClass) |
String |
printAnnotationStats() |
static String |
printHeader() |
String |
printRow() |
countAnnotations, countDocuments, countExamples, countSentences, countTokens, fDbl, fDbl4, fInt, fStr, printEvaluationStatsprotected static org.slf4j.Logger log
protected TreeMap<AnnotatorEvaluation.Measure,org.nd4j.linalg.primitives.Counter<Integer>> counts
public MentionAnnotatorEvaluation(String experimentName, Annotation.Match matchingStrategy)
public MentionAnnotatorEvaluation(String experimentName, Annotation.Source expected, Annotation.Source predicted, Annotation.Match matchingStrategy)
protected void clear()
protected double getCount(AnnotatorEvaluation.Measure m, int classIdx)
public double getScore()
getScore in class AnnotatorEvaluationpublic void calculateScores(Dataset dataset)
calculateScores in class AnnotatorEvaluationpublic void calculateScores(Collection<Document> docs)
calculateScores in class AnnotatorEvaluationpublic void calculateScoresFromAnnotations(Collection<Document> docs, Class<? extends Annotation> annotationClass)
protected void fixCounters()
public double getTP(Document d, Class<? extends Annotation> annotationClass)
public double getFP(Document d, Class<? extends Annotation> annotationClass)
public double getTN(Document d, Class<? extends Annotation> annotationClass)
public double getFN(Document d, Class<? extends Annotation> annotationClass)
public double getTP()
public double getFP()
public double getTN()
public double getFN()
protected double div(double n,
double d)
div in class AnnotatorEvaluationpublic double getTokenAccuracy(Dataset data)
data - public double getAccuracy()
protected double getAccuracy(int c)
c - - class indexpublic double getMicroPrecision()
public double getMacroPrecision()
protected double getPrecision(int c)
c - - class indexpublic double getMicroRecall()
public double getMacroRecall()
protected double getRecall(int c)
c - - class indexpublic double getMicroF1()
public double getMacroF1()
protected double getF1(int i)
i - - document indexpublic String printAnnotationStats()
public static String printHeader()
public String printRow()
Copyright © 2020. All rights reserved.