# Path: pycocoevalcap/bleu/bleu.py
# class Bleu:
#     def __init__(self, n=4):
#     def compute_score(self, gts, res):
#     def method(self):
# 
# Path: pycocoevalcap/cider/cider.py
# class Cider:
#     def __init__(self, test=None, refs=None, n=4, sigma=6.0):
#     def compute_score(self, gts, res):
#     def method(self):
# 
# Path: pycocoevalcap/meteor/meteor.py
# METEOR_JAR = 'meteor-1.5.jar'
# class Meteor:
#     def __init__(self):
#     def compute_score(self, gts, res):
#     def method(self):
#     def _stat(self, hypothesis_str, reference_list):
#     def _score(self, hypothesis_str, reference_list):
#     def __del__(self):
# 
# Path: pycocoevalcap/rouge/rouge.py
# def my_lcs(string, sub):
#     def __init__(self):
#     def calc_score(self, candidate, refs):
#     def compute_score(self, gts, res):
#     def method(self):
# class Rouge():


import os
import tensorflow as tf
from pycocoevalcap.bleu import bleu
from pycocoevalcap.cider import cider
from pycocoevalcap.meteor import meteor
from pycocoevalcap.rouge import rouge
    def calculate(self, id_to_prediction, id_to_references):
        name_to_score = super(BLEU, self).calculate(id_to_prediction,
                                                    id_to_references)
        scores = name_to_score.values()[0]
        result = {}
        for i, score in enumerate(scores, start=1):
            name = '{}_{}'.format(self._score_name, i)
            result[name] = score
        return result


class CIDEr(Score):
    def __init__(self):
        implementation = cider.Cider()
        super(CIDEr, self).__init__('cider', implementation)


class METEOR(Score):
    def __init__(self):
        implementation = meteor.Meteor()
        super(METEOR, self).__init__('meteor', implementation)

    def calculate(self, id_to_prediction, id_to_references):
        if self._data_downloaded():
            return super(METEOR, self).calculate(id_to_prediction,
                                                 id_to_references)
        else:
            return {self._score_name: 0.0}

    def _data_downloaded(self):

# Path: pycocoevalcap/bleu/bleu.py
# class Bleu:
#     def __init__(self, n=4):
#     def compute_score(self, gts, res):
#     def method(self):
# 
# Path: pycocoevalcap/cider/cider.py
# class Cider:
#     def __init__(self, test=None, refs=None, n=4, sigma=6.0):
#     def compute_score(self, gts, res):
#     def method(self):
# 
# Path: pycocoevalcap/meteor/meteor.py
# METEOR_JAR = 'meteor-1.5.jar'
# class Meteor:
#     def __init__(self):
#     def compute_score(self, gts, res):
#     def method(self):
#     def _stat(self, hypothesis_str, reference_list):
#     def _score(self, hypothesis_str, reference_list):
#     def __del__(self):
# 
# Path: pycocoevalcap/rouge/rouge.py
# def my_lcs(string, sub):
#     def __init__(self):
#     def calc_score(self, candidate, refs):
#     def compute_score(self, gts, res):
#     def method(self):
# class Rouge():


# Path: keras_image_captioning/metrics.py
import os
import tensorflow as tf
from pycocoevalcap.bleu import bleu
from pycocoevalcap.cider import cider
from pycocoevalcap.meteor import meteor
from pycocoevalcap.rouge import rouge

    def calculate(self, id_to_prediction, id_to_references):
        name_to_score = super(BLEU, self).calculate(id_to_prediction,
                                                    id_to_references)
        scores = name_to_score.values()[0]
        result = {}
        for i, score in enumerate(scores, start=1):
            name = '{}_{}'.format(self._score_name, i)
            result[name] = score
        return result


class CIDEr(Score):
    def __init__(self):
        implementation = cider.Cider()
        super(CIDEr, self).__init__('cider', implementation)


class METEOR(Score):
    def __init__(self):
        implementation = meteor.Meteor()
        super(METEOR, self).__init__('meteor', implementation)

    def calculate(self, id_to_prediction, id_to_references):
        if self._data_downloaded():
            return super(METEOR, self).calculate(id_to_prediction,
                                                 id_to_references)
        else:
            return {self._score_name: 0.0}

    def _data_downloaded(self):

        meteor_dir = os.path.dirname(meteor.__file__)