When I try to run this parser : 'crf-con-en' on a very long sentence, I am getting the following error:
myenv\\lib\site-packages\torch\hub.py:452: UserWarning: Falling back to the old format < 1.6. This support will be deprecated in favor of default zipfile format introduced in 1.6. Please redo torch.save() to save it in the new zipfile format. warnings.warn('Falling back to the old format < 1.6. This support will be ' Traceback (most recent call last): File "test.py", line 1227, in <module> date_entities = get_constituency_date_entities(date_text, parser_supar, nlp) File "test.py", line 1117, in get_constituency_date_entities dataset = parser.predict([nltk.word_tokenize(sentence)], verbose=False) File "myenv\\lib\site-packages\supar\parsers\constituency.py", line 131, in predict return super().predict(**Config().update(locals())) File "myenv\\lib\site-packages\supar\parsers\parser.py", line 108, in predict dataset = Dataset(self.transform, data) File "myenv\\lib\site-packages\supar\utils\data.py", line 40, in __init__ self.sentences = transform.load(data, **kwargs) File "myenv\\lib\site-packages\supar\utils\transform.py", line 694, in load sentences.append(TreeSentence(self, tree)) File "myenv\\lib\site-packages\supar\utils\transform.py", line 716, in __init__ for i, j, label in Tree.factorize(Tree.binarize(tree)[0]): File "myenv\\lib\site-packages\supar\utils\transform.py", line 561, in binarize tree.collapse_unary() File "myenv\\lib\site-packages\nltk\tree.py", line 535, in collapse_unary collapse_unary(self, collapsePOS, collapseRoot, joinChar) File "myenv\\lib\site-packages\nltk\treetransforms.py", line 264, in collapse_unary and (collapsePOS == True or isinstance(node[0, 0], Tree)) File "myenv\\lib\site-packages\nltk\tree.py", line 169, in __getitem__ return self[index[0]][index[1:]] File "myenv\\lib\site-packages\nltk\tree.py", line 167, in __getitem__ return self[index[0]] File "myenv\\lib\site-packages\nltk\tree.py", line 162, in __getitem__ return list.__getitem__(self, index) IndexError: list index out of range
When I try to run this parser : 'crf-con-en' on a very long sentence, I am getting the following error:
myenv\\lib\site-packages\torch\hub.py:452: UserWarning: Falling back to the old format < 1.6. This support will be deprecated in favor of default zipfile format introduced in 1.6. Please redo torch.save() to save it in the new zipfile format. warnings.warn('Falling back to the old format < 1.6. This support will be ' Traceback (most recent call last): File "test.py", line 1227, in <module> date_entities = get_constituency_date_entities(date_text, parser_supar, nlp) File "test.py", line 1117, in get_constituency_date_entities dataset = parser.predict([nltk.word_tokenize(sentence)], verbose=False) File "myenv\\lib\site-packages\supar\parsers\constituency.py", line 131, in predict return super().predict(**Config().update(locals())) File "myenv\\lib\site-packages\supar\parsers\parser.py", line 108, in predict dataset = Dataset(self.transform, data) File "myenv\\lib\site-packages\supar\utils\data.py", line 40, in __init__ self.sentences = transform.load(data, **kwargs) File "myenv\\lib\site-packages\supar\utils\transform.py", line 694, in load sentences.append(TreeSentence(self, tree)) File "myenv\\lib\site-packages\supar\utils\transform.py", line 716, in __init__ for i, j, label in Tree.factorize(Tree.binarize(tree)[0]): File "myenv\\lib\site-packages\supar\utils\transform.py", line 561, in binarize tree.collapse_unary() File "myenv\\lib\site-packages\nltk\tree.py", line 535, in collapse_unary collapse_unary(self, collapsePOS, collapseRoot, joinChar) File "myenv\\lib\site-packages\nltk\treetransforms.py", line 264, in collapse_unary and (collapsePOS == True or isinstance(node[0, 0], Tree)) File "myenv\\lib\site-packages\nltk\tree.py", line 169, in __getitem__ return self[index[0]][index[1:]] File "myenv\\lib\site-packages\nltk\tree.py", line 167, in __getitem__ return self[index[0]] File "myenv\\lib\site-packages\nltk\tree.py", line 162, in __getitem__ return list.__getitem__(self, index) IndexError: list index out of range