b22ee075 commited on
Commit
ca36277
·
verified ·
1 Parent(s): 3e7df15

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -1
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
- return prediction
 
 
 
 
 
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:")