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

displaCy: Fix horizontal spacing for multiple span labels #10994

Merged
merged 1 commit into from
Jun 28, 2022

Conversation

pmbaumgartner
Copy link
Contributor

This PR updates displaCy's template and logic for calculating the vertical spacing between lines when there are multiple labels covering a single span.

Before (w/ prodigy comparison):
image

After: (Ignore specific span differences + lack of coloring)
image

Types of change

bug fix / enhancement

Checklist

  • I confirm that I have the right to submit this contribution under the project's MIT license.
  • I ran the tests, and all new and existing tests passed.
  • My changes don't require a change to the documentation, or if they do, I've added all required information.

@polm polm added bug Bugs and behaviour differing from documentation feat / visualizers Feature: Built-in displaCy and other visualizers labels Jun 21, 2022
Copy link
Contributor

@ljvmiranda921 ljvmiranda921 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you so much @pmbaumgartner ! I'd also ask @ines 's review to be sure! (can't seem to add reviewers)

spacy/displacy/templates.py Show resolved Hide resolved
Copy link
Member

@ines ines left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for fixing, looks great! 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bugs and behaviour differing from documentation feat / visualizers Feature: Built-in displaCy and other visualizers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants