<jupyter_start><jupyter_text>We import PorterStemmer library for stemming and word_tokenize to tokenize our words list.<jupyter_code>from nltk.stem import PorterStemmer
from nltk.tokenize import word_tokenize<jupyter_output><empty_output><jupyter_text>We initiate PorterStemmer<jupyter_code>ps = PorterStemmer()<jupyter_output><empty_output><jupyter_text>We set our word list with words that have a root word from Python.<jupyter_code>example_words = ["pythons","pythoner","pythoning","pythoned"]<jupyter_output><empty_output><jupyter_text>We iterate over the word list and print out the stem word for each word in the list.<jupyter_code>for w in example_words:
    print(ps.stem(w))<jupyter_output>python
python
python
python
{'fraction_non_alphanumeric': 0.08264462809917356, 'fraction_numerical': 0.0, 'mean_word_length': 8.95890410958904, 'pattern_counts': {'":': 0, '<': 16, '<?xml version=': 0, '>': 16, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '4', 'dir': 'jupyter-structured-clean-dedup', 'id': '161006', 'license': 'CC0-1.0', 'n_tokens_mistral': 253, 'n_tokens_neox': 243, 'n_words': 61, 'path': 'nltk/Stemming.ipynb', 'repo_name': 'WMRamadan/python-examples', 'size': '726'}