Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -2,16 +2,17 @@ from HebEMO import HebEMO
|
|
2 |
from transformers import pipeline
|
3 |
import streamlit as st
|
4 |
import matplotlib.pyplot as plt
|
5 |
-
import plotly.express as px
|
6 |
|
7 |
|
|
|
8 |
HebEMO_model = HebEMO()
|
9 |
|
10 |
|
11 |
x = st.slider("Select a value")
|
12 |
st.write(x, "squared is", x * x)
|
13 |
|
14 |
-
|
15 |
|
16 |
st.title("Find sentiment")
|
17 |
st.write("HebEMO is a tool to detect polarity and extract emotions from Hebrew user-generated content (UGC), which was trained on a unique Covid-19 related dataset that we collected and annotated. HebEMO yielded a high performance of weighted average F1-score = 0.96 for polarity classification. Emotion detection reached an F1-score of 0.78-0.97, with the exception of *surprise*, which the model failed to capture (F1 = 0.41). These results are better than the best-reported performance, even when compared to the English language.")
|
@@ -23,12 +24,12 @@ for emo in hebEMO_df.columns[1::2]:
|
|
23 |
hebEMO[emo] = abs(hebEMO_df[emo]-(1-hebEMO_df['confidence_'+emo]))
|
24 |
|
25 |
|
26 |
-
fig = px.bar_polar(hebEMO.melt(), r="value", theta="variable",
|
27 |
-
color="variable",
|
28 |
-
template="ggplot2",
|
29 |
-
)
|
30 |
|
31 |
-
st.plotly_chart(fig, use_container_width=True)
|
32 |
st.write (hebEMO)
|
33 |
|
34 |
|
|
|
2 |
from transformers import pipeline
|
3 |
import streamlit as st
|
4 |
import matplotlib.pyplot as plt
|
5 |
+
# import plotly.express as px
|
6 |
|
7 |
|
8 |
+
@st.cache
|
9 |
HebEMO_model = HebEMO()
|
10 |
|
11 |
|
12 |
x = st.slider("Select a value")
|
13 |
st.write(x, "squared is", x * x)
|
14 |
|
15 |
+
|
16 |
|
17 |
st.title("Find sentiment")
|
18 |
st.write("HebEMO is a tool to detect polarity and extract emotions from Hebrew user-generated content (UGC), which was trained on a unique Covid-19 related dataset that we collected and annotated. HebEMO yielded a high performance of weighted average F1-score = 0.96 for polarity classification. Emotion detection reached an F1-score of 0.78-0.97, with the exception of *surprise*, which the model failed to capture (F1 = 0.41). These results are better than the best-reported performance, even when compared to the English language.")
|
|
|
24 |
hebEMO[emo] = abs(hebEMO_df[emo]-(1-hebEMO_df['confidence_'+emo]))
|
25 |
|
26 |
|
27 |
+
# fig = px.bar_polar(hebEMO.melt(), r="value", theta="variable",
|
28 |
+
# color="variable",
|
29 |
+
# template="ggplot2",
|
30 |
+
# )
|
31 |
|
32 |
+
# st.plotly_chart(fig, use_container_width=True)
|
33 |
st.write (hebEMO)
|
34 |
|
35 |
|