Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -83,7 +83,12 @@ def classify_sentiment(text):
|
|
| 83 |
processed_text = preprocess_text(text)
|
| 84 |
vectorized_text = vectorization.transform([processed_text])
|
| 85 |
prediction = logistic_model.predict(vectorized_text)[0]
|
| 86 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 87 |
|
| 88 |
# Input and output components for the interface
|
| 89 |
inputs = gr.Textbox(lines=10, label="Enter the text you want to analyze:")
|
|
|
|
| 83 |
processed_text = preprocess_text(text)
|
| 84 |
vectorized_text = vectorization.transform([processed_text])
|
| 85 |
prediction = logistic_model.predict(vectorized_text)[0]
|
| 86 |
+
if prediction == 0:
|
| 87 |
+
return "Negative"
|
| 88 |
+
elif prediction == 1:
|
| 89 |
+
return "Neutral"
|
| 90 |
+
else:
|
| 91 |
+
return "Positive"
|
| 92 |
|
| 93 |
# Input and output components for the interface
|
| 94 |
inputs = gr.Textbox(lines=10, label="Enter the text you want to analyze:")
|