class_docstr: Provides BLEU score for a model prediction.
docstr: 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.
docstr_tok: ["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","."]
code: def __init__(
      self, tokens_to_ignore=None, weights=(0.25, 0.25, 0.25, 0.25)
  ) -> None:
      """
      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.
      """
      self.tokens_to_exclude = tokens_to_ignore or []
      self.weights = weights
  
imports: from typing import Dict, Union
  import numpy
  from nltk.translate.bleu_score import sentence_bleu
  from headliner.evaluation.scorer import Scorer
label_desc: Use image node_id 1 to create a new BleuScorer object from inherited base classes: Scorer with example: obj = BleuScorer(tokens_to_ignore, weights)