tushifire commited on
Commit
365cc9e
·
1 Parent(s): 1aac8ff

Waits for the input first

Browse files
Files changed (1) hide show
  1. app.py +9 -7
app.py CHANGED
@@ -35,10 +35,12 @@ def get_model():
35
 
36
  model = get_model()
37
 
38
- # Calculating the similarity between titles
39
- cosine_scores = util.cos_sim(embeddings, model.encode(paper_you_like))
40
- top_similar_papers = torch.topk(cosine_scores,dim=0, k=5,sorted=True)
41
- # top_similar_papers
42
-
43
- for i in top_similar_papers.indices:
44
- st.write(sentences[i.item()])
 
 
 
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()])