class str, name: str = 'BEER', encoding: str = 'utf-8') → None

Bases: neuralmonkey.evaluators.evaluator.Evaluator

Wrapper for BEER scorer.

Paper: Code:

__init__(wrapper: str, name: str = 'BEER', encoding: str = 'utf-8') → None

Initialize the BEER wrapper.

  • name – Name of the evaluator.
  • wrapper – Path to the BEER’s executable.
  • encoding – Data encoding.
score_batch(hypotheses: List[List[str]], references: List[List[str]]) → float

Score a batch of hyp/ref pairs.

The default implementation of this method calls score_instance for each instance in the batch and returns the average score.

  • hypotheses – List of model predictions.
  • references – List of golden outputs.

A float.

serialize_to_bytes(sentences: List[List[str]]) → bytes