Skip to content
Back to skills

Language Filter

ASecurity

语种过滤工具。对指定或全部文本列进行语言检测,可选择保留或剔除目标语种, 输出过滤后的数据并附带 detected_lang 列。

  • 539 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added September 11, 2026
toolspythonbash

Security analysis

A92/100
  • mediumInstalls packages at runtime which could introduce malicious dependencies

Pro scans all 4 files and shows the line behind each finding

Scanned September 11, 2026

npx -y skills add cas-bigdatalab/piflow --skill language_filter --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Language Filter?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Language Filter
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/cas-bigdatalab-language-filter/badge)](https://www.skillsdirectory.com/skills/cas-bigdatalab-language-filter)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: language_filter
description: |
  语种过滤工具。对指定或全部文本列进行语言检测,可选择保留或剔除目标语种,
  输出过滤后的数据并附带 detected_lang 列。
name_zh: 语种过滤算子
input_params:
  - name: input_path
    type: string
    required: true
    description: 输入文件路径(支持CSV/TSV/Excel等)
  - name: output_path
    type: string
    required: true
    description: 输出文件路径(过滤后的文件)
  - name: target_lang
    type: string
    required: true
    description: 目标语种代码(如 zh, en, fr 等)
  - name: text_columns
    type: string
    required: false
    description: 用于检测的文本列,逗号分隔;不填默认全部字符串列
  - name: mode
    type: string
    required: false
    description: keep=保留目标语种,drop=剔除目标语种,默认 keep
output_params:
  - name: output_path
    type: csv_file
    description: 语种过滤后的结构化数据文件(含 detected_lang)
tag: 数据清洗
publisher: COMMUNITY
---

# language_filter 语种过滤

## 功能概述
- langdetect 识别语种,写入 detected_lang 列。
- 根据模式保留或剔除目标语种样本。

## 参数说明

| 参数 | 必填 | 默认值 | 说明 |
|------|------|--------|------|
| `--input_path` | 是 |  | 输入文件路径(支持CSV/TSV/Excel等) |
| `--output_path` | 是 |  | 输出文件路径(过滤后的文件) |
| `--target_lang` | 是 |  | 目标语种代码(如 zh, en, fr 等) |
| `--text_columns` | 否 |  | 用于检测的文本列,逗号分隔;不填默认全部字符串列 |
| `--mode` | 否 |  | keep=保留目标语种,drop=剔除目标语种,默认 keep |

## 使用方法
```bash
python scripts/language_filter.py \
  --input_path <输入文件> \
  --output_path <输出文件> \
  --target_lang zh \
  [--text_columns col1,col2] \
  [--mode keep|drop]
```

## 输出说明
- 新增列 detected_lang 标记检测结果。
- 根据 mode 输出过滤后的数据。

## 注意事项
- 依赖 langdetect,请确保已安装:`pip install langdetect`。
- 语言检测对极短文本可能不稳定,建议提供上下文较多的列或多列拼接。

Files in this skill

  • SKILL.md2.2 KB
  • scripts/data_io.py3.5 KB
  • scripts/language_filter.py3.8 KB
  • skill.json1.8 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in tools →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.