mirror of
https://github.com/hiyouga/LLaMA-Factory.git
synced 2025-08-22 22:02:51 +08:00
fix rouge score
Former-commit-id: caa00d3ac24c989d56887af9d7ca79244e72714a
This commit is contained in:
parent
28c1381671
commit
50a27509a3
@ -46,7 +46,7 @@ class ComputeMetrics:
|
||||
hypothesis = list(jieba.cut(pred))
|
||||
reference = list(jieba.cut(label))
|
||||
|
||||
if len(" ".join(hypothesis).split()) == 0:
|
||||
if len(" ".join(hypothesis).split()) == 0 or len(" ".join(reference).split()) == 0:
|
||||
result = {"rouge-1": {"f": 0.0}, "rouge-2": {"f": 0.0}, "rouge-l": {"f": 0.0}}
|
||||
else:
|
||||
rouge = Rouge()
|
||||
|
Loading…
x
Reference in New Issue
Block a user