Skip to content

Instantly share code, notes, and snippets.

@konverner
Last active November 11, 2022 11:57
Show Gist options
  • Save konverner/6b62142779f95a1d78a4ba6d1d84c456 to your computer and use it in GitHub Desktop.
Save konverner/6b62142779f95a1d78a4ba6d1d84c456 to your computer and use it in GitHub Desktop.
text preprocessing
from gensim.parsing.preprocessing import preprocess_string
from gensim.utils import any2unicode
def preprocess(text: str) -> list:
text = any2unicode(text).lower()
text = preprocess_string(text)
return text
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment