Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -18,16 +18,17 @@ import nltk
|
|
| 18 |
nltk.download('stopwords')
|
| 19 |
nltk.download('punkt')
|
| 20 |
|
|
|
|
| 21 |
model = joblib.load('model.bin')
|
| 22 |
|
| 23 |
-
#
|
| 24 |
-
vectorizer =
|
| 25 |
|
| 26 |
def remove_punctuation(text):
|
| 27 |
punctuation_free = "".join([i for i in text if i not in string.punctuation])
|
| 28 |
return punctuation_free
|
| 29 |
|
| 30 |
-
def test_model(text
|
| 31 |
# Convert text to lowercase
|
| 32 |
text = text.lower()
|
| 33 |
|
|
|
|
| 18 |
nltk.download('stopwords')
|
| 19 |
nltk.download('punkt')
|
| 20 |
|
| 21 |
+
# Load the trained model
|
| 22 |
model = joblib.load('model.bin')
|
| 23 |
|
| 24 |
+
# Load the pre-trained vectorizer
|
| 25 |
+
vectorizer = joblib.load('vectorizer.bin')
|
| 26 |
|
| 27 |
def remove_punctuation(text):
|
| 28 |
punctuation_free = "".join([i for i in text if i not in string.punctuation])
|
| 29 |
return punctuation_free
|
| 30 |
|
| 31 |
+
def test_model(text):
|
| 32 |
# Convert text to lowercase
|
| 33 |
text = text.lower()
|
| 34 |
|