Skip to content
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

ParserStateError #758

Closed
muthupl opened this issue Jan 20, 2017 · 4 comments
Closed

ParserStateError #758

muthupl opened this issue Jan 20, 2017 · 4 comments
Labels
bug Bugs and behaviour differing from documentation

Comments

@muthupl
Copy link

muthupl commented Jan 20, 2017

Hi,

We are getting a parser state error.
Here is our test:

nlp = spacy.en.English()
nlp.matcher.add('splash', 'my entity', {},[ [{LEMMA: 'splash'}, {LEMMA: 'on'}]])
nlp('splash On')

Here is the trace:

Traceback (most recent call last):
File "lib/python3.5/site-packages/spacy/language.py", line 328, in call
proc(doc)
File "spacy/syntax/parser.pyx", line 146, in spacy.syntax.parser.Parser.call (spacy/syntax/parser.cpp:6114)
spacy.syntax.parser.ParserStateError: Error analysing doc -- no valid actions available. This should never happen, so please report the error on the issue tracker. Here's the thread to do so --- reopen it if it's closed:
#429
Please include the text that the parser failed on, which is:
'splash On'

Our spacy version: spacy==1.3.0
Python 3.5.1
Mac OSX EI Capitan

Any help or fix is much appreciated! Let us know if you need more details.

@honnibal honnibal added the bug Bugs and behaviour differing from documentation label Jan 20, 2017
@honnibal
Copy link
Member

Thanks! Will investigate.

@ejschoen
Copy link

ejschoen commented Feb 1, 2017

Hi. Thanks for all your work. For what it's worth, I'm running into the same issue in version 1.5.0. I added a comment to issue #429 describing the code (match rule, with callback, doing a span merge) and the text I'm parsing, but I'm thinking that's not really the issue where it belongs.

Additionally, I'm able to do this to work around the ParserStateError:

d = nlp.tokenizer("Located 16 km southwest of the Ceres find, the Hebe-1 well tested at 5,956 BOPD.")
nlp.tagger(d)
nlp.parser(d)
nlp.entity(d)
nlp.matcher(d)

The resulting doc has "5,956 BOPD." merged into a single token, but the entity type is ORG, and not QUANTITY. However, the match rule for {like_num,"BOPD."} does try to define the match as a QUANTITY, as does the span.merge in the on_match callback.

One more update...

At least in 1.5.0, passing keyword args to span.merge didn't work for me.

        newspan = span.merge(ent_type='QUANTITY',tag='NNP')

However, this (I think deprecated form) did:

        newspan = span.merge('NNP',span.text,'QUANTITY')

I'm not a Python programmer, so this might be a noob issue on my part.

@ines ines added this to the Debug parser transition system milestone Feb 18, 2017
honnibal added a commit that referenced this issue Mar 31, 2017
Issue #758 occurs when no actions are available for a single token
doc after merging.
@honnibal
Copy link
Member

I think this is fixed now. The code in this doc.merge() method is still quite poor, and needs to be rewritten. But there's now a passing test for this specific issue. Thanks again for reporting!

@lock
Copy link

lock bot commented May 9, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators May 9, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Bugs and behaviour differing from documentation
Projects
None yet
Development

No branches or pull requests

4 participants