0
私は単語の位置を取得しようとしていると、それは私が試したスペイシー:エンティティタグと単語の位置を取得
import spacy
nlp = spacy.load('en')
doc = nlp(u'London is a big city in the United Kingdom.')
for ent in doc.ents:
print(ent.label_, ent.text)
# GPE London
# GPE United Kingdom
スペイシードキュメントごとに、文を反復処理によってエンティティタグですしかし、どちらもこれらの作業のタグent.iとent.idxで単語の位置を取得し、次のエラー
AttributeError: 'spacy.tokens.span.Span' object has no attribute 'i'