🐞 fix(谷歌学术搜索): 包装search.results()为空可能造成的报错
https://github.com/binary-husky/gpt_academic/issues/423
This commit is contained in:
parent
c0e57e0e39
commit
3f31fb9990
@ -36,6 +36,7 @@ def get_meta_information(url, chatbot, history):
|
||||
max_results = 1,
|
||||
sort_by = arxiv.SortCriterion.Relevance,
|
||||
)
|
||||
try:
|
||||
paper = next(search.results())
|
||||
if string_similar(title, paper.title) > 0.90: # same paper
|
||||
abstract = paper.summary.replace('\n', ' ')
|
||||
@ -44,6 +45,9 @@ def get_meta_information(url, chatbot, history):
|
||||
abstract = abstract
|
||||
is_paper_in_arxiv = False
|
||||
paper = next(search.results())
|
||||
except:
|
||||
abstract = abstract
|
||||
is_paper_in_arxiv = False
|
||||
print(title)
|
||||
print(author)
|
||||
print(citation)
|
||||
|
Loading…
x
Reference in New Issue
Block a user