Skip to content

Instantly share code, notes, and snippets.

@davidlenz
Created May 25, 2018 09:55
Show Gist options
  • Save davidlenz/05b1b3eb5428fe461238e722c3d22711 to your computer and use it in GitHub Desktop.
Save davidlenz/05b1b3eb5428fe461238e722c3d22711 to your computer and use it in GitHub Desktop.
Usage of german textblob lemmatizer. Takes a list of strings and returns the lemmatized version.
from textblob_de import TextBlobDE as TextBlob
def textblob_lemmatizer(doclist):
"""Takes a list of strings as input and returns a list of lemmatized strings"""
docs=[]
for doc in doclist:
blob = TextBlob(doc)
docs.append(' '.join(list(blob.words.lemmatize())))
return docs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment