Skip to content

Instantly share code, notes, and snippets.

@ToshihikoSakai
ToshihikoSakai / SpaCy_displacy
Last active Mar 7, 2022
Display NER tags with SpaCy displacy
View SpaCy_displacy
import spacy
from spacy import displacy
nlp = spacy.blank('ja')
raw_text = "私は東京に行きます。その後、千葉にも行きます。"
doc = nlp.make_doc(raw_text)
spans = [[2,4,"LOC"],[14,16,"LOC"]]
ents = []