(myconda) root@cebf7236c869:~# python /tmp/bishe/eval.py --task=validate --start_from=0005000.tar
2021-05-13 01:43:28,991 - datautil.log - INFO - log鍚姩
/tmp/bishe/data/chunked/valid/valid*
2021-05-13 01:43:31,420 - data_util.log - INFO -
Traceback (most recent call last):
File "/tmp/bishe/eval.py", line 168, in
eval_processor.evaluate_batch(False)
File "/tmp/bishe/eval.py", line 102, in evaluate_batch
rouge_1 = sum([x["rouge-1"]["f"] for x in scores]) / len(scores)
ZeroDivisionError: division by zero
代码:
if article:
self.print_original_predicted(decoded_sents, ref_sents,
article_sents, load_file)
scores = rouge.get_scores(decoded_sents, ref_sents)
rouge_1 = sum([x["rouge-1"]["f"] for x in scores]) / len(scores)
rouge_2 = sum([x["rouge-2"]["f"] for x in scores]) / len(scores)
rouge_l = sum([x["rouge-l"]["f"] for x in scores]) / len(scores)
logger.info(load_file + " rouge_1:" + "%.4f" % rouge_1 + " rouge_2:" + "%.4f" % rouge_2 + " rouge_l:" + "%.4f" % rouge_l)
(myconda) root@cebf7236c869:~# python /tmp/bishe/eval.py --task=validate --start_from=0005000.tar 2021-05-13 01:43:28,991 - datautil.log - INFO - log鍚姩 /tmp/bishe/data/chunked/valid/valid* 2021-05-13 01:43:31,420 - data_util.log - INFO - Traceback (most recent call last): File "/tmp/bishe/eval.py", line 168, in
eval_processor.evaluate_batch(False)
File "/tmp/bishe/eval.py", line 102, in evaluate_batch
rouge_1 = sum([x["rouge-1"]["f"] for x in scores]) / len(scores)
ZeroDivisionError: division by zero
代码:
if article:
self.print_original_predicted(decoded_sents, ref_sents,
article_sents, load_file)