Lemmatizer
Der Lemmatizer erzeugt die Grundform von Wörtern. Das Verb "does" wird zu "do", "said" wird zu "say".
import spacy
# Load English model
nlp = spacy.load("en_core_web_sm")
# Define the text and store it on a variable
text = "With Michael Jordan on the team, the Chicago Bulls won 6 NBA championship titles during the 1990s."
# Run the NLP process pipeline and save result on variable 'doc'
doc = nlp(text)
# Iterate over the tokens
for token in doc:
# Print the entity text and its lemma
print(token.text, token.lemma_)Last updated