added downloading nltk stop words
Browse files- clean_text_model.py +3 -0
clean_text_model.py
CHANGED
@@ -3,10 +3,13 @@ import warnings
|
|
3 |
from nltk.corpus import stopwords
|
4 |
from nltk.stem import WordNetLemmatizer
|
5 |
from bs4 import BeautifulSoup
|
|
|
|
|
6 |
|
7 |
class TextCleaner:
|
8 |
def __init__(self):
|
9 |
warnings.filterwarnings("ignore")
|
|
|
10 |
self.stop_words = set(stopwords.words('english'))
|
11 |
self.lemmatizer = WordNetLemmatizer()
|
12 |
|
|
|
3 |
from nltk.corpus import stopwords
|
4 |
from nltk.stem import WordNetLemmatizer
|
5 |
from bs4 import BeautifulSoup
|
6 |
+
import nltk
|
7 |
+
|
8 |
|
9 |
class TextCleaner:
|
10 |
def __init__(self):
|
11 |
warnings.filterwarnings("ignore")
|
12 |
+
nltk.download('stopwords')
|
13 |
self.stop_words = set(stopwords.words('english'))
|
14 |
self.lemmatizer = WordNetLemmatizer()
|
15 |
|