lynn-twinkl commited on
Commit ·
e4cb412
1
Parent(s): ebf2273
Added snippet to downlaod stopwords if not found
Browse files
functions/topicModeling_contentRequests.py
CHANGED
|
@@ -110,6 +110,11 @@ Topic Modeling with BERTopic
|
|
| 110 |
-----------------------------
|
| 111 |
"""
|
| 112 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 113 |
stopwords = list(stopwords.words('english')) + [
|
| 114 |
'activities',
|
| 115 |
'activity',
|
|
|
|
| 110 |
-----------------------------
|
| 111 |
"""
|
| 112 |
|
| 113 |
+
try:
|
| 114 |
+
nltk.data.find("corpora/stopwords")
|
| 115 |
+
except LookupError:
|
| 116 |
+
nltk.download("stopwords")
|
| 117 |
+
|
| 118 |
stopwords = list(stopwords.words('english')) + [
|
| 119 |
'activities',
|
| 120 |
'activity',
|