Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -49,7 +49,7 @@ def get_luar_embeddings(texts_batch):
|
|
49 |
def compute_mis(texts, target_texts_batch):
|
50 |
a_texts = list(itertools.chain.from_iterable([[t] * len(target_texts) for t, target_texts in zip(texts, target_texts_batch)]))
|
51 |
b_texts = list(itertools.chain.from_iterable(target_texts_batch))
|
52 |
-
scores =
|
53 |
for idx, (score, a_text, b_text) in enumerate(zip(scores, a_texts, b_texts)):
|
54 |
if a_text == b_text:
|
55 |
scores[idx] = 1.0
|
|
|
49 |
def compute_mis(texts, target_texts_batch):
|
50 |
a_texts = list(itertools.chain.from_iterable([[t] * len(target_texts) for t, target_texts in zip(texts, target_texts_batch)]))
|
51 |
b_texts = list(itertools.chain.from_iterable(target_texts_batch))
|
52 |
+
scores = mis_model.compute(a_texts, b_texts, batch_size=len(a_texts))
|
53 |
for idx, (score, a_text, b_text) in enumerate(zip(scores, a_texts, b_texts)):
|
54 |
if a_text == b_text:
|
55 |
scores[idx] = 1.0
|