Spaces:
Paused
Paused
Update functions_preprocess.py
Browse files- functions_preprocess.py +3 -0
functions_preprocess.py
CHANGED
@@ -19,6 +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 |
def fit_model(pipeline, x_train, y_train, x_test, y_test):
|
23 |
pipeline.fit(x_train, y_train)
|
24 |
return ConfusionMatrixDisplay.from_estimator(pipeline, x_test, y_test, normalize="true")
|
|
|
19 |
print(f'resource {res_path} not found. Downloading now...')
|
20 |
nltk.download(res_name)
|
21 |
|
22 |
+
download_if_non_existent('corpora/stopwords', 'stopwords', 'taggers/averaged_perceptron_tagger',
|
23 |
+
'averaged_perceptron_tagger', 'corpora/wordnet', 'wordnet', 'punkt, omw-1.4')
|
24 |
+
|
25 |
def fit_model(pipeline, x_train, y_train, x_test, y_test):
|
26 |
pipeline.fit(x_train, y_train)
|
27 |
return ConfusionMatrixDisplay.from_estimator(pipeline, x_test, y_test, normalize="true")
|