Spaces:
Runtime error
Runtime error
Ryan Kim
commited on
Commit
·
7f3c646
1
Parent(s):
7883937
trying to make programmatic way to store sentiment analysis label dictionaries for each type
Browse files- src/main.py +6 -3
src/main.py
CHANGED
@@ -38,7 +38,8 @@ model_option = st.selectbox(
|
|
38 |
(
|
39 |
"cardiffnlp/twitter-roberta-base-sentiment",
|
40 |
"finiteautomata/beto-sentiment-analysis",
|
41 |
-
"bhadresh-savani/distilbert-base-uncased-emotion"
|
|
|
42 |
),
|
43 |
on_change=model_change,
|
44 |
key="model_name"
|
@@ -53,8 +54,10 @@ if submit:
|
|
53 |
to_eval = placeholder
|
54 |
else:
|
55 |
to_eval = text_input.strip()
|
56 |
-
st.write("You entered:
|
57 |
-
st.
|
|
|
|
|
58 |
result = st.session_state.model(to_eval)
|
59 |
label = result[0]['label']
|
60 |
score = result[0]['score']
|
|
|
38 |
(
|
39 |
"cardiffnlp/twitter-roberta-base-sentiment",
|
40 |
"finiteautomata/beto-sentiment-analysis",
|
41 |
+
"bhadresh-savani/distilbert-base-uncased-emotion",
|
42 |
+
"siebert/sentiment-roberta-large-english"
|
43 |
),
|
44 |
on_change=model_change,
|
45 |
key="model_name"
|
|
|
54 |
to_eval = placeholder
|
55 |
else:
|
56 |
to_eval = text_input.strip()
|
57 |
+
st.write("You entered:")
|
58 |
+
st.markdown("> {}".format(to_eval))
|
59 |
+
st.write("Using the NLP model:")
|
60 |
+
st.markdown("> {}".format(st.session_state.model_name))
|
61 |
result = st.session_state.model(to_eval)
|
62 |
label = result[0]['label']
|
63 |
score = result[0]['score']
|