Scorer

class opennmt.utils.Scorer(name)[source]

Scores hypotheses against references.

Inherits from: abc.ABC

Extended by:

property name

The scorer name.

property scores_name

The names of returned scores.

abstract __call__(ref_path, hyp_path)[source]

Scores hypotheses.

Parameters
  • ref_path – Path to the reference.

  • hyp_path – Path to the hypotheses.

Returns

The score or dictionary of scores.

lower_is_better()[source]

Returns True if a lower score is better.

higher_is_better()[source]

Returns True if a higher score is better.