Spaces:
Runtime error
Runtime error
nltk error addressed
Browse files
app.py
CHANGED
@@ -3,6 +3,8 @@ import os
|
|
3 |
from transformers import AutoTokenizer, AutoModel
|
4 |
from sentence_transformers import SentenceTransformer
|
5 |
import pickle
|
|
|
|
|
6 |
|
7 |
from input_format import *
|
8 |
from score import *
|
@@ -193,4 +195,4 @@ with gr.Blocks() as demo:
|
|
193 |
)
|
194 |
|
195 |
if __name__ == "__main__":
|
196 |
-
demo.launch()
|
|
|
3 |
from transformers import AutoTokenizer, AutoModel
|
4 |
from sentence_transformers import SentenceTransformer
|
5 |
import pickle
|
6 |
+
import nltk
|
7 |
+
nltk.download('punkt')
|
8 |
|
9 |
from input_format import *
|
10 |
from score import *
|
|
|
195 |
)
|
196 |
|
197 |
if __name__ == "__main__":
|
198 |
+
demo.launch()
|
score.py
CHANGED
@@ -146,4 +146,4 @@ def compute_overall_score(doc_model, tokenizer, query, papers, batch=5):
|
|
146 |
abstracts_sorted = [abstracts[x] for x in idx_sorted]
|
147 |
scores_sorted = [scores[x] for x in idx_sorted]
|
148 |
|
149 |
-
return titles_sorted, abstracts_sorted, scores_sorted
|
|
|
146 |
abstracts_sorted = [abstracts[x] for x in idx_sorted]
|
147 |
scores_sorted = [scores[x] for x in idx_sorted]
|
148 |
|
149 |
+
return titles_sorted, abstracts_sorted, scores_sorted
|