(self, gts, res)
return score, scores
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 (float) : computed CIDEr score for the corpus
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 (float) : computed CIDEr score for the corpus
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 ( float ) : computed CIDEr score for the corpus
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 (float) : computed CIDEr score for the corpus
        """

        cider_scorer = CiderScorer(n=self._n, sigma=self._sigma)

        for id in sorted(gts.keys()):
            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()

        return score, scores
def compute_score ( self , gts , res ) : cider_scorer = CiderScorer ( n = self . _n , sigma = self . _sigma ) for id in sorted ( gts . keys ( ) ) : 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 ( ) return score , scores