feat: enhance semantic search detection logic#334
Conversation
There was a problem hiding this comment.
Sorry @Johnson-zs, you have reached your weekly rate limit of 500000 diff characters.
Please try again later or upgrade to continue using Sourcery
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: Johnson-zs The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
1. Modified document file type detection to include more document formats 2. Completely overhauled semantic query detection logic with new requirements 3. Added new test cases covering various semantic query scenarios 4. Implemented more granular control over semantic search triggers 5. Added new utility functions to check semantic intent conditions 6. Introduced new overload for checking semantic queries from parsed intents The changes improve the accuracy of semantic search detection by: 1. Requiring explicit content or context for semantic queries 2. Preventing false positives from single constraints 3. Better handling of keyword-based semantic searches 4. More comprehensive document format support 5. Stricter validation of semantic intent conditions Log: Improved semantic search accuracy with stricter detection rules Influence: 1. Test various document type searches with new supported formats 2. Verify semantic search triggers only for valid combinations 3. Check edge cases with partial constraints without targets 4. Test newly added test cases to ensure proper behavior 5. Validate keyword-based semantic query detection 6. Verify performance with new utility functions 7. Test the new isSemanticQuery overload with pre-parsed intents feat: 增强语义搜索检测逻辑 1. 修改文档类型检测以支持更多文档格式 2. 完全改进了语义查询检测逻辑,加入新要求 3. 添加了覆盖各种语义查询场景的新测试用例 4. 实现了更精细的语义搜索触发控制 5. 添加了检查语义意图条件的新工具函数 6. 新增了用于检查已解析意图语义查询的重载函数 这些改进通过以下方式提高了语义搜索检测的准确性: 1. 要求明确的内容或上下文才能触发语义查询 2. 防止来自单一条件的误报 3. 更好地处理基于关键字的语义搜索 4. 更全面的文档格式支持 5. 更严格的语义意图条件验证 Log: 通过更严格的检测规则提高语义搜索准确性 Influence: 1. 测试使用新支持格式的各种文档类型搜索 2. 验证语义搜索仅在有效组合时触发 3. 检查带有目标的部分约束边缘情况 4. 测试新添加的测试用例以确保正确行为 5. 验证基于关键字的语义查询检测 6. 使用新工具函数测试性能 7. 测试新的isSemanticQuery重载功能与预解析意图
819ab4f to
5f9d841
Compare
deepin pr auto review★ 总体评分:95分■ 【总体评价】
■ 【详细分析】
■ 【改进建议代码示例】 // autotests/dfm-search-tests/tst_semantic_search.cpp
// 建议在 tst_IsSemanticQuery 测试类中增加成员变量并在初始化时赋值
// SemanticSearcher *m_searcher = nullptr;
// void tst_IsSemanticQuery::initTestCase() {
// m_searcher = new SemanticSearcher(this);
// // ... 原有初始化逻辑 ...
// }
// 移除重复的判断逻辑,直接使用被测接口实现测试辅助函数
bool checkIsSemanticQuery(SemanticRuleEngine *engine, IntentParser *parser,
const QString &input, SemanticSearcher *searcher)
{
Q_UNUSED(engine)
ParsedIntent intent;
parser->parse(input, intent);
// 直接复用生产环境的重载方法,避免测试与实现逻辑脱节
return searcher->isSemanticQuery(intent);
} |
formats
requirements
intents
The changes improve the accuracy of semantic search detection by:
Log: Improved semantic search accuracy with stricter detection rules
Influence:
feat: 增强语义搜索检测逻辑
这些改进通过以下方式提高了语义搜索检测的准确性:
Log: 通过更严格的检测规则提高语义搜索准确性
Influence: