En Text Cleaner
Documentsen_text_cleanerEn Text Cleaner 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。 适合外文论文、英文实验记录的基础规整,不负责翻译、语法改写或跨语言语义修复。
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/en_text_cleaner/SKILL.md and all supporting files. Report provenance, permissions, scripts, dependencies, and security risks. Propose an exact installation into .agents/skills/en-text-cleaner, 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.
EnTextCleaner - 英文文本清洗优化算子
功能概述
英文文本基础清洗工具。读取英文科研文本,展开常见缩写、修正常见拼写错误并可选规范大小写,输出整理后的 JSONL 数据。 适合外文论文、英文实验记录的基础规整,不负责翻译、语法改写或跨语言语义修复。
触发条件
当用户请求以下任务时,应使用此skill:
- 英文缩写展开
- 英文拼写纠正
- 英文文本规整
- 英文大小写规范化
核心参数说明
必需参数
--input:输入JSONL文件路径--output:输出JSONL文件路径
可选参数
--text_field:文本字段名,默认text--expand_abbreviations:是否展开缩写,默认true--fix_spelling:是否纠正拼写,默认true--normalize_case:是否规范化大小写,默认false--mark_cleaned:是否标记已清洗样本,默认true--custom_abbreviations:自定义缩写词典JSON文件路径--custom_spellings:自定义拼写词典JSON文件路径
输入文件格式
- JSONL
使用方法
python scripts/run_en_text_cleaner.py \
--input data.jsonl \
--output cleaned.jsonl \
--text_field text
输出示例
[OK] English text cleaning completed
Total samples: 1000
Samples processed: 234
Abbreviations expanded: 156
Spelling fixed: 89
环境要求
- Python 3.10+
- 仅依赖标准库
注意事项
- 本skill只做缩写展开和拼写纠正,不负责语法修正或全句翻译。
- 自定义词典需要符合JSON格式。
- 修改样本会附带
_en_cleaned标记和_en_change_details明细。