Skip to content
Discussion options

You must be logged in to vote

Hi @adidonatocda ,

You're correct, as it's experimental, Spans aren't supported in displacy. However, if you still wish to render them, a hacky way might be to copy the spans from doc.spans[spans_key] to doc.ents while being careful of the overlaps, and render each entity one-by-one. This assumes that there are no overlaps within a span type. Once you've rendered each span type, you can combine them manually into a single HTML output.

However, if you have overlapping spans within the same span type, this hacky way will not work.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by svlandeg
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat / visualizers Feature: Built-in displaCy and other visualizers feat / cli Feature: Command-line interface
2 participants