文本分类
classify
by BytesAgain
Train and run text classification models using keyword-based and TF-IDF methods. Use when you need to categorize, label, or classify text data into predefined groups.
安装
claude skill add --url github.com/openclaw/skills/tree/main/skills/bytesagain/classify文档
Classify — Text & Data Classification Tool
A text and data classification skill supporting keyword-based and TF-IDF classification methods. Train models on labeled data, predict categories for new text, evaluate accuracy, and manage labeled datasets. All data stored in JSONL format.
Prerequisites
bash(v4+)python3(v3.6+)- No external dependencies required (uses built-in collections and math modules)
Environment Variables
| Variable | Required | Description |
|---|---|---|
CLASSIFY_TEXT | Yes* | Text to classify or label |
CLASSIFY_LABEL | No | Label/category for training data |
CLASSIFY_MODEL | No | Model name (default: default) |
CLASSIFY_METHOD | No | Classification method: keyword, tfidf (default: keyword) |
CLASSIFY_ID | No | Record ID for lookup |
CLASSIFY_FILE | No | File path for import/export/batch operations |
CLASSIFY_FORMAT | No | Export format: json, csv (default: json) |
CLASSIFY_KEY | No | Config key to read/write |
CLASSIFY_VALUE | No | Config value to set |
Data Storage
- Training data:
~/.classify/data.jsonl - Models:
~/.classify/models/ - Config:
~/.classify/config.json - Predictions log:
~/.classify/predictions.jsonl
Commands
train
Add labeled training data to a model.
CLASSIFY_TEXT="Great product, love it!" CLASSIFY_LABEL="positive" CLASSIFY_MODEL="sentiment" scripts/script.sh train
predict
Classify new text using a trained model.
CLASSIFY_TEXT="This is terrible" CLASSIFY_MODEL="sentiment" scripts/script.sh predict
evaluate
Evaluate model accuracy with test data.
CLASSIFY_MODEL="sentiment" scripts/script.sh evaluate
label
Add or update a label for existing data.
CLASSIFY_ID="cls_abc123" CLASSIFY_LABEL="neutral" scripts/script.sh label
list
List training data or prediction history.
CLASSIFY_MODEL="sentiment" CLASSIFY_LABEL="positive" scripts/script.sh list
export
Export model data or predictions.
CLASSIFY_MODEL="sentiment" CLASSIFY_FORMAT="csv" scripts/script.sh export
import
Import labeled data from a file.
CLASSIFY_FILE="/path/to/labeled_data.csv" CLASSIFY_MODEL="sentiment" scripts/script.sh import
stats
Show model statistics and label distribution.
CLASSIFY_MODEL="sentiment" scripts/script.sh stats
config
View or update classification configuration.
CLASSIFY_KEY="default_method" CLASSIFY_VALUE="tfidf" scripts/script.sh config
batch
Classify multiple texts from a file.
CLASSIFY_FILE="/path/to/texts.txt" CLASSIFY_MODEL="sentiment" scripts/script.sh batch
help
Display usage information.
scripts/script.sh help
version
Display current version.
scripts/script.sh version
Output Format
{
"status": "success",
"command": "predict",
"data": {
"text": "This product is amazing",
"predicted_label": "positive",
"confidence": 0.85,
"model": "sentiment"
}
}
Error Handling
| Exit Code | Meaning |
|---|---|
| 0 | Success |
| 1 | General error |
| 2 | Missing required parameter |
| 3 | Model/record not found |
| 4 | Insufficient training data |
Powered by BytesAgain | bytesagain.com | hello@bytesagain.com
相关 Skills
Claude接口
by anthropics
面向接入 Claude API、Anthropic SDK 或 Agent SDK 的开发场景,自动识别项目语言并给出对应示例与默认配置,快速搭建 LLM 应用。
✎ 想把Claude能力接进应用或智能体,用claude-api上手快、兼容Anthropic与Agent SDK,集成路径清晰又省心
RAG架构师
by alirezarezvani
聚焦生产级RAG系统设计与优化,覆盖文档切块、检索链路、索引构建、召回评估等关键环节,适合搭建可扩展、高准确率的知识库问答与检索增强应用。
✎ 面向RAG落地,把知识库、向量检索和生成链路系统串联起来,做架构设计时更清晰,也更少踩坑。
多智能体架构
by alirezarezvani
聚焦多智能体系统架构设计,梳理 Supervisor、Swarm、分层和 Pipeline 等模式,覆盖角色定义、通信协作与性能评估,适合规划稳健可扩展的 AI agent 编排方案。
✎ 帮你系统解决多智能体应用的架构设计与协同编排难题,适合构建复杂 AI 工作流,成熟度高、社区认可也很亮眼。
相关 MCP 服务
知识图谱记忆
编辑精选by Anthropic
Memory 是一个基于本地知识图谱的持久化记忆系统,让 AI 记住长期上下文。
✎ 帮 AI 和智能体补上“记不住”的短板,用本地知识图谱沉淀长期上下文,连续对话更聪明,数据也更可控。
顺序思维
编辑精选by Anthropic
Sequential Thinking 是让 AI 通过动态思维链解决复杂问题的参考服务器。
✎ 这个服务器展示了如何让 Claude 像人类一样逐步推理,适合开发者学习 MCP 的思维链实现。但注意它只是个参考示例,别指望直接用在生产环境里。
by deusdata
持久化的代码库知识图谱,可跨会话保留上下文,在 session 重启或上下文压缩后仍能继续使用。
✎ 专治 AI 编程助手“会话失忆”,把代码库沉淀为持久知识图谱,重启或压缩上下文后也能无缝续上开发状态。