neuralmonkey.evaluators.f1_bio module

class neuralmonkey.evaluators.f1_bio.F1Evaluator(name: str = None) → None

Bases: neuralmonkey.evaluators.evaluator.Evaluator

F1 evaluator for BIO tagging, e.g. NP chunking.

The entities are annotated as beginning of the entity (B), continuation of the entity (I), the rest is outside the entity (O).

static chunk2set() → Set[str]
score_instance(hypothesis: List[str], reference: List[str]) → float

Score a single hyp/ref pair.

The default implementation of this method returns 1.0 when the hypothesis and the reference are equal and 0.0 otherwise.

  • hypothesis – The model prediction.
  • reference – The golden output.

A float.