(self, target_text, prediction_text)
return {"bleu": BleuScore(bleu_score.score)}
Calculates bleu scores between target and prediction text.
Calculates bleu scores between target and prediction text.
Calculates bleu scores between target and prediction text .
def score(self, target_text, prediction_text):
    """Calculates bleu scores between target and prediction text."""
    bleu_score = sacrebleu.corpus_bleu([prediction_text], [[target_text]],
                                       smooth_method="exp",
                                       smooth_value=0.0,
                                       force=False,
                                       lowercase=False,
                                       tokenize="intl",
                                       use_effective_order=False)
    return {"bleu": BleuScore(bleu_score.score)}
def score ( self , target_text , prediction_text ) : bleu_score = sacrebleu . corpus_bleu ( [ prediction_text ] , [ [ target_text ] ] , smooth_method = "exp" , smooth_value = 0.0 , force = False , lowercase = False , tokenize = "intl" , use_effective_order = False ) return { "bleu" : BleuScore ( bleu_score . score ) }