360 Secure SkillHub
360 安全技能中心

Comment Wordcloud

该 Skill 读取 JSON 格式的社媒评论,使用 jieba 中文分词、停用词过滤和自定义词表计算词频,并生成词频 JSON 与词云 PNG;依赖 Python 3.11+、jieba、wordcloud、matplotlib,运行时不含外部服务。

dkgee
dkgee
热度 12.47
最近更新 2026-07-11 22:14:53
分类:数据依赖:代码执行 / 读写文件应用场景:数据处理 / 报告撰写 / 社交媒体

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add comment-wordcloud
Metadata
name
comment-wordcloud
version
1.0.0
description
Generate word frequency statistics and word cloud from social media comments
whenToUse
When you need to analyze hot topics in social media comments

Overview

This skill generates word frequency statistics and word cloud images from social media comment data.

Usage

Provide comment data in JSON format. The script will automatically:

  1. Read and parse comment data
  2. Use jieba for Chinese word segmentation
  3. Filter stop words
  4. Calculate word frequency
  5. Generate word cloud
  6. Output word frequency JSON and word cloud PNG

Input Format

Comment data should be in JSON format, each element contains a content field:

[
  {"content": "This product is very useful"},
  {"content": "High cost performance, recommend purchase"}
]

Output Format

  • {output_dir}/word_freq.json: Word frequency statistics
  • {output_dir}/word_cloud.png: Word cloud image

Tech Stack

  • Python 3.11+
  • jieba 0.42.1
  • wordcloud 1.9.3
  • matplotlib 3.9.0

Parameters

  • data_source: Comment data file path (required)
  • output_dir: Output directory (required)
  • stop_words: Stop words file path (optional)
  • custom_words: Custom vocabulary (optional, comma separated)
  • max_words: Max words in word cloud (optional, default 200)

Example

python scripts/generate_wordcloud.py references/sample_comments.json output/ --max-words 10

Notes

  1. Need to install Python dependencies: jieba, wordcloud, matplotlib
  2. Need Chinese font file (use system font by default)
  3. Stop words file is a text file with one word per line
  4. Custom vocabulary will be added to tokenizer with priority