This file contains hidden or 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 spacy | |
| import nltk | |
| import re | |
| from nltk.corpus import stopwords | |
| import unicodedata | |
| import string |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or 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
| string_inp='Hey, @all do youuuuu want to learn Natural Language Processinggg 100% ??' | |
| stopwords_list=stopwords.words('english') | |
| string_no_stopwords = [word for word in string_inp.split() if (word not in stopwords_list) and len(word) > 2] | |
| string_no_stopwords=" ".join(string_no_stopwords) | |
| print('String with stopwords: {} \nString without stopwords and short words: {}'.format(string_inp,string_no_stopwords)) |
This file contains hidden or 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
| string_no_punct=re.sub(r'[^\w\s]','',string_inp) | |
| print('String input:\n{}\n\nString input with no punctuations:\n{}'.format(string_inp,string_no_punct)) |
This file contains hidden or 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
| string_no_punct_string=''.join(p for p in string_inp if p not in string.punctuation) | |
| print('String input:\n{}\n\nString input with no punctuations using string:\n{}'.format(string_inp,string_no_punct_string)) |
This file contains hidden or 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
| string_no_num=re.sub(r'[0-9]','',string_inp) |
OlderNewer