mirror of
https://github.com/hiyouga/LLaMA-Factory.git
synced 2025-10-14 23:58:11 +08:00
fix rouge score
Former-commit-id: b84b03a2a5ca72ce0ba71d9a9c3db1a687283fa6
This commit is contained in:
parent
e3b779fcb2
commit
601b1747d1
@ -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