fixed
Browse files
app.py
CHANGED
@@ -13,11 +13,8 @@ from nltk.tokenize import word_tokenize
|
|
13 |
from nltk.corpus import stopwords
|
14 |
from nltk.stem import WordNetLemmatizer
|
15 |
|
16 |
-
#
|
17 |
-
nltk.
|
18 |
-
|
19 |
-
# Download the stopwords if not already present
|
20 |
-
nltk.download('stopwords', download_dir='/Users/kritsadakruapat/Desktop/Political-Fake-News-Detector-NLP/Fake_News_Detection/nltk_data')
|
21 |
|
22 |
# Preprocessing helper functions
|
23 |
|
@@ -150,4 +147,3 @@ if url:
|
|
150 |
|
151 |
# Preprocess and predict
|
152 |
predict_with_threshold(scraped_text)
|
153 |
-
|
|
|
13 |
from nltk.corpus import stopwords
|
14 |
from nltk.stem import WordNetLemmatizer
|
15 |
|
16 |
+
# Download NLTK stopwords dynamically without specifying a custom path
|
17 |
+
nltk.download('stopwords')
|
|
|
|
|
|
|
18 |
|
19 |
# Preprocessing helper functions
|
20 |
|
|
|
147 |
|
148 |
# Preprocess and predict
|
149 |
predict_with_threshold(scraped_text)
|
|