更新多个模块,优化API密钥管理,增强意图识别和Excel数据验证功能,添加置信度评分,改进日志记录和错误处理机制,支持调试模式,提升代码可读性和灵活性。
This commit is contained in:
@@ -8,8 +8,6 @@ Description: 意图识别和问题改写示例
|
||||
|
||||
import os
|
||||
from dotenv import load_dotenv
|
||||
from regex import F
|
||||
from rag2_0.intent_recognition import IntentRecognizer
|
||||
import pandas as pd
|
||||
import logging
|
||||
import json
|
||||
@@ -19,6 +17,8 @@ import time
|
||||
import sys
|
||||
import argparse
|
||||
from typing import List, Dict
|
||||
sys.path.append(os.getcwd())
|
||||
from rag2_0.intent_recognition import IntentRecognizer
|
||||
# 加载环境变量
|
||||
load_dotenv()
|
||||
|
||||
@@ -176,7 +176,7 @@ def save_results_to_excel(results, output_file, is_final=False):
|
||||
logging.info(f"已保存{len(valid_results)}条结果至: {temp_output_file}")
|
||||
|
||||
# 示例查询
|
||||
examples_query = """.BDD3是哪款软件编制的"""
|
||||
examples_query = """D3软件结算工程怎么解锁清单"""
|
||||
conversation_context=""
|
||||
chat_history=[
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user