diff --git a/frontend/src/components/CulturalStats.tsx b/frontend/src/components/CulturalStats.tsx index 7f3a775..c46e0c3 100644 --- a/frontend/src/components/CulturalStats.tsx +++ b/frontend/src/components/CulturalStats.tsx @@ -11,6 +11,15 @@ type CulturalStatsProps = { const CulturalStats = ({ data }: CulturalStatsProps) => { const identity = data.identity_markers; const stance = data.stance_markers; + const inGroupWords = identity?.in_group_usage ?? 0; + const outGroupWords = identity?.out_group_usage ?? 0; + const totalGroupWords = inGroupWords + outGroupWords; + const inGroupWordRate = typeof identity?.in_group_ratio === "number" + ? identity.in_group_ratio * 100 + : null; + const outGroupWordRate = typeof identity?.out_group_ratio === "number" + ? identity.out_group_ratio * 100 + : null; const rawEntities = data.avg_emotion_per_entity?.entity_emotion_avg ?? {}; const entities = Object.entries(rawEntities) .sort((a, b) => (b[1].post_count - a[1].post_count)) @@ -25,77 +34,107 @@ const CulturalStats = ({ data }: CulturalStatsProps) => { entries.sort((a, b) => b[1] - a[1]); const dominant = entries[0] ?? ["emotion_unknown", 0]; const dominantLabel = dominant[0].replace("emotion_", ""); - return `${dominantLabel} (${dominant[1].toFixed(3)})`; + return `${dominantLabel} (${(dominant[1] * 100).toFixed(1)}%)`; }; return (
+
+

Community Framing Overview

+

Simple view of how often people use "us" words vs "them" words, and the tone around that language.

+
+ + + + + +
-

In-Group Emotion Profile

-

Dominant average emotion where in-group framing is stronger.

+

Mood in "Us" Posts

+

Most likely emotion when in-group wording is stronger.

{topEmotion(identity?.in_group_emotion_avg)}
-

Out-Group Emotion Profile

-

Dominant average emotion where out-group framing is stronger.

+

Mood in "Them" Posts

+

Most likely emotion when out-group wording is stronger.

{topEmotion(identity?.out_group_emotion_avg)}
-

Entity Emotion Averages

-

Most frequent entities and their dominant average emotion signature.

+

Entity Mood Snapshot

+

Most mentioned entities and the mood that appears most with each.

{!entities.length ? (
No entity-level cultural data available.
) : ( @@ -104,7 +143,7 @@ const CulturalStats = ({ data }: CulturalStatsProps) => {
{entity}
- {aggregate.post_count.toLocaleString()} posts • Dominant emotion: {topEmotion(aggregate.emotion_avg)} + {aggregate.post_count.toLocaleString()} posts • Likely mood: {topEmotion(aggregate.emotion_avg)}
))} diff --git a/frontend/src/pages/AutoScrape.tsx b/frontend/src/pages/AutoScrape.tsx index 96163dd..cbea251 100644 --- a/frontend/src/pages/AutoScrape.tsx +++ b/frontend/src/pages/AutoScrape.tsx @@ -192,7 +192,7 @@ const AutoScrapePage = () => { Select sources and scrape settings, then queue processing automatically.

- Warning: Scraping more than 250 posts from any single site can take hours. + Warning: Scraping more than 250 posts from any single site can take hours due to rate limits.