Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -6,16 +6,13 @@ classifier = pipeline("sentiment-analysis", model="michellejieli/emotion_text_cl
|
|
| 6 |
st.title("Emotion in Text Classifier")
|
| 7 |
st.write("Enter any sentence, and the model will predict the expressed emotion in it!")
|
| 8 |
|
| 9 |
-
user_input = st.text_area("
|
| 10 |
|
| 11 |
-
if st.button("
|
| 12 |
-
if user_input.strip():
|
| 13 |
result = classifier(user_input)
|
| 14 |
emotion = result[0]['label']
|
| 15 |
score = result[0]['score']
|
| 16 |
|
| 17 |
st.write(f"**Predicted Emotion:** {emotion}")
|
| 18 |
-
st.write(f"**Confidence Score:** {score:.
|
| 19 |
-
else:
|
| 20 |
-
st.write("Please enter some text to analyze.")
|
| 21 |
|
|
|
|
| 6 |
st.title("Emotion in Text Classifier")
|
| 7 |
st.write("Enter any sentence, and the model will predict the expressed emotion in it!")
|
| 8 |
|
| 9 |
+
user_input = st.text_area("Type your prompt here.", "...")
|
| 10 |
|
| 11 |
+
if st.button("Predict Emotion"):
|
|
|
|
| 12 |
result = classifier(user_input)
|
| 13 |
emotion = result[0]['label']
|
| 14 |
score = result[0]['score']
|
| 15 |
|
| 16 |
st.write(f"**Predicted Emotion:** {emotion}")
|
| 17 |
+
st.write(f"**Confidence Score:** {score:.2f}")
|
|
|
|
|
|
|
| 18 |
|