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

Iterate over lr_edges until sents are correct #4702

Merged
merged 1 commit into from Nov 25, 2019

Conversation

adrianeboyd
Copy link
Contributor

Description

Iterate over lr_edges until all heads are within the current sentence. Instead of iterating over them for a fixed number of iterations, check whether the sentence boundaries are correct for the heads and stop when all are correct. Stop after a maximum of 10 iterations, providing a warning in this case since the sentence boundaries may not be correct.

Fixes #4688.

Types of change

Bugfix.

Checklist

  • I have submitted the spaCy Contributor Agreement.
  • 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.

Iterate over lr_edges until all heads are within the current sentence.
Instead of iterating over them for a fixed number of iterations, check
whether the sentence boundaries are correct for the heads and stop when
all are correct. Stop after a maximum of 10 iterations, providing a
warning in this case since the sentence boundaries may not be correct.
@ines ines added bug Bugs and behaviour differing from documentation feat / parser Feature: Dependency Parser labels Nov 24, 2019
@honnibal
Copy link
Member

It bothers me that we don't have a more elegant solution to this. I designed the data structures for projective trees, and non-projectivity really messes things up :(. The patch is definitely an improvement though, so merging.

@honnibal honnibal merged commit 2d8c6e1 into explosion:master Nov 25, 2019
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 / parser Feature: Dependency Parser
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Parser assigns head from different sentence
3 participants