Skip to content

Instantly share code, notes, and snippets.

View ToshihikoSakai's full-sized avatar
Working from home

Toshihiko Sakai ToshihikoSakai

Working from home
View GitHub Profile
ToshihikoSakai / SpaCy_displacy
Last active March 7, 2022 13:32
Display NER tags with 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 = []