You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Consistently, if I have the stanford NER server running on my local machine, and I use pyner to make 20 consecutive queries - it doesn't matter how far apart in time they are - I receive the following error message and trace:
/usr/local/Cellar/python/2.7.5/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/ner-0.1-py2.7.egg/ner/client.pyc in get_entities(self, text)
74 :returns: a dict of entity type to list of entities of that type
75 """
---> 76 tagged_text = self.tag_text(text)
77 if self.oformat == 'slashTags':
78 entities = self.__slashTags_parse_entities(tagged_text)
/usr/local/Cellar/python/2.7.5/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/ner-0.1-py2.7.egg/ner/client.pyc in tag_text(self, text)
117 with tcpip4_socket(self.host, self.port) as s:
118 s.sendall(text)
--> 119 tagged_text = s.recv(10*len(text))
120 return tagged_text
121
/usr/local/Cellar/python/2.7.5/Frameworks/Python.framework/Versions/2.7/lib/python2.7/contextlib.pyc in __exit__(self, type, value, traceback)
22 if type is None:
23 try:
---> 24 self.gen.next()
25 except StopIteration:
26 return
/usr/local/Cellar/python/2.7.5/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/ner-0.1-py2.7.egg/ner/utils.pyc in tcpip4_socket(host, port)
15 yield s
16 finally:
---> 17 s.shutdown(socket.SHUT_RDWR)
18 s.close()
19
/usr/local/Cellar/python/2.7.5/Frameworks/Python.framework/Versions/2.7/lib/python2.7/socket.pyc in meth(name, self, *args)
222
223 def meth(name,self,*args):
--> 224 return getattr(self._sock,name)(*args)
225
226 for _m in _socketmethods:
error: [Errno 57] Socket is not connected
I can use other ner client libraries to make consecutive requests, so I'm doubtful that the issue lies with the server code.
The text was updated successfully, but these errors were encountered:
But, because of this bug, I can't successfully use the stanford ner server running on a socket using the pyner package on my machine, because I'm running OSX.
Alternatively, you can your local copy to call s.shutdown(...) between line 15 and 16 here. That way the exception is still handled and your socket will still close on OS X.
/usr/local/Cellar/python/2.7.5/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/ner-0.1-py2.7.egg/ner/utils.pyc in tcpip4_socket(host, port)
15 yield s
16 finally:
---> 17 s.shutdown(socket.SHUT_RDWR)
18 s.close()
19
Consistently, if I have the stanford NER server running on my local machine, and I use pyner to make 20 consecutive queries - it doesn't matter how far apart in time they are - I receive the following error message and trace:
I can use other ner client libraries to make consecutive requests, so I'm doubtful that the issue lies with the server code.
The text was updated successfully, but these errors were encountered: