在 Elasticsearch 中使用 Amazon Nova 模型
作者:来自 Elastic Andre Luiz

了解如何在 Elasticsearch 中使用 Amazon Nova 系列模型。
在本文中,我们将讨论 Amazon 的 AI 模型家族——Amazon Nova,并学习如何将其与 Elasticsearch 结合使用。
关于 Amazon Nova
Amazon Nova 是 Amazon 的一系列人工智能模型,可在 Amazon Bedrock 上使用,旨在提供高性能和成本效益。这些模型支持文本、图像和视频输入,生成文本输出,并针对不同的准确性、速度和成本需求进行了优化。
Amazon Nova 主要模型
-
Amazon Nova Micro:专注于文本处理的快速、经济高效模型,适用于翻译、推理、代码补全和数学问题求解。其生成速度超过 200 个 token 每秒,非常适合需要即时响应的应用。
-
Amazon Nova Lite:一种低成本的多模态模型,可快速处理图像、视频和文本。其速度和准确性表现突出,适用于交互式和高数据量的应用,尤其是成本敏感的场景。
-
Amazon Nova Pro:最高级的选择,结合了高准确性、速度和成本效益。适用于视频摘要、问答、软件开发和 AI 代理等复杂任务。专家评测表明,它在文本和视觉理解方面表现卓越,并且能够遵循指令执行自动化工作流。
Amazon Nova 模型适用于多种应用场景,包括内容创作、数据分析、软件开发以及基于 AI 的流程自动化。
我们将展示如何将 Amazon Nova 模型与 Elasticsearch 结合使用,以实现自动化的产品评论分析。
我们将进行以下步骤:
-
通过 Inference API 创建一个端点,将 Amazon Bedrock 与 Elasticsearch 集成。
-
使用 Inference Processor 创建一个数据处理管道,该管道将调用 Inference API 端点。
-
索引产品评论,并使用管道自动生成评论分析。
-
分析集成后的结果。
在 Inference API 中创建端点
首先,我们配置 Inference API 以将 Amazon Bedrock 与 Elasticsearch 集成。我们选择 Amazon Nova Lite 作为使用的模型,其 ID 为 amazon.nova-lite-v1:0,因为它在速度、准确性和成本之间提供了良好的平衡。
注意:你需要有效的凭据才能使用 Amazon Bedrock。你可以在此处查看文档以获取访问密钥:
PUT _inference/completion/bedrock_completion_amazon_nova-lite
{"service": "amazonbedrock","service_settings": {"access_key": "#access_key#","secret_key": "#secret_key#","region": "us-east-1","provider": "amazontitan","model": "amazon.nova-lite-v1:0"}
}
创建评论分析 pipeline
现在,我们创建一个处理流水线,该流水线将使用 Inference Processor 来执行评论分析提示(prompt)。该提示会将评论数据发送到 Amazon Nova Lite,并执行以下操作:
-
情感分类(正面、负面或中立)
-
评论摘要生成
-
关键词提取
-
真实性评估(真实 | 可疑 | 泛化)
PUT /_ingest/pipeline/review_analyzer_ai
{"processors": [{"script": {"source": """ctx.prompt = "Analyze the following product review and return a structured JSON. Task: - Summarize the review concisely. - Detect and classify the sentiment as positive, neutral, or negative.- Generate relevant tags (keywords) based on the review content and detected sentiment. - Evaluate the authenticity of the review (authentic, suspicious, or generic). Review: " + ctx.review + " Respond in JSON format with the following fields: \"review_analyze\": {\"sentiment\": \"<positive | neutral | negative>\", \"authenticity\": \"<authentic | suspicious | generic>\",\"summary\": \"<short review summary>\", \"keywords\": [\"<keyword 1>\", \"<keyword 2>\", \"...\"]}}}""""}},{"inference": {"model_id": "bedrock_completion_amazon_nova-lite","input_output": {"input_field": "prompt","output_field": "result"}}},{"gsub": {"field": "result","pattern": "```json","replacement": ""} },{"json" : {"field" : "result","strict_json_parsing": false,"add_to_root" : true}},{"remove": {"field": "result"}},{"remove": {"field": "prompt"}}]
}
索引评论
现在,我们使用 Bulk API 索引产品评论。之前创建的流水线将自动应用,并将 Nova 模型生成的分析结果添加到索引的文档中。
POST bulk/
{ "index": { "_index" : "products", "_id": 1, "pipeline":"review_analyzer_ai" } }
{ "product": "Pampers Pants Premium Care Fralda", "review": "Best diaper ever! Great material, lots of cotton, without all that plastic. Doesn't leak! My baby is a boy and every diaper leaked around the waist, this model solved the problem. Even on a small baby it's worth the effort of putting on the short diaper. I put it on my baby at 9 pm and only take it off in the morning, without any leaks." }
{ "index": { "_index" : "products", "_id": 2, "pipeline":"review_analyzer_ai" } }
{ "product": "Portable Electric Body Massager", "review": "It broke in three months for no apparent reason, thank goodness I didn't review it before. I don't recommend buying it because it has a short lifespan." }
{ "index": { "_index" : "products", "_id": 3, "pipeline":"review_analyzer_ai" } }
{ "product": "Havit Fuxi-H3 Black Quad-Mode Wired and Wireless Gaming Headset", "review": "The sound is good for the price, but the connectivity is horrible. You always need to be playing audio, otherwise it loses connection (I work from home, and this is very annoying). Sometimes it loses connection and you have to turn it off and on again to get it back on. The microphone is very sensitive, so it loses connection frequently and you have to turn the headset off and on for the microphone to work again. The flexibility of the stem is useless, because if you move it, the microphone can turn off. Sometimes I need to use Linux and the headset simply doesn't work. It's light and comfortable, the sound is adequate, but the connectivity is terrible." }
{ "index": { "_index" : "products", "_id": 4, "pipeline":"review_analyzer_ai" } }
{ "product": "Air Fryer 4L Oil Free Fryer Mondial", "review": "For those looking for value for money, it's a good option, but the tray (which is underneath the perforated basket) is already peeling a lot. My mother has one just like it and said that hers is even rusting, in other words, the material is MUCH inferior. There's also something that bothers me, because it looks like a microwave, it doesn't fry evenly, it's weaker in the middle and stronger on the sides. Buy at your own risk." }
查询和分析结果
最后,我们运行查询以查看 Amazon Nova Lite 模型如何分析和分类评论。通过执行 GET products/_search,我们可以获取已经被评论内容增强的文档。
该模型能够识别主要情感(正面、中立或负面),生成简要摘要,提取相关关键词,并评估每条评论的 真实性。这些字段有助于理解客户的意见,而无需阅读完整文本。
在解释结果时,我们关注以下方面:
-
情感:指示消费者对产品的整体感受。
-
摘要:提炼评论中提及的主要观点。
-
关键词:可用于分组相似评论或识别反馈模式。
-
真实性:判断评论是否可信,对内容审核或筛选有帮助。
"hits": [{"_index": "products","_id": "1","_score": 1,"_ignored": ["review.keyword"],"_source": {"product": "Pampers Pants Premium Care Fralda","model_id": "bedrock_completion_amazon_nova-lite","review_analyze": {"summary": "The reviewer praises the diaper for its great material, high cotton content, and leak-proof design, especially highlighting its effectiveness for their baby.","sentiment": "positive","keywords": ["best diaper","great material","cotton","no plastic","leak-proof","baby","effective"],"authenticity": "authentic"},"review": "Best diaper ever! Great material, lots of cotton, without all that plastic. Doesn't leak! My baby is a boy and every diaper leaked around the waist, this model solved the problem. Even on a small baby it's worth the effort of putting on the short diaper. I put it on my baby at 9 pm and only take it off in the morning, without any leaks."}},{"_index": "products","_id": "2","_score": 1,"_source": {"product": "Portable Electric Body Massager","model_id": "bedrock_completion_amazon_nova-lite","review_analyze": {"summary": "The product broke in three months for no apparent reason and the reviewer does not recommend it due to its short lifespan.","sentiment": "negative","keywords": ["broke","short lifespan","not recommend"],"authenticity": "authentic"},"review": "It broke in three months for no apparent reason, thank goodness I didn't review it before. I don't recommend buying it because it has a short lifespan."}},{"_index": "products","_id": "3","_score": 1,"_ignored": ["review.keyword"],"_source": {"product": "Havit Fuxi-H3 Black Quad-Mode Wired and Wireless Gaming Headset","model_id": "bedrock_completion_amazon_nova-lite","review_analyze": {"summary": "The headset has good sound quality for the price but suffers from poor connectivity, especially when using the microphone or moving the headset. It also has compatibility issues with Linux.","sentiment": "negative","keywords": ["sound","connectivity","microphone","compatibility","annoying","turn off and on","Linux","flexible stem","work from home"],"authenticity": "authentic"},"review": "The sound is good for the price, but the connectivity is horrible. You always need to be playing audio, otherwise it loses connection (I work from home, and this is very annoying). Sometimes it loses connection and you have to turn it off and on again to get it back on. The microphone is very sensitive, so it loses connection frequently and you have to turn the headset off and on for the microphone to work again. The flexibility of the stem is useless, because if you move it, the microphone can turn off. Sometimes I need to use Linux and the headset simply doesn't work. It's light and comfortable, the sound is adequate, but the connectivity is terrible."}},{"_index": "products","_id": "4","_score": 1,"_ignored": ["review.keyword"],"_source": {"product": "Air Fryer 4L Oil Free Fryer Mondial","model_id": "bedrock_completion_amazon_nova-lite","review_analyze": {"summary": "The product offers value for money but has issues with peeling, rusting, and uneven frying.","sentiment": "negative","keywords": ["value for money","peeling","rusting","uneven frying","weaker in the middle"],"authenticity": "authentic"},"review": "For those looking for value for money, it's a good option, but the tray (which is underneath the perforated basket) is already peeling a lot. My mother has one just like it and said that hers is even rusting, in other words, the material is MUCH inferior. There's also something that bothers me, because it looks like a microwave, it doesn't fry evenly, it's weaker in the middle and stronger on the sides. Buy at your own risk."}}]
最终想法
Amazon Nova Lite 与 Elasticsearch 的集成展示了语言模型如何将原始评论转化为结构化且有价值的信息。通过流水线处理评论,我们能够自动且一致地提取 情感、真实性、摘要 和 关键词。
结果表明,该模型能够理解评论的上下文、分类用户的意见,并突出显示每个体验中最相关的点。这使数据集更加丰富,可用于提升搜索能力。
想要获得 Elastic 认证?查看下一次 Elasticsearch Engineer 培训时间!
Elasticsearch 拥有众多新功能,可帮助你构建最佳搜索解决方案。探索我们的示例 notebooks 了解更多信息,开启 免费云试用,或立即在本地机器尝试 Elastic!
原文:https://www.elastic.co/search-labs/blog/amazon-nova-models-elasticsearch
相关文章:
在 Elasticsearch 中使用 Amazon Nova 模型
作者:来自 Elastic Andre Luiz 了解如何在 Elasticsearch 中使用 Amazon Nova 系列模型。 在本文中,我们将讨论 Amazon 的 AI 模型家族——Amazon Nova,并学习如何将其与 Elasticsearch 结合使用。 关于 Amazon Nova Amazon Nova 是 Amazon …...
Linux中用gdb查看coredump文件
查看dump的命令: gdb 可执行文件 dump文件路径查看函数调用栈 (gdb)bt查看反汇编代码 (gdb)disassemble查看寄存器的值 (gdb)info all-registers如果通过上述简单命令无法排查,还是通过-g参数编译带符号表的可执行文件,再用gdb查看...
sql server数据库可疑修复
sql server数据库可疑修复 从上图可以看到数据库nchrdb显示可疑,导致原因为NC系统在增加公共薪资项目的时候,扩展字段报错了,第一次遇到这种情况,折腾了很久终于解决,记下解决方案: 1,将SQL数据…...
【项目管理-高项】学习方法 整体概览
相关文档,希望互相学习,共同进步 风123456789~-CSDN博客 1.背景 📝 软考高项,全称 信息系统项目管理师 ,是软考高级资格项目之一。 本考试考三门科目:综合知识(上午)、案例分析(下午…...
华为高斯(GaussDB)数据库中 Range、List、Hash三种分区方式 的完整SQL示例及增删改查操作,并附上总结对比表格
以下是GaussDB中 Range、List、Hash三种分区方式 的完整SQL示例及增删改查操作,并附上总结对比表格: 1. Range分区(按范围分区) 场景:按订单日期范围分区(如按季度)。 创建表 -- 创建按日期范…...
Go语言从零构建SQL数据库(4)-解析器
SQL解析器:数据库的"翻译官"图解与代码详解 图解SQL解析过程 SQL解析器就像是人类语言与计算机之间的翻译官,将我们书写的SQL语句转换成数据库能够理解和执行的结构。 #mermaid-svg-f9gAqHutDLL4McGy {font-family:"trebuchet ms"…...
【Linux网络与网络编程】05.应用层自定义协议序列化和反序列化
前言 本篇博客通过网络计算器的实现来帮助各位理解应用层自定义协议以及序列化和反序列化。 一、认识自定义协议&&序列化和反序列化 我们程序员写的一个个解决我们实际问题,满足我们日常需求的网络程序都是在应用层。前面我们说到:协议是一种…...
Android Gradle、Android Gradle Plugin、BuildTool关系
1. Gradle 的定位:通用构建工具 Gradle 是一个通用的跨平台构建工具,支持多种语言(如 Java、Kotlin、C)和项目类型 它的核心功能包括: 任务自动化:通过 Groovy/Kotlin DSL 脚本定义编译、测试、打包等…...
Java的Selenium的特殊元素操作与定位之时间日期控件
分为两种情况: 控件没有限制手动输入,则直接调用sendKeys方法写入时间数据 //时间日期控件处理 chromeDriver.get ("https://www,fliggy,com/?ttidsem.000000736&hlreferidbaidu.082076&route sourceseo"); chromeDriver.findElement (By.xpat…...
Flutter之页面布局二
目录: 1、列表布局1.1、基础列表1.2、水平滑动的列表1.3、网格列表1.3、不同列表项的列表1.4、包含间隔的列表1.6、长列表 2、滚动2.1、浮动的顶栏2.2、平衡错位滚动 1、列表布局 1.1、基础列表 import package:flutter/material.dart;void main() > runApp(con…...
RCE漏洞的小点总结
RCE简介与危害:包括远程代码执行和远程命令执行漏洞。 在很多web应用中,开发人员会使用一些函数,这些函数以一些字符串作为输入,功能是将输入的字符串当作代码或者命令来进行执行。当用户可以控制这些函数的输入时,就…...
设计模式简述(十)责任链模式
责任链模式 描述基本使用使用 描述 如果一个请求要经过多个类似或相关处理器的处理。 可以考虑将这些处理器添加到一个链上,让请求逐个经过这些处理器进行处理。 通常,在一个业务场景下会对整个责任链进行初始化,确定这个链上有哪些Handler…...
主相机绑定小地图
资源初始化:在类中通过 property 装饰器定义主相机、小地图相机、小地图精灵等资源属性,便于在编辑器中赋值。在 start 方法里,当确认这些资源存在后,创建渲染纹理并设置其大小,将渲染纹理与小地图相机关联,…...
单片机实现多线程的方法汇总
在单片机上实现“多线程”的方法有几种,下面按照从简单到复杂、从轻量到系统性来列出常见的方案: 🧵 一、伪多线程(最轻量) 方法:主循环 状态机 / 定时器轮询 主循环中轮流调用各个任务的处理函数&#x…...
Java八股文-List集合
集合的底层是否加锁也就代表是否线程安全 (一)List集合 一、数组 array[1]是如何通过索引找到堆内存中对应的这块数据的呢? (1)数组如何获取其他元素的地址值 (2)为什么数组的索引是从0开始的,不可以从1开始吗 (3)操作数组的时间复杂度 ①查找 根据索引查询 未…...
快手Python开发面经及参考答案
目录 Python 的深浅拷贝有什么区别?请举例说明。 Python 函数声明中有三种类型的参数,分别说明它们的区别。 Python 中的迭代器是怎么使用的? Python2 和 Python3 之间的区别有哪些(例如 range 和 xrange 等方面)? Python 的线程同步问题是怎样的?详细讲解 GIL 的原…...
谈谈策略模式,策略模式的适用场景是什么?
一、什么是策略模式? 策略模式(Strategy Pattern)属于行为型设计模式。核心思路是将一组可替换的算法封装在独立的类中,使它们可以在运行时动态切换,同时使客户端代码与具体算法解耦。它包含三个…...
从零构建大语言模型全栈开发指南:第四部分:工程实践与部署-4.2.3行业案例:智能客服中的图文交互系统
👉 点击关注不迷路 👉 点击关注不迷路 👉 点击关注不迷路 文章大纲 从零构建大语言模型全栈开发指南-第四部分:工程实践与部署4.2.3 行业案例:智能客服中的图文交互系统1. 图文交互系统的核心挑战与价值2. 系统架构设计2.1 分层架构2.2 Adapter技术应用3. 行业应用案例…...
华为IP(4)
VRRP(虚拟路由冗余协议) 前言: 局域网中的用户终端通常采用配置一个默认网关的形式访问外部网络,如果默认网关设备发生故障,那么所有用户终端访问外部网络的流量将会中断。可以通过部署多个网关的方式来解决单点故障…...
计算机网络中科大 - 第1章 结构化笔记(详细解析)
博主主页 目录 **1. 计算机网络概述****1.1 计算机网络的定义****1.2 计算机网络的发展** **2. 计算机网络的组成与分类****2.1 计算机网络的组成****2.2 计算机网络的分类****按地理范围****按拓扑结构****按交换方式** **3. 计算机网络的性能指标****4. 计算机网络体系结构**…...
【神经网络】python实现神经网络(三)——正向学习的模拟演练
有了之前的经验(【神经网络】python实现神经网络(二)——正向推理的模拟演练),我们继续来介绍如何正向训练神经网络中的超参(包含权重以及偏置),本章大致的流程图如下: 一.损失函数 神经网络以某个指标为基准寻求最优权重参数,而这个指标即可称之为 “损失函数” 。(…...
PPTAgent:一款开源免费生成和评估幻灯片的项目
这篇文章介绍一下PPTAgent,一个从文档自动生成演示文稿的创新系统。该系统从人类的展示创作方法中汲取灵感,采用两步流程来确保卓越的整体质量。此外,本文还介绍了PPTEval,这是一个综合评估框架,可以跨多个维度评估演示…...
配置管理:夯实软件开发与运维根基
配置管理是对系统配置信息进行管理的活动,以下从定义、目的、主要活动、实施流程等方面为你详细介绍: 一、定义 配置管理是通过技术或行政手段对软件产品及其开发过程和生命周期进行控制、规范的一系列措施。配置管理的目标是记录软件产品的演化过程&a…...
Java 大视界 -- Java 大数据在智能供应链库存优化与成本控制中的应用策略(172)
💖亲爱的朋友们,热烈欢迎来到 青云交的博客!能与诸位在此相逢,我倍感荣幸。在这飞速更迭的时代,我们都渴望一方心灵净土,而 我的博客 正是这样温暖的所在。这里为你呈上趣味与实用兼具的知识,也…...
Cocos Creator 进行 Web 发布后,目录结构解析
在使用 Cocos Creator 进行 Web 发布后,生成的目录结构通常包含以下内容,下面为你详细介绍: 1. index.html 这是 Web 项目的入口 HTML 文件,它会加载所需的 JavaScript 文件和资源,从而启动游戏或应用程序。示例代码…...
解决Spring Boot Test中的ByteBuddy类缺失问题
目录 解决Spring Boot Test中的ByteBuddy类缺失问题前奏问题描述问题解决第一步:移除ByteBuddy的特定版本号第二步:更新maven-surefire-plugin配置第三步:清理并重新构建项目 结语 解决Spring Boot Test中的ByteBuddy类缺失问题 前奏 今天&…...
Postman参数化设置如何设置?
在 Postman 里,参数化设置能让你用不同的数据多次运行同一个请求,这对测试不同输入时的 API 响应非常有用。下面为你详细介绍 Postman 参数化设置的方法。 1. 准备数据文件 Postman 支持 CSV 和 JSON 格式的数据文件。 CSV 文件 CSV 文件由逗号分隔的…...
斯坦福大学李飞飞团队新突破!FlowMo 革新图像 Tokenizer
当我们悠然刷着手机,看到一张可爱猫咪的照片时,大脑会瞬间识别出「这是一只猫」,这一切不过是电光火石间的事儿。但在计算机的 “眼中”,情况却复杂得超乎想象。假设这是一张10001000像素的彩色照片,在计算机的世界里&…...
基于 Jackson 的 JSON 工具类实现解析与设计模式应用
一、项目背景与功能概览 在企业级开发中,JSON 序列化/反序列化是高频操作。本方案基于 Jackson 实现了一个双模式兼容(独立使用 Spring 整合)、安全可靠的 JSON 工具类,主要提供以下能力: ✅ 常用 JSON 转换方法✅ …...
87.在线程中优雅处理TryCatch返回 C#例子 WPF例子
在C#异步编程中,正确处理异常是确保程序稳定运行的关键。今天,我们通过一个实际的示例,展示如何在异步线程中使用try-catch块处理异常,并通过标志变量控制流程。同时,我们也会展示一个错误的示例,以便更好地…...
