# data-training **Repository Path**: Uni-Create-Link/data-training ## Basic Information - **Project Name**: data-training - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2025-12-22 - **Last Updated**: 2026-07-20 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Data Training: annotation and training quality pipeline 本仓库只发布当前 active 代码: - `annotation/`:四任务 direct-URL 标注、版本化 `single_qwen_direct_v1`、prompt、deterministic validator/timebase/Fusion lineage 门禁和 exact-byte 发布。 - `training/`:task-scoped dataset builder/contract、四任务训练入口与 Fusion feature cache。 - `tests/`:不调用真实 API、不下载媒体、不训练模型的离线回归。 运行产物、媒体、模型、缓存和 API Key 均不进入 Git。 ## 1. 在新设备克隆并安装标注依赖 ```powershell git clone https://gitee.com/Uni-Create-Link/data-training.git cd .\data-training py -3 -m venv .venv .\.venv\Scripts\Activate.ps1 python -m pip install --upgrade pip pip install -r .\requirements-annotation.txt ``` 如 PowerShell 阻止激活脚本,可仅对当前进程执行: ```powershell Set-ExecutionPolicy -Scope Process Bypass .\.venv\Scripts\Activate.ps1 ``` ## 2. 在当前 PowerShell 会话设置 API ```powershell $env:QWEN_API_KEY = '<请填写你已轮换的新Key>' $env:QWEN_BASE_URL = 'https://api.qnaigc.com/v1' $env:ANNOTATION_MEDIA_BASE_URL = 'https://cloudstor.tripln.top/xy500:' ``` 不要把 Key 写进 `.py`、`.json`、`.ps1`、README 或 Git。此前本机源文件中出现过明文 Key,建议在开始全量前先在服务商侧轮换。 新标注只使用一个 Qwen runtime,不读取 `annotation/committee_config.json`,也不调用 Kimi、Doubao、review、adjudicator、observer 或 final verifier。模型默认使用 `qwen/qwen3.6-plus`;可通过环境变量或 CLI `--model-name` 覆盖: ```powershell $env:ANNOTATION_QWEN_MODEL_NAME = 'qwen/qwen3.6-plus' ``` ## 3. 先做离线检查和一个真实 smoke ```powershell python -m unittest discover -s tests\annotation -p 'test_*.py' -q python .\annotation\run_annotation.py --task all --only-id 8 ``` 这里的 `--task all --only-id 8` 是真实付费的四任务 smoke;每个 task/video 最多三次 Qwen direct attempt,warning 不会追加其他模型请求。四任务顺序固定为: ```text whisper -> audio_events -> scene -> fusion ``` 对象键固定为: - Whisper / Audio Events:`full/full-.mp4` - Scene:`videoonly/videoonly-.mp4` - Fusion:`full/full-.mp4` 程序只把 public `video_url` 交给 API;不下载、HEAD、读取 body 或本地解码远端媒体。 ## 4. 有界批量全量标注 推荐先每批 5 个并人工确认是否继续: ```powershell .\run_full_annotation.ps1 -Start 8 -End 20 -BatchSize 5 ``` 覆盖更大范围时显式指定,例如: ```powershell .\run_full_annotation.ps1 -Start 21 -End 1213 -BatchSize 5 ``` 脚本默认每批后暂停,检查输出后输入 `y` 才继续。只有在已有外部监控时才使用: ```powershell .\run_full_annotation.ps1 -Start 21 -End 1213 -BatchSize 5 -ContinueWithoutPrompt ``` 不建议无界并发。顶层 stable JSON 是唯一完成标记,重跑相同范围会自动跳过已完成项;quarantine/dropped 仍可显式重试。每个 `runtime/batch_logs/*.log` 现在同时包含 PowerShell 批次上下文和 Python 阶段进度,便于逐批审计后再继续。 结果位于: ```text runtime/annotation_results// ``` 重点审计: - `provenance/.json` - `audit/routing/.json` - `raw_responses//` - `quarantine/.json` - stable `.json` quarantine 不会进入 Fusion context 或训练监督。 ## 5. 标注完成后构建训练数据 新结果只产生 accepted/direct。只有在历史 adjudicated、quarantine、类别分布和 human-gold 评估完成后再构建。`repaired/adjudicated` 与 `--include-adjudicated` 仅用于读取经过旧 proof reader 验证的历史结果;新 direct 结果不会写入 `repaired/`: ```powershell python .\training\cli\build_training_datasets.py ` --annotation-run .\runtime\annotation_results ` --dataset-run .\dataset_runs\run-001 ` --include-adjudicated ``` 训练依赖与命令见 `training/README.md`。全量标注完成不等于模型可直接上线;必须先通过 dataset contract、batch readiness、人工 gold 离线指标、端到端测试、影子运行和灰度验证。