Spaces:
Running
Running
Update functions_preprocess.py
Browse files- functions_preprocess.py +3 -2
functions_preprocess.py
CHANGED
@@ -19,8 +19,9 @@ def download_if_non_existent(res_path, res_name):
|
|
19 |
print(f'resource {res_path} not found. Downloading now...')
|
20 |
nltk.download(res_name)
|
21 |
|
22 |
-
download_if_non_existent('corpora/stopwords', 'stopwords'
|
23 |
-
|
|
|
24 |
|
25 |
def fit_model(pipeline, x_train, y_train, x_test, y_test):
|
26 |
pipeline.fit(x_train, y_train)
|
|
|
19 |
print(f'resource {res_path} not found. Downloading now...')
|
20 |
nltk.download(res_name)
|
21 |
|
22 |
+
download_if_non_existent('corpora/stopwords', 'stopwords')
|
23 |
+
download_if_non_existent('taggers/averaged_perceptron_tagger', 'averaged_perceptron_tagger')
|
24 |
+
download_if_non_existent('corpora/wordnet', 'wordnet')
|
25 |
|
26 |
def fit_model(pipeline, x_train, y_train, x_test, y_test):
|
27 |
pipeline.fit(x_train, y_train)
|