通过api取得unisat telegram群组信息,并进行分析。

import React from 'react';
import { BarChart, Bar, XAxis, YAxis, CartesianGrid, Tooltip, Legend, ResponsiveContainer, PieChart, Pie, Cell } from 'recharts';
import { Card, CardHeader, CardTitle, CardContent } from "@/components/ui/card";
const SentimentWordAnalysis = () => {
// 情感分析数据
const sentimentData = [
{ name: 'Positive', value: 2033 },
{ name: 'Neutral', value: 1794 },
{ name: 'Negative', value: 412 }
];
// 常见英文词(前15个)
const topEnglishWords = [
{ word: 'unisat', count: 2614 },
{ word: '2023', count: 1256 },
{ word: 'wallet', count: 836 },
{ word: 'founded', count: 768 },
{ word: '20', count: 726 },
{ word: 'september', count: 599 },
{ word: 'please', count: 594 },
{ word: 'hi', count: 522 },
{ word: 'april', count: 487 },
{ word: 'launched', count: 478 },
{ word: 'officially', count: 463 },
{ word: '14', count: 446 },
{ word: 'welcome', count: 445 },
{ word: 'fractal', count: 400 },
{ word: 'pizza', count: 377 }
];
// 常见中文词(前15个)
const topChineseWords = [
{ word: 'unisat', count: 141 },
{ word: 'sats', count: 99 },
{ word: 'io', count: 80 },
{ word: 'pizza', count: 61 },
{ word: '好的', count: 51 },
{ word: '是的', count: 51 },
{ word: '请注意', count: 49 },
{ word: '谢谢', count: 34 },
{ word: '哈哈', count: 31 },
{ word: '起飞', count: 31 },
{ word: '您好', count: 24 },
{ word: 'swap', count: 13 },
{ word: 'btc', count: 11 },
{ word: '好', count: 10 },
{ word: 'bitcoin', count: 9 }
];
const COLORS = {
sentiment: ['#4CAF50', '#9E9E9E', '#f44336'],
words: ['#2196F3', '#00BCD4', '#3F51B5', '#673AB7', '#9C27B0']
};
return (
<div className="space-y-8">
<Card>
<CardHeader>
<CardTitle>情感分析分布</CardTitle>
</CardHeader>
<CardContent>
<div className="h-96">
<ResponsiveContainer width="100%" height="100%">
<PieChart>
<Pie
data={sentimentData}
cx="50%"
cy="50%"
labelLine={true}
label={({name, value, percent}) => ${name}: ${value} (${(percent * 100).toFixed(1)}%)}
outerRadius={120}
fill="#8884d8"
dataKey="value"
>
{sentimentData.map((entry, index) => (
<Cell key={cell-${index}} fill={COLORS.sentiment[index]} />
))}
</Pie>
<Tooltip />
<Legend />
</PieChart>
</ResponsiveContainer>
</div>
</CardContent>
</Card>
  <Card>
    <CardHeader>
      <CardTitle>最常见英文词频统计 (Top 15)</CardTitle>
    </CardHeader>
    <CardContent>
      <div className="h-96">
        <ResponsiveContainer width="100%" height="100%">
          <BarChart data={topEnglishWords}>
            <CartesianGrid strokeDasharray="3 3" />
            <XAxis dataKey="word" angle={-45} textAnchor="end" height={100} />
            <YAxis />
            <Tooltip />
            <Bar dataKey="count" fill="#2196F3" />
          </BarChart>
        </ResponsiveContainer>
      </div>
    </CardContent>
  </Card>

  <Card>
    <CardHeader>
      <CardTitle>最常见中文词频统计 (Top 15)</CardTitle>
    </CardHeader>
    <CardContent>
      <div className="h-96">
        <ResponsiveContainer width="100%" height="100%">
          <BarChart data={topChineseWords}>
            <CartesianGrid strokeDasharray="3 3" />
            <XAxis dataKey="word" angle={-45} textAnchor="end" height={100} />
            <YAxis />
            <Tooltip />
            <Bar dataKey="count" fill="#00BCD4" />
          </BarChart>
        </ResponsiveContainer>
      </div>
    </CardContent>
  </Card>
</div>

);
};
export default SentimentWordAnalysis;

中文词频统计

Untitled

unisat群组内中文词条提取:我们发现其中语句出现频次最高的是“sats是孤儿没有自己的社区吗?“

反映了群组成员对SATS社区的愤怒和疑问。它暗示了一些用户对SATS生态系统的不确定性,或者对

其社区发展的期望,也体现出unisat中一部分持有sats的用户对于unisat整体不作为的愤怒。

英文词频统计

Untitled

英语语句则集中在unisat官方进行宣发的材料中,英文社群的建设极为匮乏。

情绪指标

Untitled