enlp.processing.stdtools.nltk_stem_no¶
-
enlp.processing.stdtools.
nltk_stem_no
(model, text)[source]¶ Return string of stemmed text using NLTK’s Norwegian snowball stemmer
Stemming is a technique to remove affixes from a word, ending up with the stem. For example, the stem of cooking is cook.
- Parameters
- model
spacy.lang
SpaCy language model
- text
str
text string on which to remove stopwords
- model
- Returns
- updated_text
str
Updated version of input string where words have been stemmed
- updated_text
Notes
String output is to allow piping between functions to return words as a list use: to_list(stem_norwegian(…))
Examples
>>> import spacy >>> lang_mod = spacy.load('nb_dep_ud_sm') >>> text = 'Den raske brune reven hoppet over den late hunden.' >>> print (nltk_stem_no(lang_mod,text)) den rask brun rev hopp over den lat hund.