Files
zk-data-agent/skills/online-mining-v2/README.md
T
2026-05-12 17:01:43 +08:00

39 lines
1.5 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# online-mining-v2
`online-mining-v2` 是线上数据挖掘 skill。它把 `elk-fetch` 作为默认线上数据源,把 `product-data` 作为挖掘结果的标准数据后处理链路。
## 设计目标
- 线上数据源默认走 ELK,而不是本地 parquet。
- 挖掘能力放在 skill 目录内,不注册新的平台工具。
- 所有脚本支持 JSON stdin/stdout,方便迁移到其他 Agent。
- 挖出的线上 case 不直接手写最终格式,而是转成 `product-data` 的 dataset draft,再进入 canonical record、校验和导出。
## 主要脚本
| 脚本 | 作用 |
| --- | --- |
| `scripts/elk_profile_index.py` | 采样索引 schema 和关键字段,帮助 Agent 判断字段可用性。 |
| `scripts/elk_search_cases.py` | 按 query/domain/prompt/model output/candidate domain 等条件搜索候选 case。 |
| `scripts/elk_fetch_by_request_ids.py` | 批量按 request id 拉取 main/pre_processing 原始摘要。 |
| `scripts/elk_join_request_logs.py` | 把 `arch-flat-nlp-log-f-*``pre-processing-info*` 按 request id 合并。 |
| `scripts/build_dataset_draft.py` | 把 review 后的线上 case 转成 product-data dataset draft text。 |
## 数据源
- `main``arch-flat-nlp-log-f-*`
- `pre_processing``pre-processing-info*`
字段说明见 `knowledge/数据源字段说明.md`
## 后处理
后处理复用 `skills/product-data/scripts/`
1. `normalize_dataset_draft.py`
2. `validate_dataset_records.py`
3. `export_dataset_records.py`
4. 可选 `export_training_jsonl.py`
5. 可选 `export_planning_eval_csv.py`