Open OlgaGKononova opened 4 years ago
Try setting the endpoint to be http instead of https:
export MATERIALS_SCHOLAR_ENDPOINT="http://api.matscholar.com"
(or set the corresponding endpoint
keyword argument in the Rester
object)
This is a certificate error because there hasn't been a certificate generated for the api.matscholar.com domain, only for the NERSC domains it's running on, so when it tries connecting via HTTPS you get an error.
And a note to whoever's administering this (@jdagdelen?), you can either ask Spin to install a certificate you generate onto their load balancer, or you can use a service like LetsEncrypt to generate a certificate for you on-the-fly. We've tried both -- Materials Project uses the former and works well but was more effort, smaller services I've worked on uses the latter but it's been a little buggy at times.
You might also want to change your endpoint to include /v1
or similar to give yourselves room to change the API if you want to make breaking changes in future.
Thank you Matt. I guess, John has already addressed my comment outside of github: the NER tagger is not implemented in API yet.
For the particular error you were receiving Matt was correct. We don't support https right now, but that will change in the near future. My understanding is you wanted to use our API for entity tagging/labeling but now I'm thinking you just want to do NER on your own text. Is that the case?
@mkhorton @jdagdelen Thank you guys for response. Problem still persists:
Traceback (most recent call last):
File "/home/olga/anaconda3/envs/NERenv/lib/python3.6/site-packages/matscholar/rest.py", line 83, in _make_request
raise MatScholarRestError(response)
matscholar.rest.MatScholarRestError: <Response [422]>
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "ner_trial.py", line 8, in <module>
tagged_docs = rester.get_ner_tags(docs)
File "/home/olga/anaconda3/envs/NERenv/lib/python3.6/site-packages/matscholar/rest.py", line 323, in get_ner_tags
return self._make_request(sub_url, payload=payload, method=method)
File "/home/olga/anaconda3/envs/NERenv/lib/python3.6/site-packages/matscholar/rest.py", line 88, in _make_request
raise MatScholarRestError(msg)
matscholar.rest.MatScholarRestError: <Response [422]>. Content: b'{"detail":[{"loc":["body","document"],"msg":"str type expected","type":"type_error.str"}]}'
Hi all. I tried to play around with entities tagging and for the example given in the README I got the following:
I don't have an account at NERSC, but I used API provided by John.