enlp.processing.stdtools.rm_punctuation¶
-
enlp.processing.stdtools.
rm_punctuation
(model, text)[source]¶ Return string free of punctuation
- 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 punctuation has been removed
- updated_text
Notes
String output is to allow piping between functions to return words as a list use: to_list(remove_punctuation(…))
Examples
>>> import spacy >>> lang_mod = spacy.load('en_core_web_md') >>> text = 'I better have passed that test - it is 90 percent of the class grade.' >>> print (rm_punctuation(lang_mod, text)) I better have passed that test it is 90 percent of the class grade