返回文档中心

填写指南

模型基准数据填写指南

模型基准数据(baseline)由模型方提供,是带标注的训练和测试数据。平台用它训练模型、评测效果。

一、你需要准备什么

一个目录,里面放:

my_baseline/
├── dataset_infos.json   ← 本文件(按本文档填写)
├── train.csv            ← 训练数据(或 train.jsonl / train.xlsx)
├── test.csv             ← 测试数据(或 test.jsonl / test.xlsx)
└── datas/               ← 图像、视频等文件放在子目录里
    ├── img_001.jpg
    └── clip_001.avi

在 CSV 中用相对路径引用即可(如 datas/img_001.jpg)。如果文件很多,可以打成 zip 包。

二、dataset_infos.json 怎么写

2.1 完整模板

json
{
  "columns": [ ... ],
  "data_config": {
    "data_type": ["…"],
    "format": "csv",
    "encoding": "UTF-8",
    "delimiter": ",",
    "has_header": true,
    "data_files": {
      "train": { "index_file": "train.csv" },
      "test":  { "index_file": "test.csv" }
    }
  }
}

2.2 每一步说明

第 1 步:填写 columns

columns 是一个数组,你的数据有多少列就写多少条。每条描述一列:

要填的写什么示例
field_name_enCSV 列名(JSONL 则写 JSON 键名)"review"
type这列存的数据类型"string" / "int" / "float" / "date"
field_name_cn中文名"影评文本"
description这列是什么、值的含义"negative=负面, positive=正面"
example_value一个样例值"positive"
patterntype=date 时写日期格式,其他写 """yyyy-MM-dd"
is_primary_key是否唯一标识一行true / false
nullable是否允许为空true / false
role这列的数据角色(见下表)"text" / "label" ...
label_values仅标注列且为枚举值时填写["negative", "positive"]

role 说明:

如果你的列是……写 role
样本唯一 IDid
文本内容(影评、问题等)text
图像文件路径image
音频文件路径audio
视频文件路径video
标注/真值(要预测的目标)label(必填)
普通数据字段(表格类,年龄、性别……)不写

label_values 怎么填:

标注类型写不写示例
枚举标签写,顺序 = 输出顺序[0, 1] 或 ["negative", "positive"]
连续值(房价、分数……)不写
自由文本(参考回答、摘要……)不写

第 2 步:填写 data_config

字段写什么
data_type数组。单模态:["text"] / ["image"] / ["video"] / ["audio"] / ["structured"]。多模态:["text", "image"]
format"csv" / "excel" / "jsonl"
encoding文件编码,通常 "UTF-8"
delimitercsv 的分隔符(jsonl/excel 不写)
has_headercsv/excel 是否有表头(jsonl 不写)
data_files声明数据文件:train 和 test

data_type 和 role 要对应:data_type 里列了什么类型,columns 里就要有对应的 role 列。

第 3 步:填写 data_files

jsonc
"data_files": {
  "train": { "index_file": "train.csv" },
  "test":  { "index_file": "test.csv" }
}

如果训练和测试在同一个文件里,写行范围(rows 含起始不含结束,行号从 0 开始不包含表头):

jsonc
"data_files": {
  "train": { "index_file": "data.csv", "rows": [0, 8000] },
  "test":  { "index_file": "data.csv", "rows": [8000, 10000] }
}

如果有图像、视频等文件打包成了 zip,加 archive:

jsonc
"data_files": {
  "train": { "index_file": "train_labels.csv", "archive": "datas.zip" },
  "test":  { "index_file": "test_labels.csv",  "archive": "datas.zip" }
}

此时 CSV 中文件路径列写 zip 内部路径(如 datas/img_001.jpg)。 没有 archive 时路径相对于 dataset 根目录。

三、常见例子

文本分类(IMDB 影评)

my_baseline/
├── dataset_infos.json
├── train.csv          ← 列:review, sentiment
└── test.csv
json
{
  "columns": [
    { "field_name_en": "review", "type": "string", "field_name_cn": "影评文本",
      "description": "IMDB 影评原文", "example_value": "This movie was great...",
      "pattern": "", "is_primary_key": false, "nullable": false,
      "role": "text" },
    { "field_name_en": "sentiment", "type": "string", "field_name_cn": "情感标签",
      "description": "negative=负面, positive=正面",
      "example_value": "positive", "pattern": "", "is_primary_key": false, "nullable": false,
      "role": "label", "label_values": ["negative", "positive"] }
  ],
  "data_config": {
    "data_type": ["text"], "format": "csv", "encoding": "UTF-8",
    "delimiter": ",", "has_header": true,
    "data_files": {
      "train": { "index_file": "train.csv" },
      "test":  { "index_file": "test.csv" }
    }
  }
}

图像分类(X 光肺炎检测)

my_baseline/
├── dataset_infos.json
├── train_labels.csv   ← 列:Image_Path, Pneumonia_Target
├── test_labels.csv
├── train_images/
└── test_images/
json
{
  "columns": [
    { "field_name_en": "Image_Path", "type": "string", "field_name_cn": "图像路径",
      "description": "X 光图像文件路径", "example_value": "train_images/person1.jpeg",
      "pattern": "", "is_primary_key": false, "nullable": false,
      "role": "image" },
    { "field_name_en": "Pneumonia_Target", "type": "int", "field_name_cn": "肺炎标签",
      "description": "1=患病, 0=正常", "example_value": "1",
      "pattern": "", "is_primary_key": false, "nullable": false,
      "role": "label", "label_values": [0, 1] }
  ],
  "data_config": {
    "data_type": ["image"], "format": "csv", "encoding": "UTF-8",
    "delimiter": ",", "has_header": true,
    "data_files": {
      "train": { "index_file": "train_labels.csv" },
      "test":  { "index_file": "test_labels.csv" }
    }
  }
}

图像分类 + zip 打包

my_baseline/
├── dataset_infos.json
├── train_labels.csv      ← Image_Path 列写 zip 内部路径
├── test_labels.csv
└── datas.zip             ← 所有图片
json
{
  "columns": [
    { "field_name_en": "Image_Path", "type": "string", "field_name_cn": "图像路径",
      "description": "zip 内部路径", "example_value": "train/img_001.jpg",
      "pattern": "", "is_primary_key": false, "nullable": false,
      "role": "image" },
    { "field_name_en": "label", "type": "int", "field_name_cn": "类别",
      "description": "图像类别标签", "example_value": "1",
      "pattern": "", "is_primary_key": false, "nullable": false,
      "role": "label", "label_values": [0, 1] }
  ],
  "data_config": {
    "data_type": ["image"], "format": "csv", "encoding": "UTF-8",
    "delimiter": ",", "has_header": true,
    "data_files": {
      "train": { "index_file": "train_labels.csv", "archive": "datas.zip" },
      "test":  { "index_file": "test_labels.csv",  "archive": "datas.zip" }
    }
  }
}

Image_Path 的值是 zip 内部路径。不加 archive 时路径相对于 dataset 根目录。

表格分类(客户转化预测)

my_baseline/
├── dataset_infos.json
├── train.csv          ← 列:id, age, gender, ..., is_convert
└── test.csv
json
{
  "columns": [
    { "field_name_en": "id", "type": "int", "field_name_cn": "客户ID",
      "description": "唯一标识", "example_value": "1001",
      "pattern": "", "is_primary_key": true, "nullable": false,
      "role": "id" },
    { "field_name_en": "age", "type": "int", "field_name_cn": "年龄",
      "description": "客户年龄", "example_value": "35",
      "pattern": "", "is_primary_key": false, "nullable": true },
    { "field_name_en": "gender", "type": "string", "field_name_cn": "性别",
      "description": "M=男, F=女", "example_value": "M",
      "pattern": "", "is_primary_key": false, "nullable": true },
    { "field_name_en": "is_convert", "type": "int", "field_name_cn": "是否转化",
      "description": "1=转化, 0=未转化", "example_value": "1",
      "pattern": "", "is_primary_key": false, "nullable": false,
      "role": "label", "label_values": [0, 1] }
  ],
  "data_config": {
    "data_type": ["structured"], "format": "csv", "encoding": "UTF-8",
    "delimiter": ",", "has_header": true,
    "data_files": {
      "train": { "index_file": "train.csv" },
      "test":  { "index_file": "test.csv" }
    }
  }
}

表格回归(房价预测)

json
{
  "columns": [
    { "field_name_en": "id", "type": "int", "field_name_cn": "房产ID",
      "description": "唯一标识", "example_value": "1",
      "pattern": "", "is_primary_key": true, "nullable": false,
      "role": "id" },
    { "field_name_en": "sqft", "type": "float", "field_name_cn": "面积",
      "description": "平方英尺", "example_value": "2000",
      "pattern": "", "is_primary_key": false, "nullable": false },
    { "field_name_en": "bedrooms", "type": "int", "field_name_cn": "卧室数",
      "description": "卧室数量", "example_value": "3",
      "pattern": "", "is_primary_key": false, "nullable": false },
    { "field_name_en": "price", "type": "float", "field_name_cn": "房价",
      "description": "房屋价格(万)", "example_value": "350.0",
      "pattern": "", "is_primary_key": false, "nullable": false,
      "role": "label" }
  ],
  "data_config": {
    "data_type": ["structured"], "format": "csv", "encoding": "UTF-8",
    "delimiter": ",", "has_header": true,
    "data_files": {
      "train": { "index_file": "train.csv" },
      "test":  { "index_file": "test.csv" }
    }
  }
}

房价是连续值,role: "label" 不写 label_values。 表格类 data_type: ["structured"], 非 id 非 label 的列不写 role。

LLM 对话(JSONL 格式)

my_baseline/
├── dataset_infos.json
├── train.jsonl        ← 每行 {"instruction": "...", "output": "..."}
└── test.jsonl
json
{
  "columns": [
    { "field_name_en": "instruction", "type": "string", "field_name_cn": "用户问题",
      "description": "用户输入的问诊问题", "example_value": "我最近总是头痛...",
      "pattern": "", "is_primary_key": false, "nullable": false,
      "role": "text" },
    { "field_name_en": "output", "type": "string", "field_name_cn": "参考回答",
      "description": "医生的参考回答", "example_value": "根据您的描述...",
      "pattern": "", "is_primary_key": false, "nullable": false,
      "role": "label" }
  ],
  "data_config": {
    "data_type": ["text"], "format": "jsonl", "encoding": "UTF-8",
    "data_files": {
      "train": { "index_file": "train.jsonl" },
      "test":  { "index_file": "test.jsonl" }
    }
  }
}

参考回答是自由文本,role: "label" 不写 label_values。 JSONL 不填 delimiter 和 has_header。

四、常见问题

Q1:哪些列必须写 role?

标注列必写 "label"。有 ID 列写作 "id"。文本/图像/视频/音频类数据的入参列也要写("text" / "image" / "video" / "audio")。表格类(data_type: ["structured"])的普通字段不写。

Q2:data_type 和 role 什么关系?

data_type 是数组,声明数据集包含哪些类型。role 标记每列的角色。两者要对应——data_type: ["text", "image"] 就意味着 columns 里要有 role: "text" 和 role: "image" 的列。

Q3:label_values 什么时候写?

标注是固定几个值的时候写。连续数字或自由文本不写。

Q4:train 和 test 在同一个文件里怎么表示?

用 rows 字段指定行范围(含起始不含结束,行号从 0 开始不包含表头)。

Q5:有图片/视频文件,路径怎么写?

相对于 dataset_infos.json 所在目录。如 datas/train/img_001.jpg。打了 zip 包则写 zip 内部路径,并在 data_files 加 archive。