Spaces:
Sleeping
Sleeping
Harelkarni
commited on
Commit
•
d751ea4
1
Parent(s):
53c15f8
Update app.py
Browse files
app.py
CHANGED
@@ -12,13 +12,24 @@ url_timeGpt = "https://ofirmatzlawi-fin-proj-docker-1.hf.space/ticker/"
|
|
12 |
|
13 |
|
14 |
def get_max_sentiment(row):
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
return 'neu'
|
20 |
else:
|
21 |
-
return
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
22 |
|
23 |
|
24 |
def get_sentiment_data(stock_info):
|
|
|
12 |
|
13 |
|
14 |
def get_max_sentiment(row):
|
15 |
+
if row["sentiment_score"] > 0.05: # Threshold for positive sentiment
|
16 |
+
return "positive"
|
17 |
+
elif row["sentiment_score"] < -0.05: # Threshold for negative sentiment
|
18 |
+
return "negative"
|
|
|
19 |
else:
|
20 |
+
return "neutral"
|
21 |
+
|
22 |
+
|
23 |
+
|
24 |
+
|
25 |
+
|
26 |
+
#max_value = max(row['neg'], row['neu'], row['pos'])
|
27 |
+
#if max_value == row['neg']:
|
28 |
+
# return 'neg'
|
29 |
+
#elif max_value == row['neu']:
|
30 |
+
# return 'neu'
|
31 |
+
#else:
|
32 |
+
# return 'pos'
|
33 |
|
34 |
|
35 |
def get_sentiment_data(stock_info):
|