Spaces:
Sleeping
Sleeping
Minor bug fix
Browse files
app.py
CHANGED
@@ -49,13 +49,13 @@ def remove_punctuation(word):
|
|
49 |
|
50 |
def return_top_k(sentence, k=10, word=None, rels=False):
|
51 |
|
52 |
-
|
53 |
-
|
54 |
|
55 |
if rels:
|
56 |
inputs = [f"Description : It is related to '{word}' but not '{word}'. Word : "]
|
57 |
else:
|
58 |
-
inputs = [f"Description : {sentence}
|
59 |
|
60 |
inputs = tokenizer(
|
61 |
inputs,
|
|
|
49 |
|
50 |
def return_top_k(sentence, k=10, word=None, rels=False):
|
51 |
|
52 |
+
if sentence[-1] != ".":
|
53 |
+
sentence = sentence + "."
|
54 |
|
55 |
if rels:
|
56 |
inputs = [f"Description : It is related to '{word}' but not '{word}'. Word : "]
|
57 |
else:
|
58 |
+
inputs = [f"Description : {sentence} Word : "]
|
59 |
|
60 |
inputs = tokenizer(
|
61 |
inputs,
|