Keyword Extractor
Documentskeyword_extractorKeyword Extractor is an Agent Skill for documents published in the cas-bigdatalab/piflow repository on GitHub: a SKILL.md instruction file an AI agent can load to do this task.
关键词提取标注工具。读取包含文本字段的表格或JSONL语料,为每条记录提取核心关键词并写入新增关键词字段。 当用户提到关键词提取、关键词抽取、文本关键词、标签提取等需求时使用此skill。 即使用户没有明确说出"keyword_extractor",只要任务涉及从文本内容中提取重要词汇或短语作为标签,就应该使用此skill。 不负责按预置领域关键词库做相关性筛选、文本清洗、分词结果展开或章节切分。
QUICK START
How to use this skill
Bring this guide into your coding agent with a prompt tailored to the tool you use.
- Open your project in Codex.
- Copy and paste the prompt below.
- Review files and risks before approving any action.
Prompt to paste
Inspect the Agent Skill at https://github.com/cas-bigdatalab/piflow/blob/HEAD/workspace/skills/keyword_extractor/SKILL.md and all supporting files. Report provenance, permissions, scripts, dependencies, and security risks. Propose an exact installation into .agents/skills/keyword-extractor, but wait for my approval before writing files or running scripts.
Copying this prompt does not install or run the skill. Review third-party files before use.
Keyword Extractor 关键词提取 Skill
功能概述
本skill用于读取包含文本字段的 CSV、TSV、JSON 或 JSONL 数据,为每条记录新增一个关键词字段,字段值为JSON数组字符串。 支持jieba关键词抽取;未安装jieba时退回到简单词频统计。 不负责按预置领域关键词库做相关性筛选、文本清洗、分词结果展开或章节切分。
触发条件
当用户请求以下任务时,应使用此skill:
- 关键词提取/关键词抽取
- 文本关键词/标签提取
- 内容关键词分析
支持的文件格式
- CSV (.csv)
- TSV (.tsv)
- JSON (.json)
- JSONL (.jsonl)
使用方法
python scripts/run_keyword_extractor.py \
--input {input} \
--output {output} \
--text_field {text_field} \
--label_field {label_field} \
--topk {topk}
参数说明
| 参数 | 必填 | 说明 |
|---|---|---|
--input | 是 | 输入文件路径 |
--output | 是 | 输出文件路径 |
--text_field | 是 | 文本字段名 |
--label_field | 否 | 输出关键词字段名,默认"keywords" |
--topk | 否 | 提取关键词数量,默认5 |
输出示例
id,title,keywords
1,厦门海域养殖贝类体内重金属的初步研究,"[""厦门海域"", ""养殖"", ""贝类"", ""重金属""]"
环境要求
pip install jieba