AI-Scientist icon indicating copy to clipboard operation
AI-Scientist copied to clipboard

S2_API_KEY for semanticscholar.org

Open gao106 opened this issue 1 year ago • 15 comments

Does anyone know how to obtain an S2_API_KEY for semanticscholar.org? I've applied for it nearly five days ago and still haven't received a response. Does anyone know how to increase the approval rate for the application? Alternatively, is there a platform where I can buy or rent this S2_API_KEY?

gao106 avatar Sep 05 '24 01:09 gao106

I just got the email today that my application was successful and I got the key. Prior to that, I received an email asking me to describe in detail the information about the project that I want to use the api for. The whole process takes about 4 days. Maybe if you're lucky you'll get it in a couple days.

micelvrice avatar Sep 05 '24 06:09 micelvrice

@micelvrice Can you tell me how to fill the form and increase the pass rate ? Uploading 2024-09-05_142928.png…

gao106 avatar Sep 05 '24 06:09 gao106

@gao106 nothing special, provide as much detail as possible on your project and how you plan on using the APIs. Notably, they mentioned that they are limited to 1 RPS on all endpoints (cumulative) sometimes can increase RPS on a few of the endpoints but only after working with a user to try to identify other options for efficiency opportunities

micelvrice avatar Sep 05 '24 06:09 micelvrice

I changed the code to work with Core.ac.uk, Semantic Scholar seems so awfully mismanaged.

MarlNox avatar Sep 05 '24 08:09 MarlNox

@MarlNox How to switch Core.ac.uk ,can you upload the code?

gao106 avatar Sep 06 '24 02:09 gao106

@MarlNox How to switch Core.ac.uk ,can you upload the code?

I can upload it, but for the moment my solution is very messy, kind of done on the fly to test out the paper. specificallyin generating non CS/AI related papers. But im posting the relevant snippet below. I'll work on a more modular AI Scientist, and will publish the repo when im done.

Essentially in the generate_ideas.py file, there;s a search_for_papers() function def. Change it like this. Create a free account on core.ac.uk and itll automatically give you an API key.


CORE_API_KEY = "XXXXYYY"



def search_for_papers(query, result_limit=10) -> Union[None, List[Dict]]:
   no_query = "No papers found. Skip."
   if not query:
       return no_query
   headers = {"Authorization": f"Bearer {CORE_API_KEY}"}
   payload = {"q": query, "limit": result_limit}
   rsp = requests.post(
       "https://api.core.ac.uk/v3/search/works", 
       data=json.dumps(payload), 
       headers=headers
   )
   print(f"Response Status Code: {rsp.status_code}")
   print(
       f"Response Content: {rsp.text[:500]}"
   )  # Print the first 500 characters of the response content
   rsp.raise_for_status()
   results = rsp.json()
   
   total = results["totalHits"]
   if total == 0:
       return no_query
   papers = results["results"]
   return papers



MarlNox avatar Sep 06 '24 14:09 MarlNox

@MarlNox thanks There is a error,Have you ever appeared? esponse Status Code: 200 Response Content: {"totalHits":0,"limit":10,"offset":0,"results":[]} Error: string indices must be integers, not 'str'

gao106 avatar Sep 07 '24 03:09 gao106

@MarlNox thanks There is a error,Have you ever appeared? esponse Status Code: 200 Response Content: {"totalHits":0,"limit":10,"offset":0,"results":[]} Error: string indices must be integers, not 'str'

You're using a local LLM? This issue appears consistently with local LLMs including deepseek-code-2 and Llama3.1 8b (even the fp16 version). It cna be fixed through some finetuning I reckon. Additionally I have yet to try it with the new Llama-3.1-Storm-8B, which from what I read of it's training data may handle the process better. Using Gpt-4o this issue is almost inexistent.

MarlNox avatar Sep 07 '24 15:09 MarlNox

No,i am not,I use deepseek to get throght DEEPSEEK_API_KEY

gao106 avatar Sep 08 '24 08:09 gao106

If you try it with GPT4o you'll see it'll work consistently, which IMO means, that due to output quality the content being generated is not being parsed properly.

MarlNox avatar Sep 09 '24 15:09 MarlNox

@MarlNox thanks There is a error,Have you ever appeared?谢谢 有一个错误,你出现过吗? esponse Status Code: 200响应状态码:200 Response Content: {"totalHits":0,"limit":10,"offset":0,"results":[]}响应内容: {"totalHits":0,"limit":10,"offset":0,"results":[]} Error: string indices must be integers, not 'str'错误:字符串索引必须是整数,不能是字符串

Have you solved the problem? I had the same problem

LMJOK avatar Sep 10 '24 09:09 LMJOK

Have you solved the problem? I had the same problem

@MarlNox thanks There is a error,Have you ever appeared?感谢。有一个错误,您出现过吗? esponse Status Code: 200响应状态码:200 Response Content: {"totalHits":0,"limit":10,"offset":0,"results":[]}响应内容:{"totalHits":0,"limit":10,"offset":0,"results":[]} Error: string indices must be integers, not 'str'错误:字符串索引必须是整数,而不是 'str'

Have you solved the problem? I had the same problem

LMJOK avatar Sep 20 '24 09:09 LMJOK

No,i am not,I use deepseek to get throght DEEPSEEK_API_KEY不,我不是。我使用 DeepSeek 通过 DEEPSEEK_API_KEY 进行操作

Have you solved the problem? I had the same problem

LMJOK avatar Sep 20 '24 09:09 LMJOK

@gao106 nothing special, provide as much detail as possible on your project and how you plan on using the APIs. Notably, they mentioned that they are limited to 1 RPS on all endpoints (cumulative) sometimes can increase RPS on a few of the endpoints but only after working with a user to try to identify other options for efficiency opportunities没有特别之处,请尽可能详细地提供您的项目信息以及您计划如何使用 API。值得注意的是,他们提到所有端点(累计)的 RPS 限制为 1,有时可以在几个端点上增加 RPS,但仅在与用户合作尝试识别其他提高效率的机会之后。

Can you tell me how to fill in the Application API information? I applied twice and got no news. What is the mailbox you are applying for?

LMJOK avatar Sep 23 '24 11:09 LMJOK

@MarlNox might wanna check this convo cus there should be bigger lists on alternative sources https://github.com/SakanaAI/AI-Scientist/discussions/165

BradKML avatar Dec 27 '24 02:12 BradKML