Skip to content

Commit 2cab40b

Browse files
committed
fix(RAGEvaluationTab): 修复指标值格式化逻辑中百分比转换的条件
将val < 1改为val <= 1以确保所有0.0-1.0范围的检索指标都能正确转换为百分比
1 parent 4eb2c49 commit 2cab40b

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

docs/latest/changelog/roadmap.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
- 目前的知识库的图片存在公开访问风险
2323
- 工具传递给模型的时候,使用英文,但部分模型不支持中文函数名(如gpt-4o-mini)
2424
- 首页加载的问题
25-
- lightrag 类型的图谱的节点数量统计有问题
2625

2726
### 新增
2827
- 新增对于上传附件的智能体中间件,详见[文档](https://xerrors.github.io/Yuxi-Know/latest/advanced/agents-config.html#%E6%96%87%E4%BB%B6%E4%B8%8A%E4%BC%A0%E4%B8%AD%E9%97%B4%E4%BB%B6)

web/src/components/RAGEvaluationTab.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -941,7 +941,8 @@ const getMetricShortName = (key) => {
941941
// 格式化指标值
942942
const formatMetricValue = (val) => {
943943
if (typeof val !== 'number') return '-';
944-
if (val < 1) return (val * 100).toFixed(1) + '%';
944+
// 检索指标(recall, precision, f1 等)范围是 0.0-1.0,统一转换为百分比
945+
if (val <= 1) return (val * 100).toFixed(1) + '%';
945946
return val.toFixed(3);
946947
};
947948

0 commit comments

Comments
 (0)