Multi-label-Prompt-Dataset
收藏资源简介:
该数据集是一个多标签提示分类语料库,专门用于训练轻量级、CPU高效的机器学习模型(如CatBoost、LightGBM和FastText),以支持提示复杂度估计、任务意图分类、输出令牌长度预测和动态LLM路由。数据集包含1,859个去重后的提示样本,使用23个多标签标签,覆盖四个语义维度:复杂度与推理层级、预期输出令牌长度、执行优先级与计算层级、任务与领域意图。所有样本均为英文,以CSV格式存储,包含两列:`prompt`(原始文本)和`labels`(JSON列表形式的标签数组)。数据集由5个子数据集组成:`clean.csv`(500个结构良好的技术提示)、`noisy.csv`(500个包含拼写错误和口语化表达的提示)、`real.csv`(500个真实开发者和系统管理员工作流查询)、`balance.csv`(471个用于平衡低支持类别的合成样本)、`augment.csv`(350个释义变体和长度扩展提示),最终合并为`master_dataset.csv`。标签分布信息已提供,其中`interactive`(62.5%)和`medium-output`(49.5%)是最常见的标签。该数据集适用于文本分类和特征提取任务,典型应用场景包括在CPU上亚10毫秒内完成提示分类和模型路由,无需调用辅助LLM。数据集遵循MIT许可证。
This dataset is a multi-label prompt classification corpus specifically designed for training lightweight, CPU-efficient machine learning models (e.g., CatBoost, LightGBM, and FastText) to support prompt complexity estimation, task intent classification, output token length prediction, and dynamic LLM routing. It contains 1,859 de-duplicated prompt samples with 23 multi-label tags covering four semantic dimensions: complexity and reasoning level, expected output token length, execution priority and compute level, and task and domain intent. All samples are in English, stored in CSV format with two columns: `prompt` (raw text) and `labels` (a JSON list of tags). The dataset consists of 5 sub-datasets: `clean.csv` (500 well-structured technical prompts), `noisy.csv` (500 prompts with typos and colloquial expressions), `real.csv` (500 real-world developer and sysadmin workflow queries), `balance.csv` (471 synthetic samples for balancing low-support categories), and `augment.csv` (350 paraphrased variants and length-extended prompts), finally merged into `master_dataset.csv`. Label distribution information is provided, with `interactive` (62.5%) and `medium-output` (49.5%) being the most common tags. The dataset is suitable for text classification and feature extraction tasks, with typical use cases including prompt classification and model routing in under 10 milliseconds on CPU without calling an auxiliary LLM. It is licensed under MIT.
数据集概述
Multi-label Prompt Dataset 是一个面向多标签提示词分类的英文语料库,专为训练轻量级、CPU 高效的机器学习模型(如 CatBoost、LightGBM、FastText)而设计,用于提示词复杂度估计、任务意图分类、输出 token 长度预测以及动态 LLM 路由。
基本信息
- 唯一样本数: 1,859 条去重提示词
- 标签数量: 23 个多标签类别,覆盖 4 个语义维度
- 语言: 英语 (
en) - 格式: CSV(逗号分隔),标签以 JSON 数组形式存储
- 主要用途: 在 CPU 上实现亚 10 毫秒的提示词分类与模型路由,无需调用辅助 LLM
- 许可证: MIT License
数据集结构
仓库包含一个统一的主数据集及 5 个组成性子数据集:
| 文件 | 行数 | 说明 |
|---|---|---|
master_dataset.csv |
1,859 | 合并所有子数据集、去重并以 seed=42 打乱后的完整数据集 |
clean.csv |
500 | 结构良好、连贯的技术提示词(软件工程、算法、系统设计、数据库查询) |
noisy.csv |
500 | 含拼写错误、口语化表达和非正式语法的真实对话式提示词 |
real.csv |
500 | 涵盖云服务商、Web 框架与调试场景的实用开发者查询 |
balance.csv |
471 | 针对低频类别(research、mlops、architecture-heavy、analysis)的合成样本 |
augment.csv |
350 | 改述变体与长度扩展的增强样本 |
数据模式
每个 CSV 文件包含两列:
| 列名 | 类型 | 说明 | 示例 |
|---|---|---|---|
prompt |
string |
用户查询或指令的原始文本 | "Design a fault-tolerant real-time recommendation engine serving 50M daily users" |
labels |
string (JSON 列表) |
分配给该提示词的多标签数组 | ["architecture-heavy", "hard", "premium", "background", "reasoning-intensive", "long-output", "infrastructure"] |
多标签分类体系(23 个类别)
标签覆盖四个语义维度:
- 复杂度与推理层级:
easy、moderate、hard、reasoning-light、reasoning-moderate、reasoning-intensive - 预期输出 Token 长度:
short-output(≤200 tokens)、medium-output(约 500 tokens)、long-output(≥1,200 tokens) - 执行优先级与计算层级:
cheap、balanced、premium、realtime、interactive、background - 任务与领域意图:
coding、debugging、infrastructure、architecture、architecture-heavy、mlops、analysis、research
类别分布(Top 10)
| 标签 | 样本数 | 频率 (%) | 类别 |
|---|---|---|---|
interactive |
1,161 | 62.5% | 执行优先级 |
medium-output |
920 | 49.5% | 输出长度 |
reasoning-moderate |
734 | 39.5% | 推理深度 |
moderate |
732 | 39.4% | 复杂度层级 |
hard |
714 | 38.4% | 复杂度层级 |
reasoning-intensive |
714 | 38.4% | 推理深度 |
balanced |
628 | 33.8% | 执行优先级 |
premium |
574 | 30.9% | 执行优先级 |
long-output |
517 | 27.8% | 输出长度 |
coding |
505 | 27.2% | 任务意图 |
基线模型基准(CatBoost)
使用多标签 CatBoostClassifier(One-vs-Rest),基于 5,000 个 TF-IDF 特征(unigram + bigram)和 19 个结构化文本特征训练:
- 数据划分: 80% 训练(1,487 样本)、20% 测试(372 样本)
- 基线(阈值 $t=0.50$): Macro F1 = 0.8094,Micro F1 = 0.8282,Hamming Loss = 0.0907
- 调优阈值后: Macro F1 = 0.8320,Micro F1 = 0.8419,Hamming Loss = 0.0840
- 推理延迟: CPU 上 < 10ms
使用示例
Hugging Face datasets 加载:
python from datasets import load_dataset import ast
dataset = load_dataset("csv", data_files="data/master_dataset.csv")
def parse_labels(example): example["labels"] = ast.literal_eval(example["labels"]) return example
dataset = dataset.map(parse_labels) print(dataset["train"][0])
pandas 加载:
python import pandas as pd import ast from sklearn.preprocessing import MultiLabelBinarizer
df = pd.read_csv("data/master_dataset.csv") df["labels"] = df["labels"].apply(ast.literal_eval)
mlb = MultiLabelBinarizer() y = mlb.fit_transform(df["labels"])
print(f"Total samples: {len(df)}") print(f"Classes ({len(mlb.classes_)}): {list(mlb.classes_)}")
局限性
- 领域范围: 数据集聚焦于技术提示词(软件工程、系统架构、云基础设施、机器学习、数学),不适用于一般日常对话或创意写作。
- 语言: 仅支持英语 (
en)。
许可证
数据集基于 MIT License 发布。




