Spaces:
Sleeping
Sleeping
Unpack average result
Browse files- sbert_cosine.py +3 -3
sbert_cosine.py
CHANGED
@@ -128,11 +128,11 @@ class sbert_cosine(evaluate.Metric):
|
|
128 |
res = cosine(embeds[0, :], embeds[1, :]).item()
|
129 |
return res
|
130 |
|
131 |
-
avg = lambda x: sum(x) / len(x)
|
132 |
|
133 |
with torch.no_grad():
|
134 |
-
|
135 |
|
136 |
return {
|
137 |
-
"score":
|
138 |
}
|
|
|
128 |
res = cosine(embeds[0, :], embeds[1, :]).item()
|
129 |
return res
|
130 |
|
131 |
+
# avg = lambda x: sum(x) / len(x)
|
132 |
|
133 |
with torch.no_grad():
|
134 |
+
scores = [calculate(pred, ref) for pred, ref in zip(predictions, references]
|
135 |
|
136 |
return {
|
137 |
+
"score": scores,
|
138 |
}
|