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.mzph.cn/bicheng/61708.shtml

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

相关文章

flume-将日志采集到hdfs

看到hdfs大家应该做什么&#xff1f; 是的你应该去把集群打开&#xff0c; cd /export/servers/hadoop/sbin 启动集群 ./start-all.sh 在虚拟机hadoop02和hadoop03上的conf目录下配置相同的日志采集方案&#xff0c;‘ cd /export/servers/flume/conf 切换完成之后&#…

已解决wordpress提示正在执行例行维护,请一分钟后回来

今天打开网站时提示“正在执行例行维护,请一分钟后回来”&#xff0c;一分钟后还这样&#xff0c;刷新也没用&#xff0c;这究竟是怎么回事了&#xff1f; 问题原因 这是WordPress在更新&#xff0c;wordpress在升级程序、主题、插件时&#xff0c;都会先切换到维护模式&…

[C++]:IO流

1. IO 流 1.1 流的概念 在C中&#xff0c;存在一种被称为“流”的概念&#xff0c;它描述的是信息流动的过程&#xff0c;具体来说就是信息从外部输入设备&#xff08;比如常见的键盘&#xff09;传输到计算机内部&#xff08;像内存区域&#xff09;&#xff0c;以及信息从内…

趋势洞察|AI 能否带动裸金属 K8s 强势崛起?

随着容器技术的不断成熟&#xff0c;不少企业在开展私有化容器平台建设时&#xff0c;首要考虑的问题就是容器的部署环境——是采用虚拟机还是物理机运行容器&#xff1f;在往期“虚拟化 vs. 裸金属*”系列文章中&#xff0c;我们分别对比了容器部署在虚拟化平台和物理机上的架…

多摩川编码器协议及单片机使用

参考&#xff1a; https://blog.csdn.net/qq_28149763/article/details/132718177 https://mp.weixin.qq.com/s/H4XoR1LZSMH6AxsjZuOw6g 1、多摩川编码器协议 多摩川数据通讯是基于485 硬件接口标准NRZ 协议&#xff0c;通讯波特率为2.5Mbps 的串行通讯&#xff0c;采用差分两…

力扣刷题--21.合并两个有序链表

I am the best &#xff01;&#xff01;&#xff01; 题目描述 将两个升序链表合并为一个新的 升序 链表并返回。新链表是通过拼接给定的两个链表的所有节点组成的。 示例 1&#xff1a; 输入&#xff1a;l1 [1,2,4], l2 [1,3,4] 输出&#xff1a;[1,1,2,3,4,4] 示例 2…

Altium Designer学习笔记 6-10 异性元件库创建_原理图绘制

基于Altium Designer 23学习版&#xff0c;四层板智能小车PCB 更多AD学习笔记&#xff1a;Altium Designer学习笔记 1-5 工程创建_元件库创建 目录 6、光耦及二极管元件库模型创建 7、元件库模型的调用 二、原理图绘制及编译检查 8、元件的放置 9、器件的复制及对齐 10、…

视频流媒体播放器EasyPlayer.js H.265流媒体播放器当container窗口发生变化的时候,播放器如何自适应

流媒体播放器的核心技术及发展趋势展现了其在未来数字生活中的无限潜力。现今流媒体播放器将继续引领数字娱乐的新潮流&#xff0c;为用户提供更加丰富多样的内容体验。 流媒体播放器负责解码和呈现内容&#xff0c;常见的播放器包括VLC和HTML5播放器等。流媒体技术的应用场景广…

Windows系统使用全功能的跨平台开源音乐服务器Navidrome搭建在线音乐库

文章目录 前言1. 安装Docker2. Docker镜像源添加方法3. 创建并启动Navidrome容器4. 公网远程访问本地Navidrome4.1 内网穿透工具安装4.2 创建远程连接公网地址4.3 使用固定公网地址远程访问 前言 在数字时代&#xff0c;拥有一个个性化、便捷的音乐库成为了许多人的需求。本文…

在Excel中处理不规范的日期格式数据并判断格式是否正确

有一个Excel表&#xff0c;录入的日期格式很混乱&#xff0c;有些看着差不多&#xff0c;但实际多一个空格少一个字符很难发现&#xff0c;希望的理想格式是 1980-01-01&#xff0c;10位&#xff0c;即&#xff1a;“YYYY-mm-dd”&#xff0c;实际上数据表中这样的格式都有 19…

二进制 分析工具:Radare2、r2frida、Binutils、file、string、as、nm、ldd、objdump、readelf、strip

1、二进制 分析工具 工欲善其事&#xff0c;必先利其器&#xff0c;在二进制安全的学习中&#xff0c;​使用工具尤为重要。遇到一个不熟悉的文件时&#xff0c; 首先要确定 "这是什么类型的文件"&#xff0c;回答这个问题的首要原则是&#xff0c;绝不要根据文件的扩…

大数运算(加减乘除和输入、输出模块)

为什么会有大数呢&#xff1f;因为long long通常为64位范围约为 -9,223,372,036,854,775,808 到 9,223,372,036,854,775,807&#xff0c;最多也就19位&#xff0c;那么超过19位的如何计算呢&#xff1f;这就引申出来大数了。 本博客适合思考过这道题&#xff0c;但是没做出来或…

Kafka-副本分配策略

一、上下文 《Kafka-创建topic源码》我们大致分析了topic创建的流程&#xff0c;为了保持它的完整性和清晰度。细节并没有展开分析。下面我们就来分析下副本的分配策略以及副本中的leader角色的确定逻辑。当有了副本分配策略&#xff0c;才会得到分区对应的broker&#xff0c;…

Move语言中的代币合约:设计和实现指南

系列文章目录 Task1&#xff1a;hello move&#x1f6aa; Task2&#xff1a;move coin&#x1f6aa; Task3&#xff1a;move nft&#x1f6aa; 更多精彩内容&#xff0c;敬请期待&#xff01;✌️ 文章目录 系列文章目录前言什么是 Sui 链&#xff1f;什么是 Move 编程语言&a…

精酿啤酒厂建设攻略——关键步骤与注意点

建设一家精酿啤酒厂&#xff0c;每一步都至关重要。在这里&#xff0c;小编将为您精心梳理建设精酿啤酒厂的详细步骤和关键注意点&#xff0c;助您在啤酒市场的蓝海中乘风破浪。从投资预算的精确规划&#xff0c;到市场渠道的精心布局&#xff0c;从产品特色的精准定位&#xf…

什么是UGFC?模块电脑(核心板)规范标准简介四

1. 概念 UGFC是Unified Gold Finger Core Board的缩写&#xff08;意指&#xff1a;统一接口定义金手指核心板&#xff09;&#xff0c;为武汉万象奥科电子有限公司基于企业标准定义的一种针对嵌入式、低功耗、通用型的小型计算机模块标准&#xff0c;采用204Pin金手指连接器…

数据科学与SQL:组距分组分析 | 区间分布问题

目录 0 问题描述 1 数据准备 2 问题分析 3 小结 0 问题描述 绝对值分布分析也可以理解为组距分组分析。对于某个指标而言&#xff0c;一个记录对应的指标值的绝对值&#xff0c;肯定落在所有指标值的绝对值的最小值和最大值构成的区间内&#xff0c;根据一定的算法&#x…

量子感知机

神经网络类似于人类大脑&#xff0c;是模拟生物神经网络进行信息处理的一种数学模型。它能解决分类、回归等问题&#xff0c;是机器学习的重要组成部分。量子神经网络是将量子理论与神经网络相结合而产生的一种新型计算模式。1995年美国路易斯安那州立大学KAK教授首次提出了量子…

大语言模型---ReLU函数的计算过程及其函数介绍

文章目录 1. 概要2. ReLU定义 1. 概要 **ReLU 作用&#xff1a;**主要用于为神经网络引入非线性能力&#xff0c;作用是将输入中的整数保留原值&#xff0c;负数置为 0。 从而在层与层之间引入非线性&#xff0c;使神经网络能够拟合复杂的非线性关系。 **ReLU使用场景&#xf…

SPSS统计学:连续均匀分布

概念 连续均匀分布是指在某个连续区间上&#xff0c;随机变量取值的概率密度函数是常数的分布。假设连续均匀分布的区间为[a,b]&#xff0c;其中a是区间的下界&#xff0c;b是区间的上界。 方差的推导 连续均匀分布的方差计算中出现数字12&#xff0c;是因为在推导过程中&…