Spaces:
Runtime error
Runtime error
Commit
·
ec79cc9
1
Parent(s):
e70027f
fix formula
Browse files- app.py +1 -1
- doc_retrieve_metrics.py +1 -1
app.py
CHANGED
|
@@ -5,6 +5,6 @@ from evaluate.utils import launch_gradio_widget
|
|
| 5 |
module = evaluate.load("brian920128/doc_retrieve_metrics")
|
| 6 |
|
| 7 |
|
| 8 |
-
result = module.compute(references=[["e", ""]], predictions=[["e", ]])
|
| 9 |
print(result)
|
| 10 |
#launch_gradio_widget(module)
|
|
|
|
| 5 |
module = evaluate.load("brian920128/doc_retrieve_metrics")
|
| 6 |
|
| 7 |
|
| 8 |
+
result = module.compute(references=[["e", ""]], predictions=[["e", "", "ccc"]])
|
| 9 |
print(result)
|
| 10 |
#launch_gradio_widget(module)
|
doc_retrieve_metrics.py
CHANGED
|
@@ -136,7 +136,7 @@ class DocRetrieveMetrics(evaluate.Metric):
|
|
| 136 |
def _compute(self, predictions, references):
|
| 137 |
recall = calculate_recall(predictions, references)
|
| 138 |
precision = calculate_precision(predictions, references)
|
| 139 |
-
f_score = (1 + beta*beta) * precision * recall / (beta * beta
|
| 140 |
return {
|
| 141 |
"f1": float(
|
| 142 |
f_score
|
|
|
|
| 136 |
def _compute(self, predictions, references):
|
| 137 |
recall = calculate_recall(predictions, references)
|
| 138 |
precision = calculate_precision(predictions, references)
|
| 139 |
+
f_score = (1 + beta*beta) * precision * recall / (beta * beta*precision + recall)
|
| 140 |
return {
|
| 141 |
"f1": float(
|
| 142 |
f_score
|