paperswithcode / paperswithcode-client Goto Github PK
View Code? Open in Web Editor NEWAPI Client for paperswithcode.com
License: Apache License 2.0
API Client for paperswithcode.com
License: Apache License 2.0
I cannot find a method to get the datasets used in the paper
client.area_task_list("computer-vision")
works fine, whereas
client.area_task_list("computer-vision", page=2)
throws
---------------------------------------------------------------------------
KeyError Traceback (most recent call last)
<ipython-input-82-e71e2ef59317> in <module>
----> 1 client.area_task_list("computer-vision", page=2)
~/.local/lib/python3.8/site-packages/tea_client/handler.py in wrapper(self, *args, **kwargs)
16 def wrapper(self, *args, **kwargs):
17 try:
---> 18 return func(self, *args, **kwargs)
19 except HttpClientError as e:
20 if e.status_code == 401:
~/.local/lib/python3.8/site-packages/paperswithcode/client.py in area_task_list(self, area_id, page, items_per_page)
334 Tasks: Tasks object.
335 """
--> 336 return self.__page(
337 self.http.get(
338 f"/areas/{area_id}/tasks/",
~/.local/lib/python3.8/site-packages/paperswithcode/client.py in __page(cls, result, page_model)
79 previous_page = result["previous"]
80 if previous_page is not None:
---> 81 previous_page = cls.__parse(previous_page)
82 return page_model(
83 count=result["count"],
~/.local/lib/python3.8/site-packages/paperswithcode/client.py in __parse(url)
70 else:
71 q = parse.parse_qs(p.query)
---> 72 return q["page"][0]
73
74 @classmethod
KeyError: 'page'
This should not happen, as results of first query say there exists next page, and also it says that there are 934 results for computer vision, but maximal number of retrieved results is 500.
Dear PapersWithCode maintainers @alefnula @lambdaofgod @rstojnic @mkardas,
As a student researcher at Queen's University, I am interested in understanding how evaluation results are obtained and added to the PapersWithCode platform. Are the evaluation results extracted automatically from research papers using an automated system, or are they submitted and curated by the end-users, such as researchers and developers? For example, end-users can add new evaluation results to the HELM dataset:
I believe this information will help me better comprehend the reliability and scope of the evaluation results presented on the platform, as well as the potential opportunities for contributing to the platform as a researcher.
Thank you for your time and assistance in clarifying this matter.
Best regards,
Jimmy
Hi, can anyone tell me how to get the creation time of the repository? Because I don't see the create_time attribute in the Repository class. Thanks a lot.
I have tried to use the client.task_paper_list()
to obtain the papers for different tasks, but some of them yield the following error:
ValidationError(400: Request validation error.)
As an example, I printed the number of papers or an error message for the tasks listed for the query 'monocular', with the following output:
3d-object-detection-from-monocular-images: 5
indoor-monocular-depth-estimation: 3
Error for monocular-3d-human-pose-estimation
Error for monocular-3d-object-detection
monocular-3d-object-localization: 3
monocular-cross-view-road-scene-parsing-road: 1
monocular-cross-view-road-scene-parsing: 1
monocular-depth-estimation: 283
monocular-visual-odometry: 46
I verified on the webpage that these tasks have papers associated with them.
Hello,
Is it presently possible to query by date or get ordered papers starting with the most current dates? Presently I'm not sure if once can use the client for getting ordered results (though I did see a pull request). Additionally when you do order the results by published date I find that it starts ascending with the first papers being dated I believe in 1951 and the last papers being Null values.
Currently I'm guessing the best way forward is to just keep track of where specific date ranges exist in the paginated results or to download the entire dataset and manipulate it from there. If there is a better way I'm eager to know.
Thanks!
First, I have created an API token.
Next, I want to query papers by title using this code:
from paperswithcode import PapersWithCodeClient
client = PapersWithCodeClient(token="my_token")
papers = client.paper_list(q=title)
but I got HttpClientTimeout error:
tea_client.errors.HttpClientTimeout: HttpClientTimeout(500: Timeout exceeded)
Is there any way to prevent read timeout, or is it possible to modify the value of timeout?
I have tried querying
https://paperswithcode.com/api/v1/papers/?title=generative+adversarial+networks
and it returns entries sorted by the publishing date not by the most relevant orders.
I have also tried with different parameters q
, and it didn't work either. Actually, title
and q
performs the same behaviour.
can you please check @alefnula ?
Hello, I was hoping to get some better documentation for this API. While it's a great resource it seems that its focused on getting SOTA updated comparisons.
My goal was to get all the data from the NAS ImageNet classification page and recreate a similar graph to the one on top but with some additional data. Unfortunately, I don't seem to see a way of doing this though the API. It even looks like I'd have to actually go an scrape the page itself for the desired data (but then I'm missing the release date which is only shown as year).
Some additional documentation would be really helpful for me and those in the future trying to simply get specific data instead of doing SOTA comparisons.
If its currently possible to do what I'm requesting please let me know! Thank you!
It would be great if we could have a function that gives the children/parent or a task/method as we can see in the website
I've noticed that calling the method paper_repository_list() (and other methods with that follow the same structure). From what I've come to conclude, the problem is that in the return line return [Repository(**r) for r in self.http.get(f"/papers/{paper_id}/repositories/") ]
, the HTTP request returns a dict such as:
'next': None,
'previous': None,
'results': [{'url': 'https://github.com/andreev-io/Simulated-Annealing',
'is_official': False,
'description': 'Implementation of the 1983 Simulated Annealing paper (Kirkpatrick et al.) in Rust. Combinatorial optimization, traveling salesman.',
'stars': 1,
'framework': 'none'}]}
so looping with that only gives the keys of this dict, instead of the list of results. I believe that adding the key 'results' should fix the problem, as the list comprehension would be looping indeed with each list element (a dict):
return [Repository(**r) for r in self.http.get(f"/papers/{paper_id}/repositories/")["results"]]
I am using this client in my master thesis and would like to properly give credit to the authors/maintainers of this repo. Have you thought about adding a CFF file or codemeta file?
About CFF: https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-citation-files
About codemeta: https://github.com/codemeta/codemeta
I discovered that the main dataset page mentions the availability of up to 9,753 machine-learning datasets:
However, upon navigating through the pages from page 1 to page 100, I found no way to access the datasets not listed within the first 100 pages. Even when I manually attempted to access pages beyond 100, the website returned the same dataset list as page 100.
Could you please advise if there is a method to retrieve datasets beyond the first 100 pages? Your assistance in this matter would be greatly appreciated. @alefnula @lambdaofgod @rstojnic @mkardas
papers_page = client.paper_list(page=2, items_per_page=50)
Traceback (most recent call last):
File "", line 1, in
File "/opt/anaconda3/envs/pwc/lib/python3.7/site-packages/tea_client/handler.py", line 18, in wrapper
return func(self, *args, **kwargs)
File "/opt/anaconda3/envs/pwc/lib/python3.7/site-packages/paperswithcode_client-0.0.1-py3.7.egg/paperswithcode/client.py", line 98, in paper_list
File "/opt/anaconda3/envs/pwc/lib/python3.7/site-packages/paperswithcode_client-0.0.1-py3.7.egg/paperswithcode/client.py", line 74, in __page
File "/opt/anaconda3/envs/pwc/lib/python3.7/site-packages/paperswithcode_client-0.0.1-py3.7.egg/paperswithcode/client.py", line 65, in __parse
KeyError: 'page'
When I run the query for "utrecht university" on the website (https://paperswithcode.com/search?q_meta=&q_type=&q=utrecht+university), I get 5 results in total:
When I run the same query, I get only 3 results and some of them are different results:
For example the paper I marked (see this link also: https://physics.paperswithcode.com/paper/long-lived-non-equilibrium-interstitial-solid) isn't even in the original query I did on the website. Is this an issue or am I using this wrong?
This gets papers ordered by title
:
https://paperswithcode.com/api/v1/papers/?ordering=title
This doesn't get papers ordered by published
:
https://paperswithcode.com/api/v1/papers/?ordering=published
When call paper_result_list(), it only return results on first page. I look at source code, now it only did:
self.http.get(f"/evaluations/{evaluation_id}/results/")
But for all later pages, it should also call self.http.get(f"/evaluations/{evaluation_id}/results/?page=2")
Please fix this bug or provide new api, thanks!
(pwc) rjt-mbp:paperswithcode-client rjt$ python setup.py install
Traceback (most recent call last):
File "setup.py", line 3, in
from paperswithcode import version
File "/Users/rjt/Documents/software/paperswithcode-client/paperswithcode/init.py", line 3, in
from paperswithcode.client import PapersWithCodeClient
File "/Users/rjt/Documents/software/paperswithcode-client/paperswithcode/client.py", line 5, in
from tea_client.http import HttpClient
ModuleNotFoundError: No module named 'tea_client'
I ran the exact sample code in the README, replacing the token with my API token and the dataset name with my target dataset, and I've received the following error:
"tea_client.errors.HttpClientError: HttpClientError(400: Bad Request.)"
Is the sample code still working? Is there something else that I need to change in the code?
Hi,
I didn't find a better place to report to, just I wanted to publish it somewhere.
So, if you open this
https://paperswithcode.com/api/v1/docs/?format=openapi
then you realize that the "operationId": "repositories_read" is a duplicate,
therefore swagger / openapi tools can't generate proper client.
I guess it is a trivial renaming fix, but would be nice to put an automated validation somewhere in the future.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.