asahi417 commited on
Commit
217ce82
1 Parent(s): 0f4008e
Files changed (1) hide show
  1. app.py +4 -2
app.py CHANGED
@@ -64,8 +64,10 @@ def greet(
64
  sims = []
65
  for v in vectors:
66
  sims.append(cosine_similarity(v, vector_q))
67
- output = sorted(list(zip(pairs_id, sims, pairs)), key=lambda _x: _x[1], reverse=True)
68
- output = {f'candidate {n + 1}: [{p[0]}, {p[1]}]': s for n, (i, s, p) in enumerate(output)}
 
 
69
  return output
70
 
71
 
 
64
  sims = []
65
  for v in vectors:
66
  sims.append(cosine_similarity(v, vector_q))
67
+ # output = list(zip(pairs_id, sims, pairs))
68
+ # output = sorted(list(zip(pairs_id, sims, pairs)), key=lambda _x: _x[1], reverse=True)
69
+ # output = {f'candidate {i}: [{p[0]}, {p[1]}]': s for n, (i, s, p) in enumerate(output)}
70
+ output = {f'candidate {i}: [{p[0]}, {p[1]}]': s for i, s, p in zip(pairs_id, sims, pairs)}
71
  return output
72
 
73