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

incorrect behavior of spacy.tests.util.assert_docs_equal #5144

Closed
tamuhey opened this issue Mar 13, 2020 · 3 comments · Fixed by #5146
Closed

incorrect behavior of spacy.tests.util.assert_docs_equal #5144

tamuhey opened this issue Mar 13, 2020 · 3 comments · Fixed by #5146
Labels
bug Bugs and behaviour differing from documentation feat / doc Feature: Doc, Span and Token objects

Comments

@tamuhey
Copy link
Contributor

tamuhey commented Mar 13, 2020

import spacy
from spacy.tests.util import assert_docs_equal

nlp = spacy.load("en_core_web_sm")
text = "This is a sentence"
doc1 = nlp(text)
doc2 = nlp(text)
assert_docs_equal(doc1, doc2) # raise error

spacy version: master

@adrianeboyd adrianeboyd added the bug Bugs and behaviour differing from documentation label Mar 13, 2020
@adrianeboyd
Copy link
Contributor

Thanks for the report! Span comparisons were modified in #5005, so now spans from different documents are never equal. I think this test could be updated to check the Token.is_sent_start values instead.

@tamuhey
Copy link
Contributor Author

tamuhey commented Mar 13, 2020

Or simply compare sent.text instead of sent?

@lock
Copy link

lock bot commented Apr 15, 2020

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 Apr 15, 2020
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
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants