Package opennlp.tools.util.eval
Klasse FMeasure
java.lang.Object
opennlp.tools.util.eval.FMeasure
The
FMeasure
is a utility class for evaluators
which measures precision, recall and the resulting f-measure.
Evaluation results are the arithmetic mean of the precision scores calculated for each reference sample and the arithmetic mean of the recall scores calculated for each reference sample.
-
Konstruktorübersicht
Konstruktoren -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungdouble
f-measure = 2 * precision * recall / (precision + recall)
.double
double
void
Merge results intometric
.static double
Calculates the precision score for the given reference and predicted spans.static double
Calculates the recall score for the given reference and predicted spans.toString()
void
updateScores
(Object[] references, Object[] predictions) Updates the score based on the number of true positives and the number of predictions and references.
-
Konstruktordetails
-
FMeasure
public FMeasure()
-
-
Methodendetails
-
getPrecisionScore
public double getPrecisionScore()- Gibt zurück:
- Retrieves the arithmetic mean of the precision scores calculated for each evaluated sample.
-
getRecallScore
public double getRecallScore()- Gibt zurück:
- Retrieves the arithmetic mean of the recall score calculated for each evaluated sample.
-
getFMeasure
public double getFMeasure()f-measure = 2 * precision * recall / (precision + recall)
.- Gibt zurück:
- Retrieves the f-measure or
-1
if precision + recall<= 0
-
updateScores
Updates the score based on the number of true positives and the number of predictions and references.- Parameter:
references
- the provided referencespredictions
- the predicted spans
-
mergeInto
Merge results intometric
.- Parameter:
measure
- TheFMeasure
to merge.
-
toString
-
precision
Calculates the precision score for the given reference and predicted spans.- Parameter:
references
- The gold standard spans.predictions
- The predicted spans.- Gibt zurück:
- The precision score or
NaN
if there are no predicted spans.
-
recall
Calculates the recall score for the given reference and predicted spans.- Parameter:
references
- The gold standard spanspredictions
- The predicted spans- Gibt zurück:
- The recall score or
NaN
if there are no reference spans.
-