Lemmatization using DeepPavlov pre-trained models

I am total newbie, so sorry for a stupid question. I am trying to lemmatize some russian sentences using pre-trained models in DeepPavlov. Apparently I don’t understand how it works. What I do (with no success):

from deeppavlov.models.preprocessors.russian_lemmatizer import PymorphyRussianLemmatizer
p=PymorphyRussianLemmatizer()
p(['STRING GOES HERE'])

What should I do just to convert the string to list of stems/lemmas?

Thank you!!

Hey @chapkovski , Thank you for your interest!

The snippet is almost right, just put the input in the double brackets.

p([['гулял']])

Let me know if you need a further assistance.

Thanks a lot for the brisk answer! But it seems I have to pass it through tokenizer first, right? So I can’t just feed a sentence there like ‘Я гулял по улице’?

1 Like

Ok, just ignore that, I realized I just need to tokenize it first using

from deeppavlov.models.tokenizers.ru_tokenizer import RussianTokenizer
1 Like