Spaces:
Sleeping
Sleeping
BlackTrade
commited on
Commit
·
1cf4b9a
1
Parent(s):
e72169b
fix raw_text, and key for positive
Browse files
app.py
CHANGED
@@ -7,7 +7,8 @@ from utils import init_model, custom_predict
|
|
7 |
def main():
|
8 |
st.title("Crypto Market Sentiment Analyzer")
|
9 |
|
10 |
-
raw_text = st.text_area("Enter Text Here", "Type
|
|
|
11 |
|
12 |
|
13 |
if st.button("Analyze"):
|
@@ -17,8 +18,9 @@ def main():
|
|
17 |
label = result[0]["label"]
|
18 |
score = result[0]["score"]
|
19 |
|
20 |
-
|
21 |
-
|
|
|
22 |
|
23 |
st.markdown(
|
24 |
f"<h3 style='color:{color};'>Sentiment: {label} {emoji} ({score:.1%})</h3>",
|
|
|
7 |
def main():
|
8 |
st.title("Crypto Market Sentiment Analyzer")
|
9 |
|
10 |
+
raw_text = st.text_area("Enter Text Here", """Type for example:
|
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"):
|
|
|
18 |
label = result[0]["label"]
|
19 |
score = result[0]["score"]
|
20 |
|
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: {label} {emoji} ({score:.1%})</h3>",
|
config.py
CHANGED
@@ -2,6 +2,9 @@ from pydantic_settings import BaseSettings
|
|
2 |
|
3 |
|
4 |
class Settings(BaseSettings):
|
|
|
|
|
|
|
5 |
TASK: str = "sentiment-analysis"
|
6 |
MODEL_NAME: str = "kk08/CryptoBERT"
|
7 |
TITLE: str = "Crypto Market Sentiment Analyzer"
|
|
|
2 |
|
3 |
|
4 |
class Settings(BaseSettings):
|
5 |
+
"""
|
6 |
+
Crypto market is Positive (LABEL_1) or Negative (LABEL_0)
|
7 |
+
"""
|
8 |
TASK: str = "sentiment-analysis"
|
9 |
MODEL_NAME: str = "kk08/CryptoBERT"
|
10 |
TITLE: str = "Crypto Market Sentiment Analyzer"
|