transZ commited on
Commit
18229bd
·
1 Parent(s): 03539db

Unpack average result

Browse files
Files changed (1) hide show
  1. 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
- score = avg([calculate(pred, ref) for pred, ref in zip(predictions, references)])
135
 
136
  return {
137
- "score": 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
  }