class_docstr: Main Class to compute the CIDEr metric
class_docstr_tok: ["Main","Class","to","compute","the","CIDEr","metric"]
docstr: Main function to compute CIDEr score
  :param  hypo_for_image (dict) : dictionary with key <image> and value                     <tokenized hypothesis / candidate sentence>
          ref_for_image (dict)  : dictionary with key <image> and value                     <tokenized reference sentence>
  :return: cider_tool (float) : computed CIDEr score for the corpus
docstr_tok: ["Main","function","to","compute","CIDEr","score",":","param","hypo_for_image","(","dict",")",":","dictionary","with","key","<","image",">","and","value","<","tokenized","hypothesis","\/","candidate","sentence",">","ref_for_image","(","dict",")",":","dictionary","with","key","<","image",">","and","value","<","tokenized","reference","sentence",">",":","return",":","cider_tool","(","float",")",":","computed","CIDEr","score","for","the","corpus"]
code: def compute_score(self, gts, res):
      """
          Main function to compute CIDEr score
          :param  hypo_for_image (dict) : dictionary with key <image> and value \
                      <tokenized hypothesis / candidate sentence>
                  ref_for_image (dict)  : dictionary with key <image> and value \
                      <tokenized reference sentence>
          :return: cider_tool (float) : computed CIDEr score for the corpus
          """
      assert gts.keys() == res.keys()
      imgIds = gts.keys()
  
      cider_scorer = CiderScorer(n=self._n, sigma=self._sigma)
  
      for id in imgIds:
          hypo = res[id]
          ref = gts[id]
  
          # Sanity check.
          assert type(hypo) is list
          assert len(hypo) == 1
          assert type(ref) is list
          assert len(ref) > 0
  
          cider_scorer += (hypo[0], ref)
  
      (score, scores) = cider_scorer.compute_score(self._dfMode)
      return score, scores
  
imports: from .cider_scorer import CiderScorer
label_desc: Use image node_id 2 for calling the Cider obj's underlying member method code with example usage: obj.compute_score(gts, res) and returns: score,  scores