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 (
Simple view of how often people use "us" words vs "them" words, and the tone around that language.
+Dominant average emotion where in-group framing is stronger.
+Most likely emotion when in-group wording is stronger.
Dominant average emotion where out-group framing is stronger.
+Most likely emotion when out-group wording is stronger.
Most frequent entities and their dominant average emotion signature.
+Most mentioned entities and the mood that appears most with each.
{!entities.length ? (- 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.