<jupyter_start><jupyter_text><jupyter_code>import nltk
#nltk.download('all')
from nltk.corpus import stopwords
stopw=[i for i in stopwords.words('english')]
stopw[:10]
from nltk.tokenize import sent_tokenize, word_tokenize
from nltk.stem import WordNetLemmatizer
from nltk.stem import PorterStemmer #for stemming

data= 'i am what i am please leave me alone i am not free go from here right now'
wtokez=word_tokenize(data)
removesw=[word for word in wtokez if word not in stopw]
removesw
#stemming
ps=PorterStemmer()
for i in removesw:
  print('stemming of word is', ps.stem(i))
#lemmatization
len=WordNetLemmatizer()
for i in removesw:
  print('lemma of word is',len.lemmatize(i))<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.09563994374120956, 'fraction_numerical': 0.0028129395218002813, 'mean_word_length': 6.655913978494624, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '333565', 'license': 'Apache-2.0', 'n_tokens_mistral': 276, 'n_tokens_neox': 263, 'n_words': 80, 'path': 'nlp.ipynb', 'repo_name': 'akashcode37/Akash37', 'size': '711'}