Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

S2_API_KEY for semanticscholar.org #104

Open
gao106 opened this issue Sep 5, 2024 · 14 comments
Open

S2_API_KEY for semanticscholar.org #104

gao106 opened this issue Sep 5, 2024 · 14 comments

Comments

@gao106
Copy link

gao106 commented Sep 5, 2024

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?

@micelvrice
Copy link

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.

@gao106
Copy link
Author

gao106 commented Sep 5, 2024

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

@micelvrice
Copy link

@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

@MarlNox
Copy link

MarlNox commented Sep 5, 2024

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

@gao106
Copy link
Author

gao106 commented Sep 6, 2024

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

@MarlNox
Copy link

MarlNox commented Sep 6, 2024

@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



@gao106
Copy link
Author

gao106 commented Sep 7, 2024

@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'

@MarlNox
Copy link

MarlNox commented Sep 7, 2024

@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.

@gao106
Copy link
Author

gao106 commented Sep 8, 2024

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

@MarlNox
Copy link

MarlNox commented Sep 9, 2024

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.

@LMJOK
Copy link

LMJOK commented Sep 10, 2024

@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
Copy link

LMJOK commented Sep 20, 2024

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
Copy link

LMJOK commented Sep 20, 2024

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
Copy link

LMJOK commented Sep 23, 2024

@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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants