spacy frenc hlemmatizer code example
Example 1: spacy frenc hlemmatizer
pip3 install spacy
python3 -m spacy download fr_core_news_md
import spacy
nlp = spacy.load('fr_core_news_md')
doc = nlp(u"voudrais non animaux yeux dors couvre.")
for token in doc:
print(token, token.lemma_)
Example 2: spacy frenc hlemmatizer
>>> from nltk.stem.snowball import FrenchStemmer
>>> stemmer = FrenchStemmer()
>>> stemmer.stem('voudrais')
u'voudr'
>>> stemmer.stem('animaux')
u'animal'
>>> stemmer.stem('yeux')
u'yeux'
>>> stemmer.stem('dors')
u'dor'
>>> stemmer.stem('couvre')
u'couvr'