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

Fix potential infinite recursion error #26

Merged
merged 1 commit into from
Oct 13, 2023
Merged

Conversation

bryant1410
Copy link
Contributor

I found that some spaCy docs have cycles in their "compounds" dependencies, in the dependency graph. It's very unlikely (in my estimates, it's about 1 in 60 million sentences that I tried) but it seems to be plausible. So it's better to avoid crashing. I fix it in this PR

@bryant1410
Copy link
Contributor Author

BTW, unfortunately, I don't have the example sentence that originates this, as I couldn't log it. I just managed to see the stack trace of a RecursionError.

@vacancy vacancy merged commit 2825dba into vacancy:master Oct 13, 2023
@bryant1410 bryant1410 deleted the patch-1 branch October 13, 2023 12:40
@vacancy
Copy link
Owner

vacancy commented Oct 16, 2023

Thank you for contributing. I merged the PR, but I am still interested in learning under what scenario that happens...

@bryant1410
Copy link
Contributor Author

Yeah, honestly me too haha. But my program crashed with this stack trace (infinitely recursing on dfs) and without me printing the original sentence, so I can't easily know 🤷🏼‍♂️ . My dataset of original sentences it's too large to look for this. It's clearly a parsing error because this shouldn't happen.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants