Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

spans is None #115

Open
lolomap opened this issue Nov 22, 2022 · 0 comments
Open

spans is None #115

lolomap opened this issue Nov 22, 2022 · 0 comments

Comments

@lolomap
Copy link

lolomap commented Nov 22, 2022

Example not working because doc.spans is None (TypeError: 'NoneType' object is not iterable)

from natasha import NamesExtractor, MorphVocab, PER, Doc

extractor = NamesExtractor(MorphVocab())

Text = 'Посол Израиля на Украине Йоэль Лион признался, что пришел в шок, узнав о решении властей Львовской области объявить 2019 год годом лидера запрещенной в России Организации украинских националистов (ОУН) Степана Бандеры.'
doc = Doc(Text)

for span in doc.spans:
if span.type == PER:
	span.extract_fact(extractor)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant