Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,15 +1,21 @@
|
|
|
|
1 |
from transformers import pipeline
|
2 |
import streamlit as st
|
3 |
|
|
|
|
|
|
|
|
|
4 |
x = st.slider("Select a value")
|
5 |
st.write(x, "squared is", x * x)
|
6 |
|
7 |
#@st.cache
|
8 |
-
|
9 |
-
"sentiment-analysis",
|
10 |
-
model="avichr/heBERT_sentiment_analysis",
|
11 |
-
)
|
12 |
st.title("Find sentiment")
|
13 |
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.")
|
14 |
sent = st.text_area("Text", "write here", height = 20)
|
15 |
st.write (sentiment(sent))
|
|
|
|
|
|
|
|
|
|
1 |
+
from HebEMO import HebEMO
|
2 |
from transformers import pipeline
|
3 |
import streamlit as st
|
4 |
|
5 |
+
|
6 |
+
HebEMO_model = HebEMO()
|
7 |
+
|
8 |
+
|
9 |
x = st.slider("Select a value")
|
10 |
st.write(x, "squared is", x * x)
|
11 |
|
12 |
#@st.cache
|
13 |
+
|
|
|
|
|
|
|
14 |
st.title("Find sentiment")
|
15 |
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.")
|
16 |
sent = st.text_area("Text", "write here", height = 20)
|
17 |
st.write (sentiment(sent))
|
18 |
+
interact(HebEMO_model.hebemo, text=sent, plot=fixed(True), input_path=fixed(False), save_results=fixed(False),)
|
19 |
+
interact(HebEMO_model.hebemo, text='ืืืืื ืืคืื ืืืืืฉืจื', plot=fixed(True), input_path=fixed(False), save_results=fixed(False),)
|
20 |
+
st.write (HebEMO_model.hebemo(sent, plot=True))
|
21 |
+
|