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

Retokenizer.merge() failing if doc.tensor set in v2.1.0a7 #3288

Closed
NixBiks opened this issue Feb 18, 2019 · 1 comment
Closed

Retokenizer.merge() failing if doc.tensor set in v2.1.0a7 #3288

NixBiks opened this issue Feb 18, 2019 · 1 comment
Labels
bug Bugs and behaviour differing from documentation feat / doc Feature: Doc, Span and Token objects 🌙 nightly Discussion and contributions related to nightly builds

Comments

@NixBiks
Copy link
Contributor

NixBiks commented Feb 18, 2019

Reproducible example

from spacy import displacy
import spacy

nlp = spacy.load('en')
text = 'Hello World! When is this breaking?'

displacy.serve(nlp(text))

Traceback

Traceback (most recent call last):
  File "/home/bjerre/Projects/plx/InternalWebApp/venv/lib/python3.6/site-packages/IPython/core/interactiveshell.py", line 3267, in run_code
    exec(code_obj, self.user_global_ns, self.user_ns)
  File "<ipython-input-3-d0297177ff7d>", line 7, in <module>
    displacy.serve(nlp(text))
  File "/home/bjerre/Projects/plx/InternalWebApp/venv/lib/python3.6/site-packages/spacy/displacy/__init__.py", line 80, in serve
    render(docs, style=style, page=page, minify=minify, options=options, manual=manual)
  File "/home/bjerre/Projects/plx/InternalWebApp/venv/lib/python3.6/site-packages/spacy/displacy/__init__.py", line 42, in render
    parsed = [converter(doc, options) for doc in docs] if not manual else docs
  File "/home/bjerre/Projects/plx/InternalWebApp/venv/lib/python3.6/site-packages/spacy/displacy/__init__.py", line 42, in <listcomp>
    parsed = [converter(doc, options) for doc in docs] if not manual else docs
  File "/home/bjerre/Projects/plx/InternalWebApp/venv/lib/python3.6/site-packages/spacy/displacy/__init__.py", line 132, in parse_deps
    retokenizer.merge(span, attrs=attrs)
  File "_retokenize.pyx", line 73, in spacy.tokens._retokenize.Retokenizer.__exit__
  File "_retokenize.pyx", line 225, in spacy.tokens._retokenize._bulk_merge
KeyError: 0

Info about spaCy

  • spaCy version: 2.1.0a7
  • Platform: Linux-4.15.0-45-generic-x86_64-with-Ubuntu-18.04-bionic
  • Python version: 3.6.7
  • Models: en
ines added a commit that referenced this issue Feb 18, 2019
@ines ines added bug Bugs and behaviour differing from documentation feat / doc Feature: Doc, Span and Token objects labels Feb 18, 2019
ines added a commit that referenced this issue Feb 18, 2019
@ines ines added the 🌙 nightly Discussion and contributions related to nightly builds label Feb 18, 2019
honnibal added a commit that referenced this issue Feb 21, 2019
@honnibal honnibal changed the title Displacy dependency parser failing in v2.1.0a7 Retokenizer.merge() failing if doc.tensor set in v2.1.0a7 Feb 21, 2019
honnibal added a commit that referenced this issue Feb 21, 2019
@lock
Copy link

lock bot commented Mar 23, 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 Mar 23, 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 feat / doc Feature: Doc, Span and Token objects 🌙 nightly Discussion and contributions related to nightly builds
Projects
None yet
Development

No branches or pull requests

3 participants