agentic-os
Build persistent multi-agent systems without external databases, using file-based memory and scheduled tasks.
AFaffaan-m/ECC315k4,381 new stars in the last 7 days
字符重复比例过滤器。过滤文本中字符级n-gram重复比例不在指定范围内的样本。 当用户提到字符重复、重复比例过滤、文本重复过滤、清理重复内容等需求时使用此skill。 即使用户没有明确说出"字符重复",只要任务涉及根据文本中字符重复的程度来筛选数据, 就应该使用此skill。
本skill根据文本中字符级n-gram的重复比例进行过滤,只保留重复比例在指定范围内的样本。 常用于过滤过度重复的文本、清理模板生成的低质量文本等场景。
当用户请求以下任务时,应使用此skill:
| 参数 | 说明 |
|---|---|
--input | 输入JSON文件路径 |
--output | 输出JSON文件路径 |
| 参数 | 说明 | 默认值 |
|---|---|---|
--rep_len | 字符级n-gram重复长度 | 10 |
--min_ratio | 最小重复比例 | 0.0 |
--max_ratio | 最大重复比例 | 0.5 |
--text_key | 文本字段的键名 | text |
[
{"text": "正常文本内容"},
{"text": "过度重复的文本aaaaaaa..."},
{"text": "另一段正常文本"}
]
python scripts/run_character_repetition_filter.py \
--input ./input.json \
--output ./output.json
python scripts/run_character_repetition_filter.py \
--input ./input.json \
--output ./output.json \
--min_ratio 0.0 \
--max_ratio 0.4
python scripts/run_character_repetition_filter.py \
--input ./input.json \
--output ./output.json \
--rep_len 5
| 文本 | 重复比例 | 过滤结果 (0.0-0.4) |
|---|---|---|
Today is Sund Sund Sund Sund Sund Sunda... | 高 | 过滤 |
a v s e c s f e f g a a a a a a a a a a | 高 | 过滤 |
,。、„""«»1»... | 低 | 保留 |
中文也是一个字算一个长度 | 低 | 保留 |
命令行输出:
[OK] Character repetition filtering completed!
Rep length: 10
Min ratio: 0.0
Max ratio: 0.4
Original documents: 4
Filtered documents: 2
Removed documents: 2
Input file: ./input.json
Output file: ./output.json
输出JSON格式:
[
{"text": "过滤后保留的文本1"},
{"text": "过滤后保留的文本2"}
]
安装依赖: 本SKILL使用依赖 data_juicer,请在调用前安装好python环境并安装data_juicer:
pip install py-data-juicer
Build persistent multi-agent systems without external databases, using file-based memory and scheduled tasks.
AFaffaan-m/ECC315k4,381 new stars in the last 7 days
GAgarrytan/gstack143k598 new stars in the last 7 days
ADaddyosmani/agent-skills122k1,667 new stars in the last 7 days
THthedotmack/claude-mem121k1,626 new stars in the last 7 days
THthedotmack/claude-mem121k1,626 new stars in the last 7 days
THthedotmack/claude-mem121k1,626 new stars in the last 7 days