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

[Bug] GoldParse instantiation with Misaligned tokens. #4529

Closed
tamuhey opened this issue Oct 27, 2019 · 1 comment
Closed

[Bug] GoldParse instantiation with Misaligned tokens. #4529

tamuhey opened this issue Oct 27, 2019 · 1 comment
Labels
bug Bugs and behaviour differing from documentation

Comments

@tamuhey
Copy link
Contributor

tamuhey commented Oct 27, 2019

How to reproduce the behaviour

  1. IndexError
text = "A'B C"
words = ["A", "'", "B", "C"]
doc = tokenizer(text)
GoldParse(doc, words=words)
---------------------------------------------------------------------------
IndexError                                Traceback (most recent call last)
<ipython-input-7-45b5f2ec7502> in <module>
      2 words = ["A", "'", "B", "C"]
      3 doc = tokenizer(text)
----> 4 GoldParse(doc, words=words)

gold.pyx in spacy.gold.GoldParse.__init__()

IndexError: list index out of range
  1. TypeError
text = "A-B"
words = ["A-B"]
doc = tokenizer(text)
GoldParse(doc, words=words)
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-8-9ae6959d65fe> in <module>
      2 words = ["A-B"]
      3 doc = tokenizer(text)
----> 4 GoldParse(doc, words=words)

gold.pyx in spacy.gold.GoldParse.__init__()

TypeError: list indices must be integers or slices, not NoneType

Your Environment

  • Operating System: mac OSX
  • Python Version Used: 3.7
  • spaCy Version Used: master
@ines ines added the bug Bugs and behaviour differing from documentation label Oct 27, 2019
honnibal pushed a commit that referenced this issue Oct 27, 2019
* fix: gold pyx

* remove print

* skip test in python2

* Add unicode declarations and don't skip test on Python 2
@ines ines closed this as completed Oct 27, 2019
honnibal added a commit that referenced this issue Oct 27, 2019
@lock
Copy link

lock bot commented Nov 26, 2019

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 Nov 26, 2019
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

2 participants