ChatLabel
ChatLabel 是一个任务中立、可审计的结构化标注网站。当前主线是 Excel 上传、解析、模型建议、在线资料纠正、人工核验和新 Excel 导出。首个内置任务为“中国至印尼物流承运分类”,适用南沙、汕头、义乌仓至印尼线路。
0.1.4 使用 ChatLogin 保护共享内部工作区;默认无账号时拒绝内部访问,不提供默认密码。公开访客仅可浏览固定 HF 参考版本。登录后可在汇总校对中查看图文、全部来源和未校准置信依据,保存九类标签修订。配置、接口迁移及部署见 工作台与访问控制。
当前版本优先完善分类内核:从人工确认表构建可追溯 ground truth、提取 WPS 图片证据、通过 gpt-5.6-sol / xhigh 调用流式 Responses API,并运行无产品组泄漏的交叉验证和固定留出验收。
自动输出是建议结果。完成图片逐项复核、高风险审计和一致性校验前,不应作为最终业务分类。
文档入口:https://arch.gh.wzhecnu.cn/ChatLabel/
安装与运行
pip install ChatLabel
chatlabel --version
chatlabel --tree
chatlabel serve
默认页面:http://127.0.0.1:8765/。正式入口为 https://label.public.wzhecnu.cn/;目标机本地入口为 https://label.local.wzhecnu.cn/。公网入口由现有 wildcard DNS、共享证书和自动转发层接入,不创建逐服务 DNS 记录。
配置
ChatLabel 从 ChatEnv 读取名为 apple 的既有 OpenAI profile,也可通过环境变量调整:
| 变量 | 默认值 | 作用 |
|---|---|---|
CHATLABEL_DATA_DIR |
.chatlabel-data |
SQLite、上传文件、图片证据与导出产物目录 |
CHATLABEL_CLASSIFIER |
openai-responses |
正式网站使用 openai-responses;rules 仅供离线开发测试 |
CHATLABEL_OPENAI_PROFILE |
apple |
要读取的 OpenAI profile |
CHATLABEL_OPENAI_MODEL |
gpt-5.6-sol |
Responses API 模型 |
CHATLABEL_REASONING_EFFORT |
xhigh |
推理强度 |
CHATLABEL_MAX_OUTPUT_TOKENS |
2400 |
单条 proposal 最大输出 token |
CHATLABEL_MAX_UPLOAD_BYTES |
134217728 |
单个上传文件大小上限 |
CHATLABEL_MAX_UNCOMPRESSED_BYTES |
536870912 |
XLSX 解压后大小上限 |
CHATLABEL_PROPOSAL_WORKERS |
2 |
单实例 proposal 并发数 |
进程级 OPENAI_* 会覆盖 profile 值。模型请求只接受 API Key,不把 key 写入任务或评测结果。网页配置接口只显示模型、API 地址和“是否有 API Key”,不会返回凭据内容。
数据与评测
chatlabel dataset-build \
--data-root /path/to/data \
--fixtures /path/to/example-cases.json \
--output-dir /path/to/ground-truth
chatlabel cross-validate \
--dataset-dir /path/to/ground-truth \
--output-dir /path/to/cv-results \
--folds 5 --limit-per-fold 8 --concurrency 2
chatlabel evaluate \
--dataset-dir /path/to/ground-truth \
--output-dir /path/to/validation-results \
--split validation --concurrency 2
evaluate 默认断点续跑:相同 prompt 的成功记录直接复用,失败或未完成记录重试,并在每条完成后原子更新 results.jsonl。使用 --no-resume 可强制重跑所选 split。
独立 challenge set 可通过 --example-dataset-dir 显式使用生产批准的 example/train 检索池;目标集仍保持独立、不可进入示例池。
ground truth 同时保存来源工作簿、sheet、行号、文件哈希、原始标签、规范化标签、图片哈希和 policy override。旧式 慢线、无当前依据的历史拒收、缺图、条件性结论和冲突记录进入 review queue,不进入准确率 gold。
HTTP API
以下旧 Case/Job API 清单保留用于历史数据兼容:所有内部 GET 须登录,Case 写入及 Job proposals/review/validate/export 均已退役并返回 410。当前写入使用 /api/v1/files 和 /api/v1/datasets,详见 工作台接口。不能使用旧接口绕过人工核验门槛。
GET /healthz:进程健康检查。GET /readyz:SQLite、task registry、运行目录和模型配置就绪检查。GET /api/v1/model:模型、推理强度、prompt 版本和 API Key 可用状态。GET /api/v1/task-types:读取版本化任务定义。GET /api/v1/task-types/{task_id}/examples:读取随任务版本发布的已校对示例。POST /api/v1/cases:通过 Responses API 创建并持久化单条 Case 建议。GET /api/v1/cases/{case_id}:读取 Case、模型元数据、人工结果和事件记录。GET /api/v1/cases/{case_id}/image:在人工复核页回看该 Case 的图片证据。PATCH /api/v1/cases/{case_id}/review:接受、纠正或标记单条 Case 为 unresolved。POST /api/v1/jobs:multipart 上传任务类型与 Excel。GET /api/v1/jobs/{job_id}/events:读取上传、解析、模型、复核、校验和导出事件。GET /api/v1/jobs/{job_id}/records:分页读取规范化记录、proposal 和 review。POST /api/v1/jobs/{job_id}/proposals:运行该工作簿的 proposal 阶段。PATCH /api/v1/jobs/{job_id}/records/{record_id}/review:接受、纠正或 unresolved。POST /api/v1/jobs/{job_id}/validate:运行覆盖率、备注、冲突、源文件和 WPS 闸门。POST /api/v1/jobs/{job_id}/export:仅在闸门通过后生成 Excel、JSONL 和报告。GET /api/v1/jobs/{job_id}/artifacts/{artifact_id}:下载持久化产物。
proposal 响应保留 Responses API 的 response id、模型、状态、延迟、token 用量和检索示例摘要,并始终返回 final=false。SQLite 使用 WAL;服务重启后仍可读取 case、job、record、proposal、review、validation、artifact 和审计事件。旧式无持久化 /api/v1/proposals 与 /api/tasks 已返回 410 Gone。
开发验证
python -m pip install -e ".[dev,docs]"
python -m pytest -q
chatlabel --help
chatlabel --tree
python -m build
mkdocs build --strict
进一步查看:CLI 树、能力地图、Python 接口树。
Metadata
Release files for ChatLabel 0.1.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| chatlabel-0.1.4.tar.gz | 235.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| chatlabel-0.1.4-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 480.9 kB
Release files / chatlabel-0.1.4.tar.gz
| Download URL | chatlabel-0.1.4.tar.gz |
|---|---|
| Size | 235.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
506cf63a157afd9891da0e312d40d1cbb612e21a9a0c5622d7281c7006650c55
|
|
BLAKE2b-256 checksum How to use checksums |
fd7bc435266333ec6b603d270c5113f464d0707a97bf4f08238ace0f9bcb281b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 1, 2026.
Transparency logRelease files / chatlabel-0.1.4-py3-none-any.whl
| Download URL | chatlabel-0.1.4-py3-none-any.whl |
|---|---|
| Size | 245.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7ee9dfc04c6ffa81e0560e91957742edfc9073711afcaf5b752c77cfb9c1ca6d
|
|
BLAKE2b-256 checksum How to use checksums |
bcb10d94a9696107779a23d3e66e9e5df87f2f35d2ee43831793b9dfe4ebe5ed
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 1, 2026.
Transparency log