欢迎来到尧图网

客户服务 关于我们

您的位置:首页 > 健康 > 美食 > 相得益彰 — 基于 GraphRAG 事理图谱驱动的实时金融行情新闻资讯洞察

相得益彰 — 基于 GraphRAG 事理图谱驱动的实时金融行情新闻资讯洞察

2025/4/24 4:52:29 来源:https://blog.csdn.net/u012365585/article/details/147361642  浏览:    关键词:相得益彰 — 基于 GraphRAG 事理图谱驱动的实时金融行情新闻资讯洞察

*本文为亚马逊云科技博客文章,仅用于技术分享,不构成投资建议或金融决策支持。文中涉及的公司名称仅用于技术示例,不代表亚马逊云科技观点或与这些公司的商业合作关系。

背景介绍

在当今这个信息爆炸的时代,金融市场每天都在产生海量的新闻资讯。这些新闻不仅仅是简单的信息,更蕴含着丰富的企业动态、行业变化和潜在风险信号。一则新闻背后往往隐藏着复杂的事件链条——一家公司的高管变动可能与其新业务布局相关,而这个业务转型又可能暗示着财务状况以及股市的变化。

信息大爆炸的时代,新闻资讯对金融市场的影响力日渐加强。每一个投资者每天都需要关注大量的各类金融信息。对于金融投资机构而言,如何对海量资讯进行有效分析,提供更准确的投资决策辅助,从而增加自身金融服务的价值,提高用户粘性,也是一个亟待解决的问题。

面对庞大的信息流,传统的人工分析方式早已力不从心。为了有效地捕捉和分析这些复杂的关联信息,我们需要一个智能化的解决方案。本文针对金融市场新闻资讯分析的场景,提出基于 LLM+GraphRAG 的解决方案,通过 LLM 对新闻资讯进行分析,提取图数据的三元组信息(实体-关系-实体),并存储于图数据库中。在进行知识问答时,从知识图谱中检索相关联的内容,转化为更丰富的上下文的信息提供给 LLM,以提高针对复杂金融资讯场景的智能知识问答的准确度。

需求分析

对金融资讯进行分析的目的在于全面了解金融市场及特定投资标的的动态,尤其是某些重要事件,判断其对金融市场的影响,从而做出不同的投资决策。因此,核心的需求集中在三点:一是信息覆盖的范围必须广,需要涵盖整个市场的主要资讯;二是针对特定投资标的,需要识别事件的重要性,适当剔除对投资标的行情影响不大的信息,且可以按照重要性进行排序;三是需要识别出新闻资讯与投资标的的关系,与投资标的进行关联,以辅助用户针对投资标的进行分析。在具体的落地方案上,可以通过智能应答机器人,为用户提供金融市场投资的辅助分析,基于用户的问题将新闻资讯的分析结果整合并答复用户。

GenAI 和知识图谱的结合:构建可信、可解释的 GraphRAG

在人工智能快速发展的今天,大语言模型(Large Language Model, LLM)凭借其强大的参数量和海量的训练数据,展现出了优秀的自然语言理解和生成能力。然而,作为一个隐式生成模型,LLM 也面临着“幻觉”问题和可解释性不足的挑战。为了克服这些局限性,业界普遍采用 Retrieval Augmented Generation(RAG)技术。RAG 通过检索相关文档片段来为模型提供知识支撑,提升回答的准确性。但在处理复杂的综合性问题时,传统 RAG 方法也显得力不从心,因为它难以有效地连接和整合来自多个文档的知识。

知识图谱(Knowledge Graph)是通过图结构来组织和展现知识关联,它将实体(如企业、人物、产品)作为节点,实体间的各种关系作为边,构建成一张信息网络。这种结构不仅能直观地展现数据间的关联性,还具备极强的可解释性。然而,知识图谱的构建因场景而异 – 企业风控领域关注公司关联关系,旅游服务领域侧重地理景点连接,医疗领域则构建疾病症状知识网络,每个领域都需要根据其特定需求来设计和构建适合的知识结构。

将 GenAI 与知识图谱结合,我们可以实现双向赋能:

  • 利用大模型的自然语言处理能力,辅助知识图谱的自动构建。

  • 借助知识图谱的结构化信息,增强 RAG 系统处理复杂关联性问题的能力。

这种结合让我们能够构建一个既有 AI 效率,又有知识图谱可解释性的智能系统。通过将散落在不同新闻报道中的信息片段进行智能提取和关联,我们构建了一个动态演进的知识图谱。这个知识图谱不仅能够清晰地展现近期企业发展动态,更能够为信用风险分析提供数据支撑,帮助分析师快速识别潜在的风险信号。

技术方案

事理图谱的构建

为了构建一个全面的企业事理图谱,我们首先定义了金融领域的核心实体类型和关系类型。在实体层面,我们关注五类关键实体:企业(Organization)、事件(Event)、时间(Date)、人物(Person)和产品(Product)。这些实体构成了图谱的基础节点。

在关系层面,我们构建了一个多维度的关系网络,以捕捉企业生态系统中的复杂互动:

  • 企业间关系:刻画企业之间的竞争、合作、投资等互动

  • 人事关系:追踪企业与人物之间的雇佣、任职变动等关联

  • 事件关联:记录企业参与的各类事件,以及事件之间的时序关系

为了确保实体和关系抽取的准确性,我们采用了 Claude Sonnet 3.5 大语言模型作为核心引擎。Claude 通过深度语义理解,从新闻文本中识别实体并判断其关系类型。这种方式相比传统的规则基础方法,能够更好地理解文本中的隐含关系和上下文信息。

经过处理的实体和关系数据最终被存储在 Amazon Neptune 图数据库中,形成一个动态更新的知识网络。Neptune 的图数据库特性为我们提供了高效的图查询能力,使得我们能够快速追踪企业发展脉络,发现潜在的风险信号。这个事理图谱不仅记录了静态的企业知识,更重要的是通过事件和时序关系的刻画,展现了企业发展的动态过程,为后续的风险分析提供了可靠的数据基础.

我们选取了一些 LLM 进行抽取实体之后的输出作为展示:

有了 LLM 抽取出来的实体信息并且梳理了实体之间的事件关联之后,我们可以把这些数据灌入图数据库,来构建我们的知识图谱便于后续的遍历。

事理图谱的信息查找和可视化

基于 Neptune 图数据库强大的图查询能力,我们实现了多维度的信息检索和知识探索。

在查询层面,Neptune 支持多种查询模式:

  • 实体关联查询:快速获取某个企业的所有相关实体,如竞争对手、合作伙伴、核心人员等。

  • 事件发展追踪:通过”Prior Event”关系,追溯企业相关事件的完整时序脉络。

  • 竞争态势分析:基于”Competitors”关系,绘制企业的竞争全景图。

如从 Neptune 图数据库中检索属性 name 的值等于 “Apple” 的顶点,并返回这些顶点的属性值映射:

gremlin> g.V().has('name', 'Apple').valueMap()
==>[name:[Apple]]

获取与顶点‘Apple’相连接的所有边及其相邻顶点的路径,筛选出竞争关系和合作关系的组织:

# 竞争关系
gremlin> g.V().has('name', 'Apple').bothE('Competitors').otherV().path()

# 合作关系
gremlin> g.V().has('name', 'Apple').bothE('Partners').otherV().path()

在可视化呈现方面,我们借助 Neptune Graph Explore 功能进行直观的图形化展示方式。如图所示,以苹果公司(Apple)为中心,我们可以清晰地看到:

  • 竞争关系网络:Google、Tesla、华为、Epic Games 等竞争对手

  • 商业生态:与 Curiosity Inc 的合作伙伴关系

  • 人员关联:如 Eddy Cue 等核心管理人员

  • 事件发展链:通过”Prior Event”关系串联起的事件发展脉络,从 2023 年 11 月到 2024 年 3 月的一系列关键事件

事理图谱的更新

同一个事件或公司常常会出现在不同媒体的报道中,且表述方式各异。为了保持图谱的一致性和准确性,我们需要一套有效的实体对齐和消歧机制,确保不会创建重复的实体节点。根据不同实体类型的特点,我们采用了差异化的对齐策略:

“短文本”企业对齐

对于短文本,如企业实体,由于其名称通常较为规范且简短(如”Apple Inc”、”AAPL”),我们主要采用字符串编辑距离(Edit Distance)进行相似度计算。这种方法能够有效处理公司全称与简称的对应、不同语言的企业名称表述等细微的拼写差异或格式变化。

“长文本”事件对齐

对于长文本,如事件实体,其特点是描述往往较长且形式多样。例如,同一个企业并购事件可能有多种不同的表述方式。针对这种情况,我们采用语义相似度匹配,利用 BGE 系列 embedding 提取事件描述的核心语义特征,计算事件描述之间的语义相似度,判断是否为同一事件。

通过这种分层的对齐策略,我们既保证了对齐的准确性,又提高了处理效率,使图谱能够准确反映最新的市场动态。

基于事理图谱的知识增强问答(GraphRAG)

传统的 RAG 方法通常只能检索到单一文档片段,难以处理需要多方面信息综合分析的复杂问题。为此,我们设计了基于事理图谱的知识增强问答系统(GraphRAG),通过图谱的多维度查询和关系推理,为大语言模型提供更全面的知识支撑。

多路知识检索

我们的检索策略采用双重方式定位相关信息:

  • 关键词匹配:通过抽取问题中的关键实体(如公司名、人名、事件),直接定位图谱中的相关节点。

  • 语义搜索:利用向量相似度,找到语义相关但表达形式不同的实体和事件。

知识关系补充

仅有单个节点的信息是不够的,我们通过图的多跳查询扩展相关关联知识:

  • 实体关系链接:追踪实体之间的直接和间接关联。时序脉络梳理:通过事件的时序关系,构建完整的发展链条。

  • 多维度关联:综合企业、人物、事件等多个维度的关联信息。

知识融合问答

在知识融合问答阶段,系统会将从图谱中检索到的结构化知识进行智能处理和整合,转化为富有上下文的信息提供给 Claude。这些信息包含了实体的核心属性与特征、实体之间的关联类型与关系属性,以及事件发生的时序脉络与因果关联。

例如,当分析一家科技公司的发展态势时,系统不仅能提供该公司的基础信息,还能梳理出其近期的重大事件、与竞争对手的互动关系、高管的人事变动等多维度信息。

这种基于图谱的知识增强机制,使得系统能够提供多角度的信息支撑,确保每个结论都能追溯到具体的图谱数据,并通过关联信息的整合实现更深层次的逻辑推理。这不仅提升了回答的准确性和可信度,更为复杂问题的分析提供了系统性的知识基础。

我们截取了两个样例,通过例子的回答,我们发现 GraphRAG 在问题范围比较宽泛情况下,回答的广度上更加优秀。而这和实际海量金融行情新闻的特征是比较符合的。

QueryAnswer(Vector RAG)Answer(GraphRAG)Accuray WinnerComprehensive Winner
Analyze recent trends of stock Apple?Before I provide any analysis, please note that this information is for educational purposes only and should not be considered financial advice. Investors should always do their own research and consult with a qualified financial advisor before making investment decisions.\n\nRecent trends for Apple (AAPL) stock:\n\n1. Performance: Apple stock has shown strong performance in recent months, reaching new all-time highs.\n\n2. Product launches: The company’s recent product launches, including the iPhone 15 series and new MacBook models, have generally been well-received by the market.\n\n3. Services growth: Apple’s services segment, including Apple Music, iCloud, and the App Store, continues to show robust growth, contributing significantly to the company’s revenue.\n\n4. AI focus: Apple has been increasing its focus on artificial intelligence, particularly in its devices and software, which has garnered investor interest.\n\n5. Supply chain improvements: The company has been working on diversifying its supply chain, which may help mitigate future disruptions.\n\n6. Share buybacks: Apple continues its substantial share repurchase program, which can support the stock price.\n\n7. Dividend growth: The company has been consistently increasing its dividend, albeit at a modest rate.\n\n8. Market sentiment: As one of the largest companies by market capitalization, Apple stock is often influenced by broader market trends and macroeconomic factors.\n\nRemember, past performance does not guarantee future results, and stock prices can be volatile. Always consider your personal financial situation and risk tolerance before making investment decisions.Before I provide any analysis, please note that this information is for educational purposes only and should not be considered financial advice. Investors should always do their own research and consult with a qualified financial advisor before making investment decisions.\n\nApple (AAPL) stock has shown some notable trends recently:\n\n1. Performance: Apple has generally outperformed the broader market in recent months, with the stock showing resilience despite some tech sector volatility.\n\n2. Product Cycle: The stock often experiences movement around new product launches and earnings reports. The anticipation of new iPhone models and other product releases can influence stock performance.\n\n3. Services Growth: There’s been increased focus on Apple’s services segment, which includes offerings like Apple Music, iCloud, and the App Store. This recurring revenue stream has been a key driver of growth.\n\n4. Market Cap Milestones: Apple has frequently traded as one of the world’s most valuable companies by market capitalization, often competing for the top spot.\n\n5. Dividend and Buybacks: Apple has maintained a dividend and share repurchase program, which can affect stock price and investor sentiment.\n\n6. Economic Factors: Like many tech stocks, Apple can be sensitive to macroeconomic factors such as interest rates, inflation, and global supply chain issues.\n\n7. AI and New Technologies: There’s growing interest in Apple’s potential moves in artificial intelligence and augmented reality, which could impact future stock performance.\n\nRemember, past performance does not guarantee future results. The stock market is inherently unpredictable, and many factors can influence a stock’s performance.GraphRag provides a well-rounded view of Apple’s recent stock performance trends, touching on key factors like market resilience, product cycles, services growth, and external economic influences. The insights are accurate reflections of trends observed in the market, without specific inaccuracies or misleading statements.GraphRag offers a detailed analysis of multiple aspects influencing Apple’s stock, including performance metrics, product cycles, services growth, market capitalization, dividends, macroeconomic factors, and future technology interests. This thorough examination provides a holistic view of the stock’s recent trends, making it comprehensive in its coverage.
Who are Tesla’s competitors? Tesla’s competitors?    Tesla faces competition from several companies in the electric vehicle (EV) and autonomous vehicle markets:\n\n1. **BYD**: A Chinese EV manufacturer that recently beat Tesla for the top spot in a competitive assessment of EV Original Equipment Manufacturers (OEMs) [citation:2].\n\n2. **SAIC Motor Corp. Ltd.**: This Chinese state-owned automobile manufacturer saw more new vehicle registrations in the European Union in July than Tesla [citation:3].\n\n3. **Volkswagen**: Europe’s best-selling car brand, which saw vehicle registrations rise by nearly 4% in the first seven months of 2024 [citation:3].\n\n4. **XPeng**: A Chinese EV maker that recently unveiled its first mass-market electric car, the MONA MO3, priced significantly lower than Tesla’s current offerings [citation:5].\n\n5. **Waymo** (Alphabet Inc.) and **Baidu Inc.**: Competitors in the robotaxi market, where Tesla is also aiming to establish dominance [citation:1].\n\n6. **General Motors (GM)** and **Ford**: Traditional automakers transitioning to EVs, though they have faced challenges in this transition [citation:6].\n\n7. **Uber**: While not a direct competitor in EV manufacturing, Uber is competing with Tesla in the autonomous vehicle market [citation:4].\n\nIt’s worth noting that the EV market is highly competitive and rapidly evolving, with both established automakers and new startups entering the field [citation:6].Tesla faces competition from several companies across different sectors:\n\n1. **In the electric vehicle market:**\n   – **XPeng**, a Chinese EV manufacturer, is described as one of Tesla’s main rivals in China. XPeng has beaten Tesla to market with a mass-market electric car, competing directly in the lower-priced EV segment [citation:7].\n   – **SAIC Motor Corp. Ltd.** surpassed Tesla in new vehicle registrations in the European Union in July 2024 [citation:11].\n   – **Polestar** is mentioned as being impacted by Tesla’s price war in the EV market [citation:19].\n\n2. **In autonomous driving technology:**\n   – XPeng is reportedly following Tesla’s approach by adopting pure vision driving for its Model F57 [citation:1].\n   – **SODA.Auto** has adopted a strategy similar to Tesla’s for developing self-driving vehicle (SDV) tools [citation:13].\n\n3. **In the robotaxi market:**\n   – **Uber Technologies** is a potential competitor, with plans to integrate GM’s Cruise vehicles into its ride-hailing network [citation:17].\n\n4. **In humanoid robotics:**\n   – Several **Chinese companies** are developing their own humanoid robots, inspired by Tesla’s Optimus [citation:4][citation:5].\n\n5. **In the broader technology sector:**\n   – Tesla is part of the ‘Magnificent 7’ group of influential tech companies, implying competition with other major tech firms [citation:25].\n\n6. **In energy storage:**\n   – While not direct competitors, Tesla’s energy storage products contribute to grid management, potentially competing with traditional energy solutions [citation:6][citation:15].\n\nIt’s worth noting that Tesla maintains a strong position in brand loyalty despite this competition [citation:21].NaiveRag accurately highlights specific geopolitical tensions and macroeconomic challenges impacting the semiconductor industry, including U.S. export restrictions and inflation concerns. It also references the cyclical nature of the industry, providing a factual basis for its claims, which aligns with current industry trends.GraphRag presents a more extensive list of both challenges and opportunities. It covers a variety of challenges, such as supply chain disruptions, talent shortages, and environmental concerns, and offers opportunities related to government investments and sustainability initiatives. This wider coverage provides a fuller understanding of the current landscape in the semiconductor industry.

结语与展望

本文介绍了一个基于事理图谱的智能金融分析系统 GraphRAG,通过将大语言模型 Claude 与知识图谱技术相结合,为复杂的金融分析场景提供了创新解决方案。

不同于传统 Vector RAG 方法仅能检索单一文档片段的局限,GraphRAG 特别适合处理需要多维度信息综合分析的复杂问题。例如,当分析一家企业的信用风险时,系统能够同时考虑其历史经营事件、高管变动、竞争态势、合作伙伴等多个维度的信息,通过图谱的关联关系,揭示出可能隐藏的风险信号。另外,由于金融市场强监管的特点,对基于 LLM 的智能化应用存在一定的准入门槛,而 GraphRAG 可以提高回答的可解释性,增强答案的真实性验证能力,对于 GenAI 在金融行业的落地推广也有帮助。

未来,我们将继续优化系统性能,探索更多的应用场景,为金融市场的智能分析提供更强大的技术支持。这个结合了最新 AI 技术的解决方案,展现了金融科技创新的无限可能。

*前述特定亚马逊云科技生成式人工智能相关的服务仅在亚马逊云科技海外区域可用,亚马逊云科技中国仅为帮助您了解行业前沿技术和发展海外业务选择推介该服务。

本篇作者

本期最新实验《多模一站通 —— Amazon Bedrock 上的基础模型初体验》✨ 精心设计,旨在引导您深入探索Amazon Bedrock的模型选择与调用、模型自动化评估以及安全围栏(Guardrail)等重要功能。无需管理基础设施,利用亚马逊技术与生态,快速集成与部署生成式AI模型能力。⏩️[点击进入实验] 即刻开启 AI 开发之旅构建无限, 探索启程!

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com

热搜词