explosion / explosion/spaCy

Why does displacy only support showing one span key?

Open
#13,474 0 comments 0 reactions 0 assignees View on GitHub
enhancement feat / doc feat / visualizers
Dominant language
Python
Stars
33.9k
Forks
4.7k
Avg merge
3m
Merged PRs (30d)
1

Description

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")
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.