Spaces:
Sleeping
Sleeping
BlackTrade
commited on
Commit
·
fc91a69
1
Parent(s):
1cf4b9a
fix type sentiment
Browse files
app.py
CHANGED
@@ -7,9 +7,7 @@ from utils import init_model, custom_predict
|
|
7 |
def main():
|
8 |
st.title("Crypto Market Sentiment Analyzer")
|
9 |
|
10 |
-
raw_text = st.text_area("
|
11 |
-
Elon Musk's company Tesla bought $1.5 billion of BTC and introduced Bitcoin as a payment option""")
|
12 |
-
|
13 |
|
14 |
if st.button("Analyze"):
|
15 |
pipe = init_model(settings.TASK, settings.MODEL_NAME)
|
@@ -21,9 +19,10 @@ def main():
|
|
21 |
# Crypto market is Positive (LABEL_1) or Negative (LABEL_0)
|
22 |
color = "green" if label == "LABEL_1" else "red"
|
23 |
emoji = "😊" if label == "LABEL_1" else "😡"
|
|
|
24 |
|
25 |
st.markdown(
|
26 |
-
f"<h3 style='color:{color};'>Sentiment: {
|
27 |
unsafe_allow_html=True,
|
28 |
)
|
29 |
st.progress(score) # score от 0.0 до 1.0
|
|
|
7 |
def main():
|
8 |
st.title("Crypto Market Sentiment Analyzer")
|
9 |
|
10 |
+
raw_text = st.text_area("The cryptocurrency market is down today due to Trump's latest restrictions on Nvidia")
|
|
|
|
|
11 |
|
12 |
if st.button("Analyze"):
|
13 |
pipe = init_model(settings.TASK, settings.MODEL_NAME)
|
|
|
19 |
# Crypto market is Positive (LABEL_1) or Negative (LABEL_0)
|
20 |
color = "green" if label == "LABEL_1" else "red"
|
21 |
emoji = "😊" if label == "LABEL_1" else "😡"
|
22 |
+
type = "positive" if label == "LABEL_1" else "negative"
|
23 |
|
24 |
st.markdown(
|
25 |
+
f"<h3 style='color:{color};'>Sentiment: {type} {emoji} ({score:.1%})</h3>",
|
26 |
unsafe_allow_html=True,
|
27 |
)
|
28 |
st.progress(score) # score от 0.0 до 1.0
|