neuralmonkey.evaluators.ter module¶
-
class
neuralmonkey.evaluators.ter.
TEREvaluator
(name: str = None) → None¶ Bases:
neuralmonkey.evaluators.evaluator.Evaluator
Compute TER using the pyter library.
-
static
compare_scores
(score2: float) → int¶ Compare scores using this evaluator.
The default implementation regards the bigger score as better.
Parameters: - score1 – The first score.
- score2 – The second score.
- Returns
- An int. When score1 is better, returns 1. When score2 is better, returns -1. When the scores are equal, returns 0.
-
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.
Parameters: - hypothesis – The model prediction.
- reference – The golden output.
Returns: A float.
-
static