Elasticsearch 开放推理 API 增加了对 IBM watsonx.ai Slate 嵌入模型的支持

作者:来自 Elastic Saikat Sarkar

使用 Elasticsearch 向量数据库构建搜索 AI 体验时如何使用 IBM watsonx™ Slate 文本嵌入。

Elastic 很高兴地宣布,通过集成 IBM watsonx™ Slate 嵌入模型,我们的开放推理 API 功能得以扩展,这标志着我们与 IBM watsonx 团队持续合作的一个重要里程碑。通过此公告,Elasticsearch 用户可立即、轻松地访问 IBM 的 Slate 系列模型,而 IBM watsonx 社区则可利用 Elasticsearch 全面的 AI 搜索工具和经过验证的向量数据库功能。

Elastic 的开放推理 API(open inference API) 现正式发布,它使你能够创建端点并使用来自 IBM watsonx™ 等提供商的机器学习模型。IBM® watsonx™ AI 和数据平台包括核心组件和 AI 助手,旨在使用可信数据扩展和加速 AI 的影响。该平台具有开源 Slate 嵌入模型(slate-125m、slate-30m),用于检索增强生成、语义搜索和文档比较,以及在可信企业数据上训练的Granite 系列 LLMs。

在本博客中,我们将解释在使用 Elasticsearch 向量数据库构建 Search AI 体验时如何使用 IBM watsonx™ Slate 文本嵌入。Elastic 现在支持使用这些文本嵌入,新的 semantic_text 字段默认对传入文本进行分块,以适应平台模型的标记限制。

先决条件和推理端点的创建

你需要一个 IBM Cloud® Databases for Elasticsearch 部署。你可以通过目录、Cloud Databases CLI 插件、Cloud Databases API 或 Terraform 来配置一个。成功设置帐户后,你应该会进入 IBM Cloud 主页。

然后,你可以使用 IBM Cloud 的托管服务模型配置 Kibana 实例,并按照以下步骤连接到 Databases for Elasticsearch 实例 -

  • 为你的 Elasticsearch 部署设置管理员密码。
  • 安装 Docker 以提取 Kibana 容器映像并将其连接到 Databases for Elasticsearch。

或者,如果你不想在本地运行 Kibana 或安装 Docker,则可以使用 IBM Cloud® Code Engine 部署 Kibana。有关详细信息,请参阅有关使用 Code Engine 部署 Kibana 并将其连接到 Databases for Elasticsearch 实例的文档。

生成 API 密钥

  • 转到 IBM watsonx.ai 云并使用你的凭据登录。你将进入欢迎页面。

  • 转到 API 密钥页面。
  • 创建 API 密钥。

Elasticsearch 中的步骤

使用 Kibana 中的 DevTools,使用 watsonxai 服务为 text_embedding 创建推理端点:

PUT _inference/text_embedding/ibm_watsonx_embedding
{"service": "watsonxai","service_settings": {"api_key": "<api_key>","url": "xxx.ml.cloud.ibm.com","model_id": "ibm/slate-30m-english-rtrvr","project_id": "<project_id>","api_version": "2023-05-29"}
}

成功创建推理端点后,你将收到以下响应:

{"inference_id": "ibm_watsonx_embedding","task_type": "text_embedding","service": "watsonxai","service_settings": {"model_id": "ibm/slate-30m-english-rtrvr","project_id": "<project_id>","url": "xxx.ml.cloud.ibm.com","api_version": "2023-05-29","dimensions": 384,"similarity": "dot_product","rate_limit": {"requests_per_minute": 120}},"task_settings": {}
}

生成嵌入 - generate embeddings

下面是为单个字符串生成 text_embedding 的示例:

POST _inference/text_embedding/ibm_watsonx_embedding
{"input": "Embed this text"
}

你将收到以下嵌入响应:

{"text_embedding": [{"embedding": [0.009380317,0.05560313,...,        0.03804972]}]
}

此外,我们来看一个 semantic_text 映射示例

创建一个包含 semantic_text 字段的索引:

PUT books
{"mappings": {"properties": {"title": {"type": "text"},"semantic_text": {"type": "semantic_text","inference_id": "ibm_watsonx_embedding"},"description": {"type": "text","copy_to": ["semantic_text"]}}}
}

将一些文档插入到创建的索引中:

POST /books/_bulk
{ "index": {"_id": "1" }}
{ "title": "The Art of Coding", "description": "A comprehensive guide to coding best practices.", "price": 39.99 }
{ "index": { "_id": "2" } }
{ "title": "Mysteries of the Universe", "description": "Exploring the unknown aspects of our universe.", "price":
24.50 }
{ "index": {"_id": "3" } }
{ "title": "The Journey Within", "description": "A deep dive into personal development.", "price": 18.75 }
{ "index": {"_id": "4" } }
{ "title": "The richest man in babylon", "description": "The Richest Man in Babylon by George S. Clason is a classic book that offers timeless financial wisdom through a series of parables set in ancient Babylon, one of history’s wealthiest cities. The book conveys its lessons through stories of Babylonian citizens who learn to achieve wealth, prosperity, and happiness by following basic financial principles. The central character, Arkad, who is the richest man in Babylon, shares his wisdom on wealth-building with friends and fellow citizens. He explains how he started as a poor scribe but grew rich by adhering to a set of practical rules, which are presented as the Seven Cures for a Lean Purse and the Five Laws of Gold. The Seven Cures for a Lean Purse emphasize essential steps for accumulating wealth: saving at least ten percent of earnings, controlling expenses to live below one’s means, making wise investments, protecting investments from loss, owning a home, ensuring future income, and continually increasing the ability to earn. The Five Laws of Gold focus on key principles such as accumulating money through savings, investing wisely, seeking advice from experienced investors, avoiding investments in unfamiliar areas, and steering clear of get-rich-quick schemes. The book uses various characters like Bansir, a chariot maker, and Kobbi, a musician, to illustrate common financial challenges, and they seek Arkad’s guidance to achieve financial security, learning the importance of discipline, thrift, and prudent investment. Other stories, such as those of Dabasir, who faces challenges repaying debts, and Rodan, who learns about wise lending, further reinforce these principles. The book emphasizes that wealth is not a matter of luck or fate but a result of adhering to sound financial practices and cultivating a mindset geared towards saving, investing, and learning continuously. Through its simple yet profound lessons, the book provides readers with practical advice on personal finance, helping them understand the value of money management, disciplined saving, and wise investment strategies to build and maintain wealth over time.", "price": 18.75 }

接下来,使用 semantic_text 运行查询:

GET books/_search
{"query": {"semantic" : {"field": "semantic_text","query": "maintain wealth over time"}}
}

你将收到以下查询的响应:

{...,"hits": {"max_score": 0.86763954,"hits": [{"_index": "books","_id": "4","_score": 0.86763954,"_source": {"semantic_text": {"inference": {"inference_id": "ibm_watsonx_embedding","model_settings": {"task_type": "text_embedding","dimensions": 384,"similarity": "dot_product","element_type": "float"},"chunks": [{"text": "The Richest Man in Babylon by George S. Clason is a classic book that offers timeless financial wisdom through a series of parables set in ancient Babylon, one of history’s wealthiest cities. The book conveys its lessons through stories of Babylonian citizens who learn to achieve wealth, prosperity, and happiness by following basic financial principles. The central character, Arkad, who is the richest man in Babylon, shares his wisdom on wealth-building with friends and fellow citizens. He explains how he started as a poor scribe but grew rich by adhering to a set of practical rules, which are presented as the Seven Cures for a Lean Purse and the Five Laws of Gold. The Seven Cures for a Lean Purse emphasize essential steps for accumulating wealth: saving at least ten percent of earnings, controlling expenses to live below one’s means, making wise investments, protecting investments from loss, owning a home, ensuring future income, and continually increasing the ability to earn. The Five Laws of Gold focus on key principles such as accumulating money through savings, investing wisely, seeking advice from experienced investors, avoiding investments in unfamiliar areas, and steering clear of get-rich-quick schemes. The book uses various characters like Bansir, a chariot maker, and Kobbi, a musician, to illustrate common financial challenges, and they seek Arkad’s guidance to achieve financial security, learning the importance of discipline, thrift, and prudent investment. Other stories, such as those of Dabasir, who faces challenges repaying debts, and Rodan, who learns about","embeddings": [-0.0012952854,0.054616664,...]},{"text": " home, ensuring future income, and continually increasing the ability to earn. The Five Laws of Gold focus on key principles such as accumulating money through savings, investing wisely, seeking advice from experienced investors, avoiding investments in unfamiliar areas, and steering clear of get-rich-quick schemes. The book uses various characters like Bansir, a chariot maker, and Kobbi, a musician, to illustrate common financial challenges, and they seek Arkad’s guidance to achieve financial security, learning the importance of discipline, thrift, and prudent investment. Other stories, such as those of Dabasir, who faces challenges repaying debts, and Rodan, who learns about wise lending, further reinforce these principles. The book emphasizes that wealth is not a matter of luck or fate but a result of adhering to sound financial practices and cultivating a mindset geared towards saving, investing, and learning continuously. Through its simple yet profound lessons, the book provides readers with practical advice on personal finance, helping them understand the value of money management, disciplined saving, and wise investment strategies to build and maintain wealth over time.","embeddings": [-0.025139397,0.054932922,0.09041961,...]}]}},"price": 18.75,"description": "The Richest Man in Babylon by George S. Clason is a classic book that offers timeless financial wisdom through a series of parables set in ancient Babylon, one of history’s wealthiest cities. The book conveys its lessons through stories of Babylonian citizens who learn to achieve wealth, prosperity, and happiness by following basic financial principles. The central character, Arkad, who is the richest man in Babylon, shares his wisdom on wealth-building with friends and fellow citizens. He explains how he started as a poor scribe but grew rich by adhering to a set of practical rules, which are presented as the Seven Cures for a Lean Purse and the Five Laws of Gold. The Seven Cures for a Lean Purse emphasize essential steps for accumulating wealth: saving at least ten percent of earnings, controlling expenses to live below one’s means, making wise investments, protecting investments from loss, owning a home, ensuring future income, and continually increasing the ability to earn. The Five Laws of Gold focus on key principles such as accumulating money through savings, investing wisely, seeking advice from experienced investors, avoiding investments in unfamiliar areas, and steering clear of get-rich-quick schemes. The book uses various characters like Bansir, a chariot maker, and Kobbi, a musician, to illustrate common financial challenges, and they seek Arkad’s guidance to achieve financial security, learning the importance of discipline, thrift, and prudent investment. Other stories, such as those of Dabasir, who faces challenges repaying debts, and Rodan, who learns about wise lending, further reinforce these principles. The book emphasizes that wealth is not a matter of luck or fate but a result of adhering to sound financial practices and cultivating a mindset geared towards saving, investing, and learning continuously. Through its simple yet profound lessons, the book provides readers with practical advice on personal finance, helping them understand the value of money management, disciplined saving, and wise investment strategies to build and maintain wealth over time.","title": "The richest man in babylon"}},...]}
}

结论

通过集成 IBM watsonx™ 文本嵌入,Elasticsearch Open Inference API 继续为开发人员提供增强的功能,以构建强大而灵活的 AI 驱动搜索体验。探索 watsonx.ai 提供的更多受支持的编码器基础模型。

Elasticsearch 与行业领先的 Gen AI 工具和提供商进行了原生集成。查看我们的网络研讨会,了解如何超越 RAG 基础知识,或构建可用于生产环境的应用程序 Elastic Vector Database。

要为你的用例构建最佳搜索解决方案,请立即开始免费云试用或在你的本地机器上试用 Elastic。

原文:Elasticsearch open inference API adds support for IBM watsonx.ai Slate embedding models - Search Labs

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.rhkb.cn/news/476556.html

如若内容造成侵权/违法违规/事实不符,请联系长河编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

【前端】深入理解 JavaScript 逻辑运算符的优先级与短路求值机制

博客主页&#xff1a; [小ᶻZ࿆] 本文专栏: 前端 文章目录 &#x1f4af;前言&#x1f4af;案例背景&#x1f4af;逻辑运算符的优先级与短路求值运算符优先级的概念短路求值的概念 &#x1f4af;分析案例代码的执行过程第一步&#xff1a;执行 && 运算第二步&#…

2024年11月21日Github流行趋势

项目名称&#xff1a;twenty 项目维护者&#xff1a;charlesBochet, lucasbordeau, Weiko, FelixMalfait, bosiraphael项目介绍&#xff1a;正在构建一个由社区支持的现代化Salesforce替代品。项目star数&#xff1a;21,798项目fork数&#xff1a;2,347 项目名称&#xff1a;p…

【算法】计算程序执行时间(C/C++)

引言 我们在写算法时要考虑到算法的执行效率&#xff0c;有的题目规定了时间限制&#xff0c;我们需要在这个时间之内去解决问题。如果我们需要比对算法的好坏&#xff0c;就需要输出这个程序运行了多长时间。 在C或C中计算程序执行时间&#xff0c;可以使用多种方法&#xf…

【题解】—— LeetCode一周小结46

&#x1f31f;欢迎来到 我的博客 —— 探索技术的无限可能&#xff01; &#x1f31f;博客的简介&#xff08;文章目录&#xff09; 【题解】—— 每日一道题目栏 上接&#xff1a;【题解】—— LeetCode一周小结45 11.切棍子的最小成本 题目链接&#xff1a;1547. 切棍子的最…

PH热榜 | 2024-11-22

DevNow 是一个精简的开源技术博客项目模版&#xff0c;支持 Vercel 一键部署&#xff0c;支持评论、搜索等功能&#xff0c;欢迎大家体验。 在线预览 1. Lovable 标语&#xff1a;全球首位全栈人工智能工程师 介绍&#xff1a;GPT工程师已在140多个国家拥有超过5万用户&#…

时序论文23|ICML24谷歌开源零样本时序大模型TimesFM

论文标题&#xff1a;A DECODER - ONLY FOUNDATION MODEL FOR TIME - SERIES FORECASTING 论文链接&#xff1a;https://arxiv.org/abs/2310.10688 论文链接&#xff1a;https://github.com/google-research/timesfm 前言 谷歌这篇时间序列大模型很早之前就在关注&#xff…

【UCIE协议系列-1】

UCIE协议系列-1 1 UCIE背景1.1 UCIE产生背景1.2 UCIE主要特性 2 UCIE分层协议2.1 Protocol 层2.1.1 Mode VS protocal2.1.2 PCIe 6.02.1.2.1 Raw Mode for PCIe 6.02.1.2.2 Flit Mode: Standard 256B Flit for PCIe 6.0 2.1.3 CXL3.0 256B Flit Mode2.1.3.1 Raw Mode for CXL 2…

智能安全配电装置在高校实验室中的应用

​ 摘要&#xff1a;高校实验室是科研人员进行科学研究和实验的场所&#xff0c;通常会涉及到大量的仪器设备和电气设备。电气设备的使用不当或者维护不周可能会引发火灾事故。本文将以一起实验室电气火灾事故为例&#xff0c;对事故原因、危害程度以及防范措施进行分析和总结…

ESP8266 STA模式TCP客户端 电脑手机网络调试助手

1.STA模式TCP客户端和电脑网络调试助手 2.STA模式TCP客户端和手机网络调试助手

高中-信息技术科目考试-编程题

&#xff08;24上&#xff09;1.为了响应国家低碳的倡议&#xff0c;学校请你设计一个饮料瓶回收系统&#xff0c;根据投的饮料瓶类型和数量进行奖励。具体如下图&#xff1a;假设学生投瓶10个&#xff0c;投瓶类型定义为t&#xff08;0表示塑料瓶&#xff0c;1表示易拉罐&…

如何将文件Copy到Docker镜像中

如何将文件Copy到Docker镜像中 一、使用Dockerfile的COPY指令二、使用Docker CP命令三、使用Docker Volume四、综合应用Docker作为一种轻量级的容器化技术,在软件开发和部署中得到了广泛应用。在使用Docker时,经常需要将本地文件或目录复制到Docker镜像中,以便在容器内部使用…

Figma入门-文字、样式、链接、动作

Figma入门-文字、样式、链接、动作 前言 在之前的工作中&#xff0c;大家的原型图都是使用 Axure 制作的&#xff0c;印象中 Figma 一直是个专业设计软件。 最近&#xff0c;很多产品朋友告诉我&#xff0c;很多原型图都开始用Figma制作了&#xff0c;并且很多组件都是内置的…

shell编程(8) until循环以及函数基本创建调用

声明!!! 学习视频来自B站UP主泷羽sec&#xff0c;如涉及侵权马上删除文章 视频链接&#xff1a;泷羽sec 笔记的只是方便各位师傅学习知识,以下网站只涉及学习内容,其他的都与本人无关,切莫逾越法律红线,否则后果自负 # until循环 脚本代码&#xff1a; i0 until [ ! $i -lt 1…

NVR管理平台EasyNVR多品牌NVR管理工具的流媒体视频融合与汇聚管理方案

随着信息技术的飞速发展&#xff0c;视频监控已经成为现代社会安全管理和业务运营不可或缺的一部分。无论是智慧城市、智能交通、还是大型企业、校园安防&#xff0c;视频监控系统的应用都日益广泛。NVR管理平台EasyNVR&#xff0c;作为功能强大的流媒体服务器软件&#xff0c;…

fastadmin实现站内通知功能

实现效果如下 application/admin/view/common/header.html <style>#notificationMenu {display: none;position: absolute;top: 40px;right: 0;background: #fff;border-radius: 6px;padding: 10px 0;width: 300px;box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);z-inde…

大语言模型---LoRA中损失值的计算

文章目录 概要损失计算流程小结 概要 Llama-7B模型的LoRA微调训练中&#xff0c;通过使用Cross-Entropy Loss来度量模型输出的预测分布和真实标签分布之间的距离&#xff0c;来衡量模型的准确性。 本文主要介绍LoRA中损失值的计算流程。 Cross-Entropy Loss作用&#xff1a;是…

【Vue】指令扩充(指令修饰符、样式绑定)

目录 指令修饰符 按键修饰符 事件修饰符 双向绑定指令修饰符 输入框 表单域 下拉框 单选按钮 复选框 样式绑定 分类 绑定class 绑定style tab页切换示例 指令修饰符 作用 借助指令修饰符&#xff0c;可以让指令的功能更强大 分类 按键修饰符&#xff1a;用来…

集成金蝶云星空数据至MySQL的完整案例解析

金蝶云星空数据集成到MySQL的技术案例分享 在企业信息化系统中&#xff0c;数据的高效流动和准确同步是确保业务连续性和决策支持的重要环节。本文将聚焦于一个具体的系统对接集成案例——金蝶云星空的数据集成到MySQL&#xff0c;方案名称为“2金蝶物料同步到商城中间表”。 …

为什么transformer的时间复杂度是N的平方,具体是里面的哪一个计算流程最占用时间

Transformer的时间复杂度为 O(N2)&#xff0c;其中 NN 是输入序列的长度。这一复杂度主要来源于自注意力机制&#xff08;self-attention mechanism&#xff09;的计算过程。 在Transformer模型中&#xff0c;自注意力机制的核心步骤是计算查询&#xff08;Query&#xff09;、…

如何在Linux上安装Canal同步工具

1. 下载安装包 所用到的安装包 canal.admin-1.1.4.tar.gz 链接&#xff1a;https://pan.baidu.com/s/1B1LxZUZsKVaHvoSx6VV3sA 提取码&#xff1a;v7ta canal.deployer-1.1.4.tar.gz 链接&#xff1a;https://pan.baidu.com/s/13RSqPinzgaaYQUyo9D8ZCQ 提取码&#xff1a;…