From 547997cbd069e9b958b12a8da38b3a4a257e29e5 Mon Sep 17 00:00:00 2001 From: Openclaw Date: Sun, 29 Mar 2026 01:12:24 -0700 Subject: Fix valuation methodology and documentation --- components/news.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'components/news.py') diff --git a/components/news.py b/components/news.py index cea678e..522826c 100644 --- a/components/news.py +++ b/components/news.py @@ -7,11 +7,11 @@ from services.fmp_service import get_company_news as get_fmp_news def _sentiment_badge(sentiment: str) -> str: badges = { - "bullish": "🟢 Bullish", - "bearish": "🔴 Bearish", - "neutral": "⚪ Neutral", + "bullish": "🟢 Bullish (heuristic)", + "bearish": "🔴 Bearish (heuristic)", + "neutral": "⚪ Neutral (heuristic)", } - return badges.get(sentiment.lower(), "⚪ Neutral") + return badges.get(sentiment.lower(), "⚪ Neutral (heuristic)") def _classify_sentiment(article: dict) -> str: @@ -52,8 +52,9 @@ def render_news(ticker: str): col1.metric("Articles (7d)", buzz.get("articlesInLastWeek", "—")) bull_pct = score.get("bullishPercent") bear_pct = score.get("bearishPercent") - col2.metric("Bullish %", f"{bull_pct * 100:.1f}%" if bull_pct else "—") - col3.metric("Bearish %", f"{bear_pct * 100:.1f}%" if bear_pct else "—") + col2.metric("Bullish %", f"{bull_pct * 100:.1f}%" if bull_pct is not None else "—") + col3.metric("Bearish %", f"{bear_pct * 100:.1f}%" if bear_pct is not None else "—") + st.caption("Sentiment tags below are rule-based headline heuristics, not model-scored article sentiment.") st.divider() # Fetch articles — Finnhub first, FMP as fallback -- cgit v1.3-2-g0d8e