public class SegmentationEvaluation extends AnnotatorEvaluation
AnnotatorEvaluation.Measure| Modifier and Type | Field and Description |
|---|---|
protected double |
countExp |
protected double |
countPred |
protected double |
DEFAULT_SCORE |
protected boolean |
enableKPerDocument
whether to recalculate the value of K for each document in the evaluation
|
protected boolean |
enableMergeSections
whether to merge adjacent sections with same label into one (in both GOLD and PRED)
|
protected double |
pksum |
protected double |
wdsum |
countAnnotations, countDocs, countExamples, countSentences, countTokens, expectedSource, experimentName, log, predictedSource| Constructor and Description |
|---|
SegmentationEvaluation(String experimentName) |
SegmentationEvaluation(String experimentName,
Annotation.Source expected,
Annotation.Source predicted) |
| Modifier and Type | Method and Description |
|---|---|
int |
calculateK(Collection<Document> docs) |
int |
calculateK(Document doc) |
double |
calculatePk(Document doc,
int k)
Calculate Pk metric.
|
void |
calculateScores(Collection<Document> docs) |
void |
calculateScoresFromAnnotations(Collection<Document> docs,
Class<? extends Annotation> annotationClass) |
double |
calculateWD(Document doc,
int k)
Calculate WD metric.
|
protected void |
clear() |
double |
getCountExpected() |
double |
getCountPredicted() |
int[] |
getMassesArray(Document doc,
Annotation.Source source) |
double |
getMeanSegmentLength(Collection<Document> docs) |
double |
getPk() |
int[] |
getPositionsArray(Document doc,
Annotation.Source source) |
double |
getScore() |
double |
getWD() |
SegmentationEvaluation |
withMergeEnabled(boolean enabled)
Enable/disable merging adjacent sections with same label into one (in both GOLD and PRED).
|
SegmentationEvaluation |
withRecalculateK(boolean enabled)
Enable/disable recalculation of K for each document in the evaluation.
|
calculateScores, countAnnotations, countDocuments, countExamples, countSentences, countTokens, div, fDbl, fInt, fStr, printEvaluationStatsprotected final double DEFAULT_SCORE
protected double countExp
protected double countPred
protected double pksum
protected double wdsum
protected boolean enableKPerDocument
protected boolean enableMergeSections
public SegmentationEvaluation(String experimentName)
public SegmentationEvaluation(String experimentName, Annotation.Source expected, Annotation.Source predicted)
public SegmentationEvaluation withRecalculateK(boolean enabled)
public SegmentationEvaluation withMergeEnabled(boolean enabled)
protected void clear()
public double getScore()
getScore in class AnnotatorEvaluationpublic void calculateScores(Collection<Document> docs)
calculateScores in class AnnotatorEvaluationpublic void calculateScoresFromAnnotations(Collection<Document> docs, Class<? extends Annotation> annotationClass)
public double getWD()
public double getPk()
public double getCountExpected()
public double getCountPredicted()
public double calculatePk(Document doc, int k)
public double calculateWD(Document doc, int k)
public int calculateK(Collection<Document> docs)
public int calculateK(Document doc)
public double getMeanSegmentLength(Collection<Document> docs)
public int[] getMassesArray(Document doc, Annotation.Source source)
public int[] getPositionsArray(Document doc, Annotation.Source source)
Copyright © 2019. All rights reserved.