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

嘉兴高端网站建设公司aspnet网站开发实例教程pdf

嘉兴高端网站建设公司,aspnet网站开发实例教程pdf,德清县城乡建设局网站,android studio手机版下载一、向量相似度搜索 在Milvus中进行向量相似度搜索时#xff0c;会计算查询向量和集合中具有指定相似性度量的向量之间的距离#xff0c;并返回最相似的结果。通过指定一个布尔表达式来过滤标量字段或主键字段#xff0c;您可以执行混合搜索。 1.加载集合 执行操作的前提是…一、向量相似度搜索 在Milvus中进行向量相似度搜索时会计算查询向量和集合中具有指定相似性度量的向量之间的距离并返回最相似的结果。通过指定一个布尔表达式来过滤标量字段或主键字段您可以执行混合搜索。 1.加载集合 执行操作的前提是集合加载到内存。 from pymilvus import Collection collection Collection(book) # Get an existing collection. collection.load() 2.准备搜索参数 搜索参数要适应你的搜索场景。 search_params {metric_type: L2, offset: 0, ignore_growing: False, params: {nprobe: 10}#适合 IVF_FLAT index } params的可选参数和值如下 nprobe Indicates the number of cluster units to search. This parameter is available only when index_type is set to IVF_FLAT, IVF_SQ8, or IVF_PQ. The value should be less than nlist specified for the index-building process. ef Indicates the search scope. This parameter is available only when index_type is set to HNSW. The value should be within the range from top_k to 32768. radius Indicates the angle where the vector with the least similarity resides. range_filter Indicates the filter used to filter vector field values whose similarity to the query vector falls into a specific range. 3.进行向量搜索 # 使用集合对象的 search 方法来进行向量检索 results collection.search(data[[0.1, 0.2]], # 查询向量anns_fieldbook_intro, # 指定用于检索的字段paramsearch_params, # 检索参数limit10, # 返回结果数量的限制exprNone, # 查询表达式output_fields[title], # 指定要从搜索结果中检索的字段consistency_levelStrong # 一致性级别 )# 获取搜索结果中最相似的文档 IDs results[0].ids# 获取搜索结果中的距离值 results[0].distances# 获取第一个匹配的文档 hit results[0][0]# 从匹配的文档中获取 title 字段的值 hit.entity.get(title) 二、混合搜索 混合搜索是使用属性过滤的向量搜索。通过指定过滤标量字段或主键字段的布尔表达式来先限定搜索范围。 1.加载集合 2.进行混合向量搜索 其实也就是在前面的搜索配置加了个布尔表达式 search_param {data: [[0.1, 0.2]],anns_field: book_intro,param: {metric_type: L2, params: {nprobe: 10}, offset: 0},limit: 10,expr: word_count 11000, } res collection.search(**search_param) 3.检查搜索结果 assert len(res) 1 # 断言 hits res[0] assert len(hits) 2 print(f- Total hits: {len(hits)}, hits ids: {hits.ids} ) print(f- Top1 hit id: {hits[0].id}, distance: {hits[0].distance}, score: {hits[0].score} ) 三、范围搜索 1.加载集合 2.定义范围搜索参数 l2度量 param {# use L2 as the metric to calculate the distancemetric_type: L2,params: {# search for vectors with a distance smaller than 1.0radius: 1.0,# 半径 只有距离查询向量的距离小于半径值的向量才会被返回作为检索结果。# filter out vectors with a distance smaller than or equal to 0.8range_filter : 0.8 #大于或等于指定值的向量将被返回作为检索结果} }内积ip度量 param {# use IP as the metric to calculate the distancemetric_type: IP,params: {# search for vectors with a distance greater than 0.8radius: 0.8,# filter out most similar vectors with a distance greater than or equal to 1.0range_filter : 1.0} }3.执行范围搜索 res collection.search(data[[0.3785311281681061,0.2960498034954071]], # query vectoranns_fieldbook_intro, # vector field nameparamparam, # search parameters defined in step 2limit5 # number of results to return )print(res)
http://www.dnsts.com.cn/news/141830.html

相关文章:

  • 建设专业网站哪家技术好做的比较好的国外网站一级页面布局分析
  • 网站建设最新新闻wordpress 主题排名
  • 网站域名免费吗网站做全景图预览
  • 美丽说网站代码与蘑菇街网站代码是用什么网站语言做的网页游戏开发技术
  • 盐城seo网站优化唐山网站开发公司
  • 无锡电子商务网站制作天津建设银行网站首页
  • 长沙网站推广平台wordpress建站详解
  • 东莞seo建站视频做销售的什么网站好
  • 收费网站有哪些企业培训课程设置
  • 大量网站开发视频 文档VIP资源海淀网站建设价格
  • 厦门专业网站建设wordpress产品展示类
  • 微网站和手机网站aso优化平台有哪些
  • 怎么做企业网站推广赚钱wordpress创账号教程
  • 网络推广企业网站推广策划书wordpress搭建博客视频教程
  • 艾迪网络专业的网站建设公司wordpress 无插件主题
  • 宜春做网站的公司哪家好网站推广的意义和方法
  • 响应式网站高度如何计算网上鲜花店网站建设实施方案
  • 山西威力网站建设推荐万维网包括哪些网站
  • 汽车配件生产企业网站模板做外贸有哪些好的网站有哪些
  • 汽车宣传网站模板岳阳建设商城网站公司
  • 谁有可以用的网站建设网站方面的证书
  • 高密公司做网站网站设计费用多少
  • 云服务器怎么架设网站岳阳网站搭建
  • 建设网站分几个步骤现在那个网站做宣传有效果
  • 网站建设内容是经营项目吗顺德网站制作有哪些公司
  • 江门网站快速排名如何做网站 seo
  • 上海医院设计网站建设九江网站优化
  • 海口网站制作wordpress崩了
  • 常州网站制作公司多吗网站优化关键词排名怎么做
  • 阿里云主机怎么做两个网站最便宜的购物软件排名