emilmont / pyStatParser

Simple Python Statistical Parser
Apache License 2.0
110 stars 49 forks source link

Error running the example in README #12

Open hongkedavid opened 6 years ago

hongkedavid commented 6 years ago

Hi, I cloned the master branch and tried the example in README, but encountered the following error. Could anyone know how to fix it? Thanks!

Python 2.7.12 (default, Jul 18 2016, 15:02:52) [GCC 4.8.4] on linux2 Type "help", "copyright", "credits" or "license" for more information.

from stat_parser import Parser parser = Parser() print parser.parse("How can the net amount of entropy of the universe be massively decreased?") Traceback (most recent call last): File "", line 1, in File "stat_parser/parser.py", line 112, in nltk_parse return nltk_tree(self.raw_parse(sentence)) File "stat_parser/parser.py", line 107, in raw_parse tree = self.norm_parse(sentence) File "stat_parser/parser.py", line 104, in norm_parse return CKY(self.pcfg, norm_words) File "statparser/parser.py", line 74, in CKY , top = max([(pi[1, n, X], bp[1, n, X]) for X in pcfg.N]) ValueError: max() arg is an empty sequence

PartsUnknown commented 6 years ago

I would like to follow up on this. I am having the same problem.

ghost commented 5 years ago

Same here

annaRichImperial commented 5 years ago

me too! anyone have a solution?

theadorabledev commented 4 years ago

I am having the same problem. It looks like a long shot but did anybody find a solution?