Spaces:
Runtime error
Runtime error
Waits for the input first
Browse files
app.py
CHANGED
@@ -35,10 +35,12 @@ def get_model():
|
|
35 |
|
36 |
model = get_model()
|
37 |
|
38 |
-
#
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
st.
|
|
|
|
|
|
35 |
|
36 |
model = get_model()
|
37 |
|
38 |
+
if paper_you_like: # if its not NONE
|
39 |
+
# Calculating the similarity between titles
|
40 |
+
cosine_scores = util.cos_sim(embeddings, model.encode(paper_you_like))
|
41 |
+
top_similar_papers = torch.topk(cosine_scores,dim=0, k=5,sorted=True)
|
42 |
+
# top_similar_papers
|
43 |
+
|
44 |
+
st.subheader('Recommended Papers are :scroll: ')
|
45 |
+
for i in top_similar_papers.indices:
|
46 |
+
st.write(sentences[i.item()])
|