class_docstr: An accumulator object capable of computing BLEU score using multiple references.
  The BLEU score is always smoothed a bit so that it's never undefined. For sentence-level
  measurements, proper smoothing should be used via the smoothing parameter (set to 1.0 for
  the same behavior as default Moses's MERT sentence BLEU).
docstr: Compute clipped n-gram hits for the given sentences and the given N
  @param n: n-gram 'N' (1 for unigrams, 2 for bigrams etc.)
  @param pred_sent: the system output sentence (tree/tokens)
  @param ref_sents: the corresponding reference sentences (list/tuple of trees/tokens)
docstr_tok: ["Compute","clipped","n-gram","hits","for","the","given","sentences","and","the","given","N","@","param","n",":","n-gram","'N","'","(","1","for","unigrams",",","2","for","bigrams","etc",".",")","@","param","pred_sent",":","the","system","output","sentence","(","tree\/tokens",")","@","param","ref_sents",":","the","corresponding","reference","sentences","(","list\/tuple","of","trees\/tokens",")"]
code: def compute_hits(self, n, pred_sent, ref_sents):
      """Compute clipped n-gram hits for the given sentences and the given N
      @param n: n-gram 'N' (1 for unigrams, 2 for bigrams etc.)
      @param pred_sent: the system output sentence (tree/tokens)
      @param ref_sents: the corresponding reference sentences (list/tuple of trees/tokens)
      """
      merged_ref_ngrams = self.get_ngram_counts(n, ref_sents)
      pred_ngrams = self.get_ngram_counts(n, [pred_sent])
  
      hits = 0
      for ngram, cnt in pred_ngrams.items():
          hits += min(merged_ref_ngrams.get(ngram, 0), cnt)
  
      return hits
  
imports: from __future__ import unicode_literals
  from __future__ import division
  from builtins import zip
  from builtins import range
  from past.utils import old_div
  from builtins import object
  from collections import defaultdict
  import math
  import re
label_desc: Use image node_id 5 for calling the BLEUScore obj's underlying member method code with example usage: obj.compute_hits(n, pred_sent, ref_sents) and returns: hits