setting pymorphy2_lemmatize
vs pymorphy2_lookup_lemmatize
in UkrainianLemmatizer
#11609
-
I would like to run I can't quite find where it is called. I cannot see Here is my attempt that fails: nlp = spacy.load("uk_core_news_lg")
nlp("якусь")[0].lemma_
# "якусь"
dict(nlp.pipeline)["lemmatizer"].pymorphy2_lemmatize(nlp("якусь")[0])
# ['якусь']
dict(nlp.pipeline)["lemmatizer"].pymorphy2_lookup_lemmatize(nlp("якусь")[0])
# ['якийсь']
# remove un-used pipeline
nlp.remove_pipe("ner")
old_lemmatizer = nlp.remove_pipe("lemmatizer")
lemmatizer = nlp.add_pipe("lemmatizer", config=
{ #'factory': 'lemmatizer',
'mode': 'pymorphy2_lookup',
'model': None,
'overwrite': True,
# 'scorer': {'@scorers': 'spacy.lemmatizer_scorer.v1'}
})
nlp("якусь")[0].lemma_
I tried adding This also does not seem to help This may relate to a complexity of the RussianLemmatizer initalization Would you advise how to initialize it properly in this setting? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Thanks for the report! I think the problem is that the |
Beta Was this translation helpful? Give feedback.
Thanks for the report! I think the problem is that the
pymorphy2_lookup
mode isn't accounted for in__init__
in either lemmatizer.