vagrillo commited on
Commit
ed06ce4
1 Parent(s): 69678f8

Update utils.py

Browse files
Files changed (1) hide show
  1. utils.py +8 -2
utils.py CHANGED
@@ -6,7 +6,7 @@ from nltk.corpus import stopwords
6
  stop_words = stopwords.words('english')
7
  import arxiv
8
 
9
- def get_md_text_abstract(rag_answer, source = ['Arxiv Search', 'Semantic Search'][1], return_prompt_formatting = False):
10
  if 'Semantic Search' in source:
11
  title = rag_answer['document_metadata']['title'].replace('\n','')
12
  #score = round(rag_answer['score'], 2)
@@ -24,7 +24,13 @@ def get_md_text_abstract(rag_answer, source = ['Arxiv Search', 'Semantic Search'
24
  authors = ', '.join([author.name for author in rag_answer.authors])
25
  paper_link = rag_answer.links[0].href
26
  download_link = rag_answer.links[1].href
27
-
 
 
 
 
 
 
28
  else:
29
  raise Exception
30
 
 
6
  stop_words = stopwords.words('english')
7
  import arxiv
8
 
9
+ def get_md_text_abstract(rag_answer, source = ['Arxiv Search', 'Semantic Search','BeWeb'][1], return_prompt_formatting = False):
10
  if 'Semantic Search' in source:
11
  title = rag_answer['document_metadata']['title'].replace('\n','')
12
  #score = round(rag_answer['score'], 2)
 
24
  authors = ', '.join([author.name for author in rag_answer.authors])
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