# ---
# jupyter:
#   jupytext:
#     text_representation:
#       extension: .py
#       format_name: light
#       format_version: '1.5'
#       jupytext_version: 1.14.4
#   kernelspec:
#     display_name: Python 3
#     language: python
#     name: python3
# ---

from nltk.corpus import stopwords
from nltk.tokenize import word_tokenize

example = "I am Aryan and I love Rick and Morty."
stop_words = set(stopwords.words("english"))

words = word_tokenize(example)

words_filtered = []
for word in words:
    if(word.lower() not in stop_words):
        words_filtered.append(word)

words_filtered



StarcoderdataJupyterScriptsDedupFiltered