ChatLabel
ChatLabel 是一个任务中立、可审计的结构化标注网站。任务 manifest 定义输入字段、允许标签、示例、适配器和完成闸门;同一任务既可处理单条 Case,也可完成 Excel 上传、解析、模型建议、人工校对、校验和导出闭环。首个内置任务是印尼线路产品分类。
当前版本优先完善分类内核:从人工确认表构建可追溯 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
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.3
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.3.tar.gz | 94.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| chatlabel-0.1.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 187.4 kB
Release files / chatlabel-0.1.3.tar.gz
| Download URL | chatlabel-0.1.3.tar.gz |
|---|---|
| Size | 94.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ff18f0f415a78ec6370129f310bb4a900fc59569738780309e38f0c53e57e419
|
|
BLAKE2b-256 checksum How to use checksums |
05448fc04906f34948505a88cf314fad37e46e348041d74c10f9bda3f3b2a7af
|
| 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 Sep 24, 2026.
Transparency logRelease files / chatlabel-0.1.3-py3-none-any.whl
| Download URL | chatlabel-0.1.3-py3-none-any.whl |
|---|---|
| Size | 93.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e31acfd49058f22e22bfd4d5bdb05c67978853fc4702df1cb384aba69149374a
|
|
BLAKE2b-256 checksum How to use checksums |
cce8c3ef0bd9a60bf93aed9ac42ac7e580652af829d046f65c712790a7f142c3
|
| 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 Sep 24, 2026.
Transparency log