|
|
@@ -866,7 +866,7 @@ async def detect_emerging_topics(limit: int = 10, timeframe: str = "24h", topic:
|
|
|
|
|
|
related = []
|
|
|
if ent in entity_cooccur:
|
|
|
- for other, _cnt in entity_cooccur[ent].most_common(5):
|
|
|
+ for other, _cnt in entity_cooccur[ent].most_common(10):
|
|
|
if other != ent:
|
|
|
related.append(other)
|
|
|
|
|
|
@@ -890,7 +890,7 @@ async def detect_emerging_topics(limit: int = 10, timeframe: str = "24h", topic:
|
|
|
scored.append({
|
|
|
"topic": ent,
|
|
|
"trend_score": min(0.99, round(composed_score, 3)),
|
|
|
- "related_entities": related[:3] if related else [ent],
|
|
|
+ "related_entities": related[:5] if related else [ent],
|
|
|
"related_keywords": related_kws[:5],
|
|
|
"velocity": round(velocity, 2),
|
|
|
"recent_count": recent_n,
|
|
|
@@ -942,7 +942,7 @@ async def detect_emerging_topics(limit: int = 10, timeframe: str = "24h", topic:
|
|
|
kw_related_ents.append(other)
|
|
|
else:
|
|
|
kw_related_kws.append(other)
|
|
|
- if len(kw_related_kws) >= 5 and len(kw_related_ents) >= 3:
|
|
|
+ if len(kw_related_kws) >= 5 and len(kw_related_ents) >= 5:
|
|
|
break
|
|
|
|
|
|
kw_scored.append({
|