Skill: recognize_intent
- - Description: 识别意图类别及初步实体。
- Inputs: [rewrittenquery](从
skills/.workflow/rewrite_output.json 读取) - Outputs: [intent, indicatormetric, metric_info](写入
skills/.workflow/intent_output.json)
- 功能描述:对重写后的问题进行语义分类,识别任务类型并初步提取核心维度信息。
- 输入参数:
- rewritten
query (string): 来自 rewriteoutput.json 的 final_query。
- 输出结果:
- intent (enum): handle
dataquery | handle
metadataquery | attribution_analysis | other。
- indicator_metric (list): 指标 + 维度数据。
- mode (string): single | multi。
- 执行策略:若 confidence < 0.7,强制触发 clarify_workflow(澄清流程)。
注入服务(通过 .env 配置)
| 服务类 | 作用 | .env 关键配置 |
|---|
| INLINECODE3 | 指标别名向量搜索(Milvus indicator_alias) | INLINECODE5 , EMBEDDING_*, INLINECODE7 |
| INLINECODE8 |
指标维度配置(MySQL
indicator_metric) |
INTENT_MYSQL_* 或
MYSQL_* |
|
_RealDictValueReplacer | 字典值替换(Milvus
sys_dict) |
SYS_DICT_COLLECTION_NAME(默认
sys_dict),
DICT_REPLACE_MIN_SCORE(默认
0.50) |
|
_RealSemanticConceptExtractor | L1 语义概念抽取 + semantic
logicdict 向量增强 |
SEMANTIC_LOGIC_COLLECTION(默认
semantic_logic_dict),
SEMANTIC_LOGIC_MIN_SCORE(默认
0.80) |
所有服务连接失败时均自动降级为 None,主流程继续运行(仅跳过对应增强步骤):
- -
_RealDictValueReplacer 失败 → 跳过中文值替换 - INLINECODE25 失败 → 跳过 L1/L2 候选融合,直接使用 L2 槽位结果
独立运行说明
CODEBLOCK0
下一步
CODEBLOCK1
Skill: recognize_intent
- - 描述:识别意图类别及初步实体。
- 输入:[rewrittenquery](从 skills/.workflow/rewriteoutput.json 读取)
- 输出:[intent, indicatormetric, metricinfo](写入 skills/.workflow/intent_output.json)
- 功能描述:对重写后的问题进行语义分类,识别任务类型并初步提取核心维度信息。
- 输入参数:
- rewritten
query (字符串):来自 rewriteoutput.json 的 final_query。
- 输出结果:
- intent (枚举):handle
dataquery | handle
metadataquery | attribution_analysis | other。
- indicator_metric (列表):指标 + 维度数据。
- mode (字符串):single | multi。
- 执行策略:若 confidence < 0.7,强制触发 clarify_workflow(澄清流程)。
注入服务(通过 .env 配置)
| 服务类 | 作用 | .env 关键配置 |
|---|
| RealIndicatorSearcher | 指标别名向量搜索(Milvus indicatoralias) | MILVUS, EMBEDDING, INDICATORALIASCOLLECTIONNAME |
| RealMetricConfigLoader |
指标维度配置(MySQL indicator
metric) | INTENTMYSQL
或 MYSQL |
|
RealDictValueReplacer | 字典值替换(Milvus sysdict) | SYS
DICTCOLLECTION
NAME(默认 sysdict), DICT
REPLACEMIN_SCORE(默认 0.50) |
|
RealSemanticConceptExtractor | L1 语义概念抽取 + semanticlogic
dict 向量增强 | SEMANTICLOGIC
COLLECTION(默认 semanticlogic
dict), SEMANTICLOGIC
MINSCORE(默认 0.80) |
所有服务连接失败时均自动降级为 None,主流程继续运行(仅跳过对应增强步骤):
- - RealDictValueReplacer 失败 → 跳过中文值替换
- RealSemanticConceptExtractor 失败 → 跳过 L1/L2 候选融合,直接使用 L2 槽位结果
独立运行说明
bash
前置:先运行 rewritequestion.py 生成 rewriteoutput.json
python ../rewrite-question/rewrite_question.py --query 今天汉河店的成交额
运行意图识别(从 .workflow/rewrite_output.json 自动读取)
python recognize_intent.py
带清理(清除本步及后续输出,防止旧数据污染)
python recognize_intent.py --clean
下一步
bash
python ../mult-call/multi_call.py