Spaces:
Runtime error
Runtime error
ruchitoshniwal
commited on
Commit
•
66d433b
1
Parent(s):
fd1ef05
Update app.py
Browse files
app.py
CHANGED
@@ -62,19 +62,19 @@ def main():
|
|
62 |
|
63 |
st.subheader("Predictions from EmoRoBERTa - BERT based pre-trained model (28 emotions)")
|
64 |
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
|
79 |
if __name__ == '__main__':
|
80 |
main()
|
|
|
62 |
|
63 |
st.subheader("Predictions from EmoRoBERTa - BERT based pre-trained model (28 emotions)")
|
64 |
|
65 |
+
col3,col4 = st.columns(2)
|
66 |
+
emotion_dataframe_emoroberta, predicted_emotion_emoroberta, prediction_probability_emoroberta = predict_emotions_and_score_emoroberta(raw_text)
|
67 |
+
with col3:
|
68 |
+
st.success("Emotion")
|
69 |
+
st.write(predicted_emotion_emoroberta)
|
70 |
+
|
71 |
+
with col4:
|
72 |
+
st.success("Emotion Score")
|
73 |
+
st.write("{:.4f}".format(np.max(prediction_probability_emoroberta)))
|
74 |
+
st.success("Prediction Probability")
|
75 |
+
emotion_dataframe_emoroberta.columns = ["emotions","probability"]
|
76 |
+
fig = alt.Chart(emotion_dataframe_emoroberta).mark_bar().encode(y=alt.Y('emotions', sort='-x'),x='probability',color='emotions')
|
77 |
+
st.altair_chart(fig,use_container_width=True)
|
78 |
|
79 |
if __name__ == '__main__':
|
80 |
main()
|