Spaces:
Runtime error
Runtime error
MJ
commited on
Commit
·
f94b58f
1
Parent(s):
84b8051
Fixed format issue with markdown
Browse files
app.py
CHANGED
@@ -13,7 +13,7 @@ def run_model(text_in, model_in):
|
|
13 |
model=model_in)
|
14 |
analysis = classifier(text_in)
|
15 |
st.session_state.sentiment = analysis[0]["label"]
|
16 |
-
st.session_state.score = "{
|
17 |
|
18 |
|
19 |
models_available = {"Roberta Large English": "siebert/sentiment-roberta-large-english",
|
@@ -29,5 +29,5 @@ model_picked = st.selectbox(
|
|
29 |
st.button("Submit", on_click=run_model, args=(
|
30 |
text_input, models_available[model_picked]))
|
31 |
|
32 |
-
st.markdown(body="Sentiment: {}, Score: {}".format(
|
33 |
st.session_state.sentiment, st.session_state.score))
|
|
|
13 |
model=model_in)
|
14 |
analysis = classifier(text_in)
|
15 |
st.session_state.sentiment = analysis[0]["label"]
|
16 |
+
st.session_state.score = "{:.2f}".format(analysis[0]["score"] * 100)
|
17 |
|
18 |
|
19 |
models_available = {"Roberta Large English": "siebert/sentiment-roberta-large-english",
|
|
|
29 |
st.button("Submit", on_click=run_model, args=(
|
30 |
text_input, models_available[model_picked]))
|
31 |
|
32 |
+
st.markdown(body="Sentiment: {}, Confidence Score: {} %".format(
|
33 |
st.session_state.sentiment, st.session_state.score))
|