-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
infinite loop? #67
Comments
Here is an example producing it:
And here is the error:
|
I agree that it is not safe and I will change it. And I will also look into it because this infinity loop shouldn't happen (by the time we call get_view inside add_view, the view should have been created) |
I see your point that it shouldn't happen. But it actually happened to me unfortunately :-/ |
So the infinite loop happens if user passed in an empty string. On calling server with empty string, different from "TOKENS" view which will be in the response with no constituents, the response will not contain other views requested, which causes the endless call on My suggestion is to check string length when user call |
@danyaljj and your script need to check if ## get trump speeches
import urllib2
url = "https://raw.githubusercontent.com/ryanmcdermott/trump-speeches/master/speeches.txt"
speeches = urllib2.urlopen(url)
speechText = speeches.read()
firstFewLines = speechText[0: 2000]
## create a remote pipeline
from sioux import remote_pipeline
p = remote_pipeline.RemotePipeline(server_api='http://austen.cs.illinois.edu:5800')
for d in firstFewLines.splitlines():
print d
print "---- \n"
doc = p.doc(d)
if doc is not None: # HERE
ner_view = doc.get_ner_conll
print ner_view Also I wonder if that also happens to you, it seems like the server side couldn't handle this text. |
Yeah I think we should do this. Let's create an empty TextAnnotation. Checking whether the output is None or not is extra complication for the user. |
About error code 500: we should clarify in the readme, and give an example usage. |
@danyaljj changed to returning empty TextAnnotation. And what do you want to talk about status code 500 in README? Can you check the log on server side to see what caused this? |
I wanna show that usage that you showed me above. It is true that we should see what's happening on this specific example in the pipeline side. That being said, there is always going g to be issues on the server side that we cannot handle. Like anything random like network failure. So I think we should let users know that things might go wrong |
Inside
get_view
function we calladd_view
function, and insideadd_view
function we callget_view
.There's danger of falling in an infinite recursive loop.
The text was updated successfully, but these errors were encountered: