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

MUC 7 Corpus reader Crashes #3

Open
aboSamoor opened this issue Feb 14, 2012 · 0 comments
Open

MUC 7 Corpus reader Crashes #3

aboSamoor opened this issue Feb 14, 2012 · 0 comments

Comments

@aboSamoor
Copy link
Contributor

r = LazyCorpusLoader('muc_7/', MUCCorpusReader, 'data/..ne.eng.keys.')
r.iob_sents()
[[('Like', 'O'), ('most', 'O'), ('of', 'O'), ('the', 'O'), ('two', 'O'), ('million', 'O'), ('infants', 'O'), ('under', 'O'), ('2', 'O'), ('who', 'O'), ('fly', 'O'), ('with', 'O'), ('their', 'O'), ('parents', 'O'), ('every', 'O'), ('year', 'O'), (',', 'O'), ('Danasia', 'B-PERSON'), ('was', 'O'), ('traveling', 'O'), ('for', 'O'), ('free', 'O'), (',', 'O'), ('seated', 'O'), ('on', 'O'), ('her', 'O'), ('mother', 'O'), ("'s", 'O'), ('lap', 'O'), ('.', 'O')], [('As', 'O'), ('the', 'O'), ('DC-9', 'O'), ('approached', 'O'), ('the', 'O'), ('airport', 'O'), ('on', 'O'), ('July', 'B-DATE'), ('2', 'I-DATE'), (',', 'I-DATE'), ('1994', 'I-DATE'), (',', 'O'), ('wind', 'O'), ('shear', 'O'), ('slammed', 'O'), ('the', 'O'), ('plane', 'O'), ('to', 'O'), ('the', 'O'), ('ground', 'O'), ('.', 'O')], ...]
len(r.iob_sents())
[Tree('S', ['The', Tree('ORGANIZATION', ['Unicef']), 'Flyer', 'flight', 'suffered', 'a', 'setback', Tree('DATE', ['Dec', '.'])]), Tree('DATE', ['Dec', '.'])]
Traceback (most recent call last):
File "", line 1, in
File "/usr/local/lib/python2.7/dist-packages/nltk-2.0.1rc4-py2.7.egg/nltk/util.py", line 966, in len
return max(len(lst) for lst in self._lists)
File "/usr/local/lib/python2.7/dist-packages/nltk-2.0.1rc4-py2.7.egg/nltk/util.py", line 966, in
return max(len(lst) for lst in self._lists)
File "/usr/local/lib/python2.7/dist-packages/nltk-2.0.1rc4-py2.7.egg/nltk/util.py", line 807, in len
if len(self._offsets) <= len(self._list):
File "/usr/local/lib/python2.7/dist-packages/nltk-2.0.1rc4-py2.7.egg/nltk/util.py", line 966, in len
return max(len(lst) for lst in self._lists)
File "/usr/local/lib/python2.7/dist-packages/nltk-2.0.1rc4-py2.7.egg/nltk/util.py", line 966, in
return max(len(lst) for lst in self._lists)
File "/usr/local/lib/python2.7/dist-packages/nltk-2.0.1rc4-py2.7.egg/nltk/util.py", line 807, in len
if len(self._offsets) <= len(self._list):
File "/usr/local/lib/python2.7/dist-packages/nltk-2.0.1rc4-py2.7.egg/nltk/util.py", line 966, in len
return max(len(lst) for lst in self._lists)
File "/usr/local/lib/python2.7/dist-packages/nltk-2.0.1rc4-py2.7.egg/nltk/util.py", line 966, in
return max(len(lst) for lst in self._lists)
File "/usr/local/lib/python2.7/dist-packages/nltk-2.0.1rc4-py2.7.egg/nltk/corpus/reader/util.py", line 379, in len
for tok in self.iterate_from(self._offsets[-1]): pass
File "/usr/local/lib/python2.7/dist-packages/nltk-2.0.1rc4-py2.7.egg/nltk/corpus/reader/util.py", line 401, in iterate_from
for tok in piece.iterate_from(max(0, start_tok-offset)):
File "/usr/local/lib/python2.7/dist-packages/nltk-2.0.1rc4-py2.7.egg/nltk/corpus/reader/util.py", line 298, in iterate_from
tokens = self.read_block(self._stream)
File "/usr/local/lib/python2.7/dist-packages/nltk_contrib/coref/muc.py", line 419, in _read_parsed_block
return map(self._parse, self._read_block(stream))
File "/usr/local/lib/python2.7/dist-packages/nltk_contrib/coref/muc.py", line 428, in _parse
tree = mucstr2tree(doc, top_node='DOC')
File "/usr/local/lib/python2.7/dist-packages/nltk_contrib/coref/muc.py", line 468, in mucstr2tree
'text': _muc_read_text(match.group('text'), top_node),
File "/usr/local/lib/python2.7/dist-packages/nltk_contrib/coref/muc.py", line 534, in _muc_read_text
tree[-1].append(_muc_read_words(sent, 'S'))
File "/usr/local/lib/python2.7/dist-packages/nltk_contrib/coref/muc.py", line 558, in _muc_read_words
assert len(stack) == 1
AssertionError

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant