ccm commited on
Commit
ea7e7ec
·
verified ·
1 Parent(s): 4294e86

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +3 -3
main.py CHANGED
@@ -12,7 +12,7 @@ model = sentence_transformers.SentenceTransformer('allenai-specter')
12
 
13
  full_data = datasets.load_dataset("ccm/publications")['train'].to_pandas()
14
 
15
- filter = ["\"abstract\": null" in json.dumps(bibdict) for bibdict in full_data['bibtex'].values]
16
  data = full_data[~pandas.Series(filter)]
17
  data.reset_index(inplace=True)
18
 
@@ -30,8 +30,8 @@ def search(query, k):
30
  search_results = ""
31
 
32
  for i in range(k):
33
- search_results += '### ' + top_five["bibtex"].values[i]["title"] + '\n'
34
- search_results += top_five["bibtex"].values[i]["citation"]
35
  if top_five["pub_url"].values[i] is not None:
36
  search_results += ", [Paper](" + top_five["pub_url"].values[i] + ")"
37
  search_results += "\t\n```\n"
 
12
 
13
  full_data = datasets.load_dataset("ccm/publications")['train'].to_pandas()
14
 
15
+ filter = ["\"abstract\": null" in json.dumps(bibdict) for bibdict in full_data['bib_dict'].values]
16
  data = full_data[~pandas.Series(filter)]
17
  data.reset_index(inplace=True)
18
 
 
30
  search_results = ""
31
 
32
  for i in range(k):
33
+ search_results += '### ' + top_five["bib_dict"].values[i]["title"] + '\n'
34
+ search_results += top_five["bib_dict"].values[i]["citation"]
35
  if top_five["pub_url"].values[i] is not None:
36
  search_results += ", [Paper](" + top_five["pub_url"].values[i] + ")"
37
  search_results += "\t\n```\n"