Skip to content
Discussion options

You must be logged in to vote

Hi @steve-solun , please don't tag individual maintainers in the forums. As for your question, can you try using a SpanGroup instead of a list when assigning to doc.spans[spans_key]? Something like this:

from spacy.tokens import SpanGroup

group = SpanGroup(doc, name="sc", spans=spans)
doc.spans["sc"] = group

Where the spans are your entities in the Doc. After converting them, you might want to sanity-check if doc.spans do indeed contain the spans you assigned (plus their annotations).

Replies: 4 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Answer selected by ljvmiranda921
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@ljvmiranda921
Comment options

@steve-solun
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat / spancat Feature: Span Categorizer
2 participants