当前位置: 首页 > news >正文

Inconsistent Query Results Based on Output Fields Selection in Milvus Dashboard

题意:在Milvus仪表盘中基于输出字段选择的不一致查询结果

问题背景:

I'm experiencing an issue with the Milvus dashboard where the search results change based on the selected output fields.

我遇到了一个与 Milvus 仪表板相关的问题,即搜索结果会根据所选的输出字段而发生变化。

I'm working on a RAG project using text data converted into embeddings, stored in a Milvus collection with around 8000 elements. Last week, my retrieval results matched my expectations ("good" results), however, this week, the results have degraded ("bad" results).

我正在进行一个基于检索增强生成(RAG)的项目,该项目使用转换为嵌入的文本数据,这些数据存储在包含大约8000个元素的Milvus集合中。上周,我的检索结果与我的预期相符(“好”结果),但本周,结果却变差了(“差”结果)。

I found that when I exclude the embeddings_vector field from the output fields in the Milvus dashboard, I get the "good" results; Including the embeddings_vector field in the output changes the results to "bad".

我发现,当我在 Milvus 仪表板的输出字段中排除 embeddings_vector 字段时,我得到的是“好”的结果;但是,如果在输出中包含 embeddings_vector 字段,结果就会变为“差”。

I've attached two screenshots showing the difference in the results based on the selected output fields.

我已附上两张截图,展示了基于所选输出字段的结果差异。

Any ideas on what's causing this or how to fix it?        

关于是什么导致了这个问题或如何解决它,你有什么想法吗?

Environment:        应用环境

Python 3.11 pymilvus 2.3.2 llama_index 0.8.64

Thanks in advance!        预先感谢!

from llama_index.vector_stores import MilvusVectorStore
from llama_index import ServiceContext, VectorStoreIndex# Some other lines..# Setup for MilvusVectorStore and query execution
vector_store = MilvusVectorStore(uri=MILVUS_URI,token=MILVUS_API_KEY,collection_name=collection_name,embedding_field='embeddings_vector',doc_id_field='chunk_id',similarity_metric='IP',text_key='chunk_text')embed_model = get_embeddings()
service_context = ServiceContext.from_defaults(embed_model=embed_model, llm=llm)
index = VectorStoreIndex.from_vector_store(vector_store=vector_store, service_context=service_context)
query_engine = index.as_query_engine(similarity_top_k=5, streaming=True)rag_result = query_engine.query(prompt)

Here is the "good" result: "good" result And here is the "bad" result: "bad" result

这是“好”的结果:“好”的结果。而这是“坏”的结果:“坏”的结果。

问题解决:

I would like to suggest you to follow below considerations.

我想建议你遵循以下考虑因素。

  • Ensure that your Milvus collection is correctly indexed. Indexing plays a crucial role in how search results are retrieved and ordered. If the index configuration has changed or is not optimized, it might affect the retrieval quality.

确保你的Milvus集合已正确索引。索引在检索和排序搜索结果方面起着至关重要的作用。如果索引配置已更改或未优化,则可能会影响检索质量。

  • In your screenshots, the consistency level is set to "Bounded". Try experimenting with different consistency levels (e.g., "Strong" or "Eventually") to see if it impacts the results. Consistency settings can influence the real-time availability of the indexed data.

在你的截图中,一致性级别被设置为“Bounded”。尝试使用不同的一致性级别(例如,“Strong”或“Eventually”)进行实验,看看它是否会影响结果。一致性设置可以影响索引数据的实时可用性。

  • Review the query parameters, especially the similarity_metric. Since you're using IP (Inner Product) as the similarity metric, ensure that your embedding vectors are normalized correctly. Inner Product search works best with normalized vectors.

检查查询参数,特别是similarity_metric。由于你使用IP(内积)作为相似度度量,请确保你的嵌入向量已正确归一化。内积搜索在归一化向量上效果最好。

  • Verify that the embedding vectors are of consistent quality and scale. If there were changes in the embedding model or preprocessing steps, it could lead to variations in the search results.

验证嵌入向量的质量和规模是否一致。如果嵌入模型或预处理步骤发生了变化,那么搜索结果可能会出现差异。

  • The inclusion of the embeddings_vector field in the output might affect the way Milvus scores and ranks the results. It's possible that returning the raw embeddings affects the internal ranking logic. Ensure that including this field does not inadvertently alter the search behavior.

在输出中包含embeddings_vector字段可能会影响Milvus对结果的评分和排名方式。返回原始嵌入可能会影响内部排名逻辑。请确保包含此字段不会无意中改变搜索行为。

  • Check the Milvus server logs and performance metrics to identify any anomalies or changes in the search behavior. This might provide insights into why the results differ when the embeddings_vector field is included.

检查Milvus服务器日志和性能指标,以识别搜索行为中的任何异常或变化。这可能会提供关于为什么在包含embeddings_vector字段时结果会有所不同的见解。

  • Ensure that there are no version mismatches between the client (pymilvus) and the Milvus server. Sometimes, discrepancies between versions can cause unexpected behavior.

确保客户端(pymilvus)和Milvus服务器之间不存在版本不匹配。有时,版本之间的差异可能会导致意外行为。

  • As a last resort, try modifying your code to exclude the embeddings_vector field programmatically during retrieval and compare the results. This can help isolate whether the issue is indeed caused by including the embeddings in the output.

作为最后的手段,尝试修改您的代码,以便在检索时通过编程方式排除embeddings_vector字段,并比较结果。这有助于隔离问题是否确实是由在输出中包含嵌入项引起的。

  • Please try out this code if it helps.        如果这段代码有帮助的话,请尝试一下

相关文章:

  • 北京网站建设多少钱?
  • 辽宁网页制作哪家好_网站建设
  • 高端品牌网站建设_汉中网站制作
  • leetcode 106. 从中序与后序遍历序列构造二叉树
  • 深入分析 Android ContentProvider (三)
  • windows11 ,ubuntu20.04双系统,ubuntu没有wifi的解决方式
  • LeetCode-day20-2850. 将石头分散到网格图的最少移动次数
  • MongoDB - 数组更新操作符:$、$[]、$pop、$pull、$push、$each、$sort、$slice、$position
  • C# 时间、空间复杂度
  • STM32自己从零开始实操10:PCB全过程
  • rce漏洞-ctfshow(50-70)
  • 如何开启或者关闭 Windows 安全登录?
  • Python爬虫(基本流程)
  • 【机器学习】机器学习的基本知识点(包括背景、定义、具体内容、功能、使用场景、操作、未来发展和常见算法)
  • WebKit与PWA:打造无缝的渐进式Web应用体验
  • Android14之调试广播实例(二百二十五)
  • 适合销售使用的记录客户的备忘录软件
  • 大陆居民在香港纳税政策
  • 【面试系列】之二:关于js原型
  • 【跃迁之路】【444天】程序员高效学习方法论探索系列(实验阶段201-2018.04.25)...
  • 【跃迁之路】【641天】程序员高效学习方法论探索系列(实验阶段398-2018.11.14)...
  • 002-读书笔记-JavaScript高级程序设计 在HTML中使用JavaScript
  • css选择器
  • css属性的继承、初识值、计算值、当前值、应用值
  • JS笔记四:作用域、变量(函数)提升
  • Linux编程学习笔记 | Linux多线程学习[2] - 线程的同步
  • Mybatis初体验
  • WebSocket使用
  • yii2权限控制rbac之rule详细讲解
  • 阿里云前端周刊 - 第 26 期
  • 猴子数据域名防封接口降低小说被封的风险
  • 看图轻松理解数据结构与算法系列(基于数组的栈)
  • 容器服务kubernetes弹性伸缩高级用法
  • 如何进阶一名有竞争力的程序员?
  • 一个SAP顾问在美国的这些年
  • 责任链模式的两种实现
  • ‌JavaScript 数据类型转换
  • ###C语言程序设计-----C语言学习(6)#
  • (DenseNet)Densely Connected Convolutional Networks--Gao Huang
  • (k8s)Kubernetes 从0到1容器编排之旅
  • (web自动化测试+python)1
  • (超简单)使用vuepress搭建自己的博客并部署到github pages上
  • (接口自动化)Python3操作MySQL数据库
  • (实测可用)(3)Git的使用——RT Thread Stdio添加的软件包,github与gitee冲突造成无法上传文件到gitee
  • (一)Mocha源码阅读: 项目结构及命令行启动
  • (转)大道至简,职场上做人做事做管理
  • ***linux下安装xampp,XAMPP目录结构(阿里云安装xampp)
  • ***监测系统的构建(chkrootkit )
  • .NET 6 Mysql Canal (CDC 增量同步,捕获变更数据) 案例版
  • .Net Core缓存组件(MemoryCache)源码解析
  • .NET Framework、.NET Core 、 .NET 5、.NET 6和.NET 7 和.NET8 简介及区别
  • .NET 简介:跨平台、开源、高性能的开发平台
  • .NET/C# 利用 Walterlv.WeakEvents 高性能地中转一个自定义的弱事件(可让任意 CLR 事件成为弱事件)
  • .NET国产化改造探索(一)、VMware安装银河麒麟
  • .NET文档生成工具ADB使用图文教程
  • .NET值类型变量“活”在哪?
  • .net中调用windows performance记录性能信息
  • /etc/fstab和/etc/mtab的区别