geek-ai / Texygen

A text generation benchmarking platform
MIT License
863 stars 203 forks source link

How to use Bleu? #49

Open xuefeng199507 opened 3 years ago

xuefeng199507 commented 3 years ago

In the Bleu function,What does test_text and real_text mean? Does test_text refer to 'save/test_file.txt'? And what does real_text refer to?' save/oracle.txt' or 'save/generator.txt'? Thanks!

tangshu-yu commented 4 months ago

from utils.metrics.Bleu import Bleu

if name == 'main': bleu_metric = Bleu(test_text=r'/docs/instances/seq.txt', real_text=r'data/image_coco.txt', gram=2) score = bleu_metric.get_score(is_fast=False, ignore=False) print(f"BLEU Score: {score}")