Fixes the download and usage of the downloaded data

This commit is contained in:
Trenton Holmes authored and Trenton H committed 2022-10-10 08:58:23 -07:00
1 parent 1262c121f0
commit 6523cf0c4b
4 files changed
+25 -20

No files matched your search

+6
View File
@@ -306,6 +306,12 @@ class DocumentClassifier:
from nltk.corpus import stopwords
from nltk.stem import SnowballStemmer
import nltk
# Not really hacky, since it isn't private and is documented, but
# set the search path for NLTK data to the single location it should be in
nltk.data.path = [settings.NLTK_DIR]
if self.stemmer is None:
self.stemmer = SnowballStemmer("english")