Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def lemmatize(text):
- m = Mystem()
- lemm_list = m.lemmatize(text)
- lemm_text = "".join(lemm_list)
- return lemm_text
- def clear_text(text):
- clear_text = re.sub(r'[^a-zA-Z ]', ' ', text)
- clear_text = clear_text.split()
- clear_text = " ".join(clear_text)
- return clear_text
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement