Machine-Learning-for-Medical-Language / ctakes-rest-package

Quick repo to get setup running cTAKES REST server and making calls
6 stars 4 forks source link

ConnectionError #2

Closed rjiang9 closed 1 year ago

rjiang9 commented 1 year ago

Hi folks,

I got this Connection error when I run gainst a data using ctakes-rest-package.

I have a lot of requests to the server (about 600k rows in total, one request for each row ) which UMLs may not like. What's the correct way to do it?

Thanks

raise ConnectionError(e, request=request) requests.exceptions.ConnectionError: HTTPConnectionPool(host='localhost', port=8080): Max retries exceeded with url: /ctakes-web-rest/service/analyze (Caused by NewConnectionError('<requests.packages.urllib3.connection.HTTPConnection object at 0x7fb73b796c10>: Failed to establish a new connection: [Errno 61] Connection refused'))

image
tmills commented 1 year ago

1) Are you able to test small numbers of queries manually and see it working to make sure that it's not a network-related issue? 2) Are you sending queries in parallel or in series? If they are sending in sequential order (blocking) there should be no problem, even if there are a lot in a row. This is not using UMLS (NLM) servers for each query, only one time at startup to authorize your credentials. 3) If you are sending in parallel, this container indeed does not have the ability to handle it and behavior is undetermined. I would recommend looking at our other repo (that depends on this one) for a demo of how to parallelize: https://github.com/Machine-Learning-for-Medical-Language/curate-mimic

rjiang9 commented 1 year ago

Thank you so much for all the info @tmills! I appreciate it for the confirmation on the requests handling.

It turns out the docker stopped for some reason on my machine. Silly me.

tmills commented 1 year ago

OK, everything looks good in the code above. It really depends what you're trying to do. Hope you find it useful, and check out curate-mimic if you have the ability to run multiple containers in parallel, it will be much faster.

rjiang9 commented 1 year ago

OK, everything looks good in the code above. It really depends what you're trying to do. Hope you find it useful, and check out curate-mimic if you have the ability to run multiple containers in parallel, it will be much faster.

I will checkout the curate-mimic. Thanks a lot for the projects!!! @tmills