Hi! The following doesn't work:
import spacy
nlp = spacy.load('en')
print(max(lex.lex_id for lex in nlp.vocab) + 1)
print([lex.text for lex in nlp.vocab if not lex.has_vector])
It gives errors like:
AttributeError: 'spacy.lexeme.Lexeme' object has no attribute 'lex_id'
AttributeError: 'spacy.lexeme.Lexeme' object has no attribute 'text'
But Lexeme should have attributes text and lex_id according to the documentation.
spacy.info()
Info about spaCy
spaCy version 1.8.2
Location /home/dan/miniconda/envs/py36/lib/python3.6/site-packages/spacy
Platform Linux-4.8.0-49-generic-x86_64-with-debian-stretch-sid
Python version 3.6.0
Installed models en, en_core_web_md
Thanks. Workaround for now:
lex.text you can use lex.orth_lex.lex_id you can use lex.rankThis thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Most helpful comment
Thanks. Workaround for now:
lex.textyou can uselex.orth_lex.lex_idyou can uselex.rank