Sentiment Analyzer

v1.0.0

客服场景文本情绪分析工具。当需要对客户消息进行情绪识别(愤怒/焦虑/中性/满意/热情)、敏感词检测、情绪波动告警时使用。适用于:自动调整回复语气、触发紧急转接、投诉分级处理、NPS情绪追踪。触发词:情绪分析、情感检测、客户情绪、愤怒检测、情绪告警、sentiment。

0· 54·2 current·2 all-time
MIT-0
Download zip
LicenseMIT-0 · Free to use, modify, and redistribute. No attribution required.
Security Scan
VirusTotalVirusTotal
Pending
View report →
OpenClawOpenClaw
Benign
high confidence
Purpose & Capability
Name/description match the included code and docs: analyze.py implements rule-based sentiment classification, track.py implements session tracking. No unrelated credentials, binaries, or external integrations are requested.
Instruction Scope
SKILL.md only instructs running the included scripts and integrating results into workflows. It documents output format and alert rules. Minor scope note: the instructions rely on writing session data to /tmp and do not specify retention, access controls, or privacy guarantees.
Install Mechanism
No install spec or external downloads; the skill is instruction-first with small included Python scripts. Nothing is fetched from third-party URLs or installed to system-wide locations.
Credentials
The skill requests no environment variables or credentials (proportional). However, it persists session data under /tmp/sentiment_tracking which may contain customer message fragments; this storage/access pattern should be considered when handling sensitive data.
Persistence & Privilege
The skill does not request elevated privileges and always:false. It creates and writes its own files under /tmp/sentiment_tracking (its own scope) — this is expected but could expose session data on multi-user hosts if not secured or purged.
Assessment
This skill appears to do what it says: a local, rule-based sentiment analyzer suitable for customer-service flows. Before installing, consider: (1) Data privacy — it stores session data under /tmp/sentiment_tracking/{session_id}.json (only first 100 characters are saved) but you should confirm this meets your retention and PII policies; change the path or add encryption/permissions if needed. (2) Cleanup — ensure session files are deleted or rotated after use to avoid leakage on shared hosts. (3) Accuracy & bias — it's a simple keyword rule engine; test for false positives/negatives and review the sensitive/negative word lists for unacceptable terms or localization issues. (4) Isolation — run in an environment where /tmp is not accessible to untrusted users if messages are sensitive. There are no network calls or credential requests, so network exfiltration risk from the included code is low, but always review deployed runtime environment and file permissions before use.

Like a lobster shell, security has layers — review code before you run it.

latestvk97cdzvx6abb9mx2exc96yczbd83wzp1

License

MIT-0
Free to use, modify, and redistribute. No attribution required.

SKILL.md

情感分析器 (Sentiment Analyzer)

客服销售总监卡耐基的专用情绪分析工具,基于本地规则引擎,无需外部 API。

快速使用

运行分析脚本,传入客户文本:

python3 scripts/analyze.py "客户的消息内容"

输出结构化 JSON,包含情绪分类、敏感词列表、告警标记。

输出格式

{
  "sentiment": "angry|anxious|neutral|satisfied|enthusiastic",
  "score": -1.0 到 1.0,
  "keywords": ["检测到的负面关键词"],
  "sensitive_words": ["敏感词列表"],
  "alert": true|false,
  "alert_reason": "触发告警的原因",
  "reply_tone": "apologetic|calm|neutral|positive|enthusiastic"
}

情绪分类规则

情绪触发条件回复语气
angry负面词≥2 或含敏感词 或含强烈否定apologetic
anxious含担忧/急切词汇calm
neutral无明显情绪信号neutral
satisfied含正面词汇positive
enthusiastic含热情/赞叹词汇enthusiastic

告警触发条件

满足以下任一条件时 alert: true

  1. 情绪为 angry 且 score < -0.5
  2. 检测到敏感词
  3. 情绪波动:连续 3 条消息 score 持续下降

回复语气映射

根据情绪自动推荐回复语气,详见 references/reply_tone.md

集成指引

在对话流程中使用

当收到客户消息时,调用 analyze.py 获取情绪分析结果,据此调整回复策略:

  • apologetic:立即道歉,表达理解,承诺解决
  • calm:温和安抚,确认问题,给出时间表
  • neutral:专业中性,提供解决方案
  • positive:积极回应,强调价值
  • enthusiastic:热情回应,感谢信任

情绪追踪

使用 track.py 记录对话中连续的情绪变化,用于判断是否需要人工介入:

python3 scripts/track.py "客户消息" --session-id "会话ID"

详见 references/emotion_tracking.md

Files

6 total
Select a file
Select a file to preview.

Comments

Loading comments…