-
-
Save amankharwal/eef1e4ff66d87b51b7622f5301384cf4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import nltk | |
from nltk.corpus import stopwords | |
from nltk.tokenize import word_tokenize | |
nltk.download('stopwords') | |
nltk.download('punkt') | |
text = "Hi, My name is Aman Kharwal, I am here to guide you to your journey in Machine Learning for free." | |
tokens = word_tokenize(text) | |
tokenization = [word for word in tokens if not word in stopwords.words('english')] | |
print(tokens) | |
print(tokenization) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment