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

nlp.evaluate with empty docs_golds causes a bug #4924

Closed
tamuhey opened this issue Jan 20, 2020 · 3 comments · Fixed by #4925
Closed

nlp.evaluate with empty docs_golds causes a bug #4924

tamuhey opened this issue Jan 20, 2020 · 3 comments · Fixed by #4925
Labels
bug Bugs and behaviour differing from documentation feat / cli Feature: Command-line interface

Comments

@tamuhey
Copy link
Contributor

tamuhey commented Jan 20, 2020

How to reproduce the behaviour

nlp = spacy.blank("en")
docs_golds = [("", {})]
nlp.evaluate(docs_golds)

Causes the error:

        gold_deps = set()
        gold_deps_per_dep = {}
        gold_tags = set()
>       gold_ents = set(tags_to_entities([annot[-1] for annot in gold.orig_annot]))
E       TypeError: 'NoneType' object is not iterable

spacy/scorer.py:239: TypeError

Your Environment

  • Operating System: osx
  • Python Version Used: 3.7.4
  • spaCy Version Used: master
  • Environment Information:
@tamuhey tamuhey mentioned this issue Jan 20, 2020
3 tasks
@tamuhey
Copy link
Contributor Author

tamuhey commented Jan 20, 2020

created PR in #4925

@adrianeboyd adrianeboyd added bug Bugs and behaviour differing from documentation feat / cli Feature: Command-line interface labels Jan 20, 2020
honnibal pushed a commit that referenced this issue Jan 20, 2020
* new file:   test_issue4924.py

* modified:   spacy/gold.pyx

* modified:   test_issue4924.py for python2
@tamuhey tamuhey closed this as completed Jan 20, 2020
@svlandeg
Copy link
Member

svlandeg commented Jan 20, 2020

@tamuhey : Just as a small tip, if you put something like Fixes #4924 in your PR description, it will automatically close the original issue when merging the PR, and on top of the issue it will mention something like Fixed by #4925 ;-)

@tamuhey tamuhey reopened this Jan 20, 2020
@tamuhey tamuhey closed this as completed Jan 20, 2020
@lock
Copy link

lock bot commented Feb 21, 2020

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 Feb 21, 2020
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 feat / cli Feature: Command-line interface
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants