Search in sources :

Example 1 with B3Evaluator

use of edu.stanford.nlp.coref.statistical.EvalUtils.B3Evaluator in project CoreNLP by stanfordnlp.

the class Clusterer method evaluatePolicy.

private double evaluatePolicy(List<ClustererDoc> docs, boolean training) {
    isTraining = 0;
    B3Evaluator evaluator = new B3Evaluator();
    for (ClustererDoc doc : docs) {
        State currentState = new State(doc);
        while (!currentState.isComplete()) {
            currentState.doBestAction(classifier);
        }
        currentState.updateEvaluator(evaluator);
    }
    isTraining = 1;
    double score = evaluator.getF1();
    Redwood.log("scoref.train", String.format("B3 F1 score on %s: %.4f", training ? "train" : "validate", score));
    return score;
}
Also used : ClustererDoc(edu.stanford.nlp.coref.statistical.ClustererDataLoader.ClustererDoc) B3Evaluator(edu.stanford.nlp.coref.statistical.EvalUtils.B3Evaluator)

Aggregations

ClustererDoc (edu.stanford.nlp.coref.statistical.ClustererDataLoader.ClustererDoc)1 B3Evaluator (edu.stanford.nlp.coref.statistical.EvalUtils.B3Evaluator)1