-
-
Save BinarySpoon/283fd7dc1fdf32c60c843df115e186a2 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
def process_message(message): | |
# Remove punctuations --> | |
nopunc = [x for x in message if x not in string.punctuation] | |
nopunc = ''.join(nopunc) | |
#Remove stop words --> | |
clean_message = [x for x in nopunc.split() if x.lower() not in stopwords.words('english')] | |
return clean_message |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment