Files
post-moderation/ai-moderation/app/moderation/profanity/lemmatizer.py
2026-07-28 01:10:11 +03:00

20 lines
235 B
Python

import pymorphy3
class Lemmatizer:
def __init__(self):
self.morph = pymorphy3.MorphAnalyzer()
def normalize(
self,
word: str
) -> str:
result = self.morph.parse(word)
return result[0].normal_form