spaCy
spaCy copied to clipboard
Why does displacy only support showing one span key?
As the span group is meant to support different groups of spans, would be more useful to enable displacy supporting other span keys at the same time?
import spacy
from spacy import displacy
from spacy.tokens import Span
text = "Welcome to the Bank of China."
nlp = spacy.blank("en")
doc = nlp(text)
doc.spans["dc"] = [
Span(doc, 3, 6, "ORG")
]
doc.spans["sc"] = [
Span(doc, 5, 6, "GPE"),
]
displacy.render(doc, style="span")