brian920128 commited on
Commit
d38c9a3
1 Parent(s): 36ed57b
Files changed (1) hide show
  1. doc_retrieve_metrics.py +2 -2
doc_retrieve_metrics.py CHANGED
@@ -71,7 +71,7 @@ def calculate_precision(
71
  hits += 1
72
 
73
  if len(predicted_titles) != 0:
74
- precision += len(hits) / len(predicted_titles)
75
 
76
  count += 1
77
 
@@ -94,7 +94,7 @@ def calculate_recall(
94
  for title in predicted_titles:
95
  if title in d:
96
  hits += 1
97
- recall += len(hits) / len(d)
98
 
99
  count += 1
100
 
 
71
  hits += 1
72
 
73
  if len(predicted_titles) != 0:
74
+ precision += hits / len(predicted_titles)
75
 
76
  count += 1
77
 
 
94
  for title in predicted_titles:
95
  if title in d:
96
  hits += 1
97
+ recall += hits / len(d)
98
 
99
  count += 1
100