Advertisement
Guest User

Untitled

a guest
Feb 26th, 2020
1,414
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.31 KB | None | 0 0
  1. def lemmatize(text):
  2. m = Mystem()
  3. lemm_list = m.lemmatize(text)
  4. lemm_text = "".join(lemm_list)
  5.  
  6. return lemm_text
  7.  
  8.  
  9. def clear_text(text):
  10. clear_text = re.sub(r'[^a-zA-Z ]', ' ', text)
  11. clear_text = clear_text.split()
  12. clear_text = " ".join(clear_text)
  13. return clear_text
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement