Fixed evaluation

This commit is contained in:
Christian Risi
2025-10-16 20:05:35 +02:00
parent 892f91aad7
commit fe62b1edd5
2 changed files with 6 additions and 5 deletions

View File

@@ -35,7 +35,8 @@ def rouge(ref: list[str], pred: list[str]):
def f1(precision: float, recall: float):
return (2 * recall * precision) / (precision + recall)
divisor = max((precision + recall), 1E-5)
return (2 * recall * precision) / divisor
def average(array: list[float]):