|
|
@@ -10,6 +10,7 @@ from news_mcp.config import (
|
|
|
NEWS_PRUNING_ENABLED,
|
|
|
NEWS_REFRESH_INTERVAL_SECONDS,
|
|
|
NEWS_RETENTION_DAYS,
|
|
|
+ DEFAULT_TOPICS,
|
|
|
)
|
|
|
from news_mcp.storage.sqlite_store import SQLiteClusterStore
|
|
|
|
|
|
@@ -320,6 +321,7 @@ class DashboardStore:
|
|
|
return dt.astimezone(timezone.utc)
|
|
|
|
|
|
counter: dict[str, int] = {}
|
|
|
+ _topic_labels = {t.lower() for t in DEFAULT_TOPICS}
|
|
|
for (payload_text,) in rows:
|
|
|
c = json.loads(payload_text)
|
|
|
dt = _parse_ts(c.get("timestamp"))
|
|
|
@@ -333,6 +335,10 @@ class DashboardStore:
|
|
|
kw_str = str(kw).strip()
|
|
|
if not kw_str:
|
|
|
continue
|
|
|
+ # Skip topic labels (crypto, macro, regulation, ai, other)
|
|
|
+ # that the LLM sometimes returns as keywords.
|
|
|
+ if kw_str.lower() in _topic_labels:
|
|
|
+ continue
|
|
|
# Skip keywords that are already entities in this cluster
|
|
|
if kw_str.lower() in ents_in_cluster:
|
|
|
continue
|