Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -53,7 +53,21 @@ elif option == "Emotion Detection":
|
|
| 53 |
text=st.text_area("Enter your text")
|
| 54 |
if st.button("Submit"):
|
| 55 |
if text:
|
| 56 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 57 |
else:
|
| 58 |
st.write("Please enter text.")
|
| 59 |
|
|
|
|
| 53 |
text=st.text_area("Enter your text")
|
| 54 |
if st.button("Submit"):
|
| 55 |
if text:
|
| 56 |
+
emotion=emopipe(text)[0]["label"]
|
| 57 |
+
if emotion = "sadness":
|
| 58 |
+
st.write("Emotion : ",emotion,"π’")
|
| 59 |
+
elif emotion = "joy":
|
| 60 |
+
st.write("Emotion : ",emotion,"π")
|
| 61 |
+
elif emotion = "fear":
|
| 62 |
+
st.write("Emotion : ",emotion,"π¨")
|
| 63 |
+
elif emotion = "anger":
|
| 64 |
+
st.write("Emotion : ",emotion,"π‘")
|
| 65 |
+
elif emotion = "neutral":
|
| 66 |
+
st.write("Emotion : ",emotion,"π")
|
| 67 |
+
elif emotion = "disgust":
|
| 68 |
+
st.write("Emotion : ",emotion,"π€’")
|
| 69 |
+
elif emotion = "surprise":
|
| 70 |
+
st.write("Emotion : ",emotion,"π²")
|
| 71 |
else:
|
| 72 |
st.write("Please enter text.")
|
| 73 |
|