philipperemy / stanford-openie-python

Stanford Open Information Extraction made simple!
ISC License
637 stars 103 forks source link

RemoteDisconnected('Remote end closed connection without response',) #17

Closed faustinaSelvadeepa closed 4 years ago

faustinaSelvadeepa commented 4 years ago

I am testing openie for various sample texts. Sometimes I get the results and sometimes it throws "connection aborted, Remotedisconnected ('Remote end closed connection without response',)" error. I am using Ubuntu 18.04.3 LTS (GNU/Linux 4.15.0-1063-aws x86_64) Error

philipperemy commented 4 years ago

@faustinaSelvadeepa sometimes means a lot or it happened once? It is maybe possible that the server is already started when this command is run.

faustinaSelvadeepa commented 4 years ago

@philipperemy Thank you so much for responding back. It happened several times in a day. Should I close the server after every use? If so what is the right way to stop the server? else Is there a way to access the server multiple times?

philipperemy commented 4 years ago

I checked a bit and could not reproduce the issue. Do you have an example that shows how you use it? @faustinaSelvadeepa

faustinaSelvadeepa commented 4 years ago

Here is how i am using it, I have put everything in a function. When I make a call to this function multiple times I get "connection aborted" error at several tries. I am not sure what mistake i have made..could you please help me? def get_triplets(text): pos_words = POS_words(text) processed_text = get_coref_text(text) with StanfordOpenIE() as client: triple_list = [] for triple in client.annotate(processed_text): triple_list.append(triple) return triple_list

philipperemy commented 4 years ago

Ah that's why then. StanfordOpenIE() should be instantiated only one. So either:

philipperemy commented 4 years ago

(I'll close this issue now. Feel free to re-open it if you have more questions)