Closed reckart closed 3 years ago
Sorry, to intervene here, but I believe that this issue needs another little change.
Right now, when I execute the SpacyPosClassifier
pipelines, then all pos tags are empty strings.
The reason are twofold:
tagger
pipelines needs the existence of word embeddings. Hence, one needs to manually call self._model.get_pipe("tok2vec")(doc)
before calling self._model.get_pipe("tagger")(doc)
spacy_token.tag_
instead of spacy_token.pos_
.Please also see my discussion here: https://github.com/explosion/spaCy/issues/7105#
BTW: Unfortunately, the spacy test is not capturing the problem because all PoS-values are empty strings, i.e. not None
and hence, the following assert is not triggered.
for prediction in predictions:
assert getattr(prediction, PREDICTED_FEATURE) is not None
Thank you for the report. I changed the recommender and the test, I hope it works now.
When putting the spacy example shown in the README file into a py file and running it, it produces an error: