Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -18,6 +18,13 @@ nltk.download('stopwords')
|
|
18 |
ps = PorterStemmer()
|
19 |
scaler = StandardScaler()
|
20 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
21 |
def preprocess_for_bow_and_tfidf(text):
|
22 |
corpus = []
|
23 |
text = re.sub('[^a-zA-Z0-9$£€¥%]',' ',text)
|
@@ -50,12 +57,7 @@ def average_word_vectors(words, model, vocabulary, num_features):
|
|
50 |
|
51 |
return feature_vector
|
52 |
|
53 |
-
|
54 |
-
nb_classifier = joblib.load('./nb_classifier.pkl')
|
55 |
-
tfidf_vectorizer = joblib.load('./tfidf_vectorizer.pkl')
|
56 |
-
random_forest = joblib.load('./random_forest.pkl')
|
57 |
-
word2vec_model = joblib.load('./word2vec_model.pkl')
|
58 |
-
svm_classifier = joblib.load('./svm_classifier.pkl')
|
59 |
|
60 |
def classify(text,choice):
|
61 |
corpus=[text]
|
|
|
18 |
ps = PorterStemmer()
|
19 |
scaler = StandardScaler()
|
20 |
|
21 |
+
vectorizer = joblib.load('./vectorizer.pkl')
|
22 |
+
nb_classifier = joblib.load('./nb_classifier.pkl')
|
23 |
+
tfidf_vectorizer = joblib.load('./tfidf_vectorizer.pkl')
|
24 |
+
random_forest = joblib.load('./random_forest.pkl')
|
25 |
+
word2vec_model = joblib.load('./word2vec_model.pkl')
|
26 |
+
svm_classifier = joblib.load('./svm_classifier.pkl')
|
27 |
+
|
28 |
def preprocess_for_bow_and_tfidf(text):
|
29 |
corpus = []
|
30 |
text = re.sub('[^a-zA-Z0-9$£€¥%]',' ',text)
|
|
|
57 |
|
58 |
return feature_vector
|
59 |
|
60 |
+
|
|
|
|
|
|
|
|
|
|
|
61 |
|
62 |
def classify(text,choice):
|
63 |
corpus=[text]
|