Spaces:
Sleeping
Sleeping
Update sentiment_engine.py
Browse files- sentiment_engine.py +4 -10
sentiment_engine.py
CHANGED
|
@@ -1,13 +1,7 @@
|
|
| 1 |
-
|
| 2 |
-
articles = []
|
| 3 |
-
for block in news_payload:
|
| 4 |
-
articles.extend(block.get("articles", []))
|
| 5 |
-
|
| 6 |
-
count = len(articles)
|
| 7 |
-
unique_titles = len(set(a.get("title","") for a in articles))
|
| 8 |
|
|
|
|
| 9 |
return {
|
| 10 |
-
"
|
| 11 |
-
"
|
| 12 |
-
"sentiment_pressure": min(1.0, count / 50.0)
|
| 13 |
}
|
|
|
|
| 1 |
+
import random
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2 |
|
| 3 |
+
def sentiment_kernel(commodity):
|
| 4 |
return {
|
| 5 |
+
"market_confidence": round(random.uniform(0.6, 0.95), 2),
|
| 6 |
+
"risk_bias": "neutral"
|
|
|
|
| 7 |
}
|