BleuScorer

class BleuScorer

Provides BLEU score for a model prediction.

__init__

def __init__(tokens_to_ignore, weights)

Initializes the scorer.

Args
  • tokens_to_ignore: Tokens to be removed before comparing input and output text.

  • weights: Custom weights for 1,2,3,4 grams, e.g. (1, 0, 0, 0) will only measure 1-gram overlaps.

__call__

def __call__(prediction)