vagrillo commited on
Commit
5a3924c
1 Parent(s): ed06ce4

Update utils.py

Browse files
Files changed (1) hide show
  1. utils.py +8 -6
utils.py CHANGED
@@ -25,12 +25,14 @@ def get_md_text_abstract(rag_answer, source = ['Arxiv Search', 'Semantic Search'
25
  paper_link = rag_answer.links[0].href
26
  download_link = rag_answer.links[1].href
27
  elif 'BeWeb' in source:
28
- title = rag_answer.title
29
- date = rag_answer.updated.strftime('%d %b %Y')
30
- paper_abs = rag_answer.summary.replace('\n',' ') + '\n'
31
- authors = ', '.join([author.name for author in rag_answer.authors])
32
- paper_link = rag_answer.links[0].href
33
- download_link = rag_answer.links[1].href
 
 
34
  else:
35
  raise Exception
36
 
 
25
  paper_link = rag_answer.links[0].href
26
  download_link = rag_answer.links[1].href
27
  elif 'BeWeb' in source:
28
+ title = rag_answer['document_metadata']['title'].replace('\n','')
29
+ #score = round(rag_answer['score'], 2)
30
+ date = rag_answer['document_metadata']['_time']
31
+ paper_abs = rag_answer['content']
32
+ authors = rag_answer['document_metadata']['authors'].replace('\n','')
33
+ doc_id = rag_answer['document_id']
34
+ paper_link = f'''https://arxiv.org/abs/{doc_id}'''
35
+ download_link = f'''https://arxiv.org/pdf/{doc_id}'''
36
  else:
37
  raise Exception
38