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

Raise error if deps not provided with heads #8335

Merged
merged 10 commits into from Jun 15, 2021
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions spacy/tokens/doc.pyx
Expand Up @@ -275,6 +275,8 @@ cdef class Doc:
deps = [dep if dep is not None else MISSING_DEP_ for dep in deps]
if deps and not heads:
heads = [0] * len(deps)
if heads and not deps:
deps = ['dep'] * len(heads)
svlandeg marked this conversation as resolved.
Show resolved Hide resolved
if sent_starts is not None:
for i in range(len(sent_starts)):
if sent_starts[i] is True:
Expand Down