Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -16,22 +16,12 @@ def predict_emotion(text):
|
|
| 16 |
return "Positive Emotion" if prediction == 1 else "Negative Emotion"
|
| 17 |
|
| 18 |
# Streamlit app layout
|
| 19 |
-
st.title("ChefBERT Emotion Classifier")
|
| 20 |
-
|
| 21 |
-
st.write("CHEFBERT will predict whether the input sentence is positive or negative .")
|
| 22 |
|
| 23 |
# Input box
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
with placeholder.form("emotion_form"):
|
| 27 |
-
user_input = st.text_input("Input Sentence", "")
|
| 28 |
-
submit_button = st.form_submit_button(label="Submit")
|
| 29 |
|
| 30 |
-
|
| 31 |
-
if submit_button and user_input:
|
| 32 |
result = predict_emotion(user_input)
|
| 33 |
st.write("Prediction: ", result)
|
| 34 |
-
|
| 35 |
-
# Clear the input field after prediction
|
| 36 |
-
placeholder.empty()
|
| 37 |
-
placeholder.text_input("Input Sentence", "")
|
|
|
|
| 16 |
return "Positive Emotion" if prediction == 1 else "Negative Emotion"
|
| 17 |
|
| 18 |
# Streamlit app layout
|
| 19 |
+
st.title("ChefBERT Emotion Classifier")
|
| 20 |
+
st.write("Enter a sentence and ChefBERT will predict whether the emotion is positive or negative.")
|
|
|
|
| 21 |
|
| 22 |
# Input box
|
| 23 |
+
user_input = st.text_input("Input Sentence", "")
|
|
|
|
|
|
|
|
|
|
|
|
|
| 24 |
|
| 25 |
+
if user_input:
|
|
|
|
| 26 |
result = predict_emotion(user_input)
|
| 27 |
st.write("Prediction: ", result)
|
|
|
|
|
|
|
|
|
|
|
|