Spaces:
Running
Running
Updateda app.py.
Browse files
app.py
CHANGED
@@ -26,11 +26,13 @@ def process_text(text):
|
|
26 |
vectorizer = CountVectorizer()
|
27 |
def vectorize_text(text):
|
28 |
text = process_text(text)
|
29 |
-
|
|
|
30 |
|
31 |
# Load model from pickle file
|
32 |
model = pickle.load(open(lr_filename, 'rb'))
|
33 |
|
|
|
34 |
def predict(text):
|
35 |
text = vectorize_text(text)
|
36 |
prediction = model.predict(text)
|
|
|
26 |
vectorizer = CountVectorizer()
|
27 |
def vectorize_text(text):
|
28 |
text = process_text(text)
|
29 |
+
text = vectorizer.fit_transform([text])
|
30 |
+
return text
|
31 |
|
32 |
# Load model from pickle file
|
33 |
model = pickle.load(open(lr_filename, 'rb'))
|
34 |
|
35 |
+
|
36 |
def predict(text):
|
37 |
text = vectorize_text(text)
|
38 |
prediction = model.predict(text)
|