特定の文章のentityを表示する方法は以下のとおりです。
import spacy
#またはja_ginza_electra, ja_ginza
nlp = spacy.load("ja_ginza_bert_large")
sample_text = "イタリアでは犬も歩けば猫に出会う。"
doc = nlp(sample_text)
for ent in doc.ents:
print(ent.text, ent.label_)
displacyを用いれば視覚的に分かりやすく表示することも可能です。(displayではないのでタイプミスに注意)
from spacy import displacy
displacy.render(doc, style="ent", jupyter=True)
もっとも、文章を指定せずに、そのモデルで抽出できる全てのentityをprintしたい時は以下のように記載すれば良い。
all_entity = nlp.get_pipe("ner").labels
print(all_entity)
"ner"によってNamed Entity Recognitionを指定しています。