change index method
This commit is contained in:
parent
d777202863
commit
e70f5fea1c
2
main.py
2
main.py
@ -15,7 +15,7 @@ def query(query:str):
|
|||||||
if not mysql_connector.is_loaded(i['paperId']):
|
if not mysql_connector.is_loaded(i['paperId']):
|
||||||
res.append({
|
res.append({
|
||||||
'id':i['paperId'],
|
'id':i['paperId'],
|
||||||
'q':str(i['title']),
|
'q':str(i['citationStyles']['bibtex']),
|
||||||
'a':str(i['abstract']),
|
'a':str(i['abstract']),
|
||||||
'score':[]
|
'score':[]
|
||||||
})
|
})
|
||||||
|
@ -20,5 +20,5 @@ def search_paper(question):
|
|||||||
for i in question:
|
for i in question:
|
||||||
query += "+" + i
|
query += "+" + i
|
||||||
res = requests.get(headers={'x-api-key':__CONFIG__['semAPI']},
|
res = requests.get(headers={'x-api-key':__CONFIG__['semAPI']},
|
||||||
url= 'https://api.semanticscholar.org/graph/v1/paper/search?fieldsOfStudy=Psychology&fields=title,abstract&query='+query[+1:]).json()
|
url= 'https://api.semanticscholar.org/graph/v1/paper/search?fieldsOfStudy=Psychology&fields=abstract,citationStyles&query='+query[+1:]).json()
|
||||||
return res['data']
|
return res['data']
|
||||||
|
Loading…
Reference in New Issue
Block a user