Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Broken output of displacy #476
Got a messy output while testing the sentence on the displacy.spacy.io. (Lines and arrows are being missed):
Tried both Chromium 51.0.2704.79\Ubuntu 14.04 (64-bit) and Firefox 47.0
Can confirm the same problem for me (ubuntu 16.04, firefox 48.0). I wonder if it's to do the length of the sentence?
Also, maybe this bug should be crossposted to the spacy-io/displacy repo issue tracker, because I imagine it's related to the visualisation.
@ines might know more.
Good catch, thanks for pointing this out!
There's a known issue with long sentences with no mergeable noun phrases and particularly long arcs, causing displaCy to render the smallest arcs so small that they pretty much disappear. (For comparison, see the same sentence with one small modification: "Artfully, though shamelessly, he has effectively tried to sell this action as an effort to bring about stability and help fight the war on terror.")
Some background on this: The arcs are currently rendered in "levels" (spanning over 1 word, spanning over 2 words etc.). The overall amount of levels is used to calculate the arcs' width and height to make sure they all fit. The bug here is that empty levels aren't stripped in the rendering process, meaning that in this case, it calculated the arrow sizes to fit 20 levels – when in reality, only 6 were used.
This will definitely be fixed in the new version (see my comment in #426), as it will use a much more reliable logic to draw the arcs. In the meantime, I'll see if I can add a quick fix to the current version to solve this particular problem. Also, as I said on the other thread, if there's anything you'd like to see/have fixed in the new version, let me know!