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

网站项目意义动态链接做网站外链图

网站项目意义,动态链接做网站外链图,网络seo是什么意思,最新收录查询GraphRAG出自2024年4月的论文《From Local to Global: A Graph RAG Approach to Query-Focused Summarization》#xff0c;其代码也在2024年年中开源 。它在用图结构来完成RAG时#xff0c;使用社区这个概念并基于社区摘要来回答一些概括性的问题。 Graph RAG流程如论文图1所…GraphRAG出自2024年4月的论文《From Local to Global: A Graph RAG Approach to Query-Focused Summarization》其代码也在2024年年中开源 。它在用图结构来完成RAG时使用社区这个概念并基于社区摘要来回答一些概括性的问题。 Graph RAG流程如论文图1所示其索引过程如下 将文档分块论文也做了试验来分析chunk大小与后续步骤提取到的实体个数的关系如论文图2示意(gleaning是指在前面实体提取基础上提取漏掉的实体)。虽然通常而言提取的实体提取越多越好但是还是平衡召回(recall)和精度(precision)。 让LLM从chunk中提取实体和关系在prompt中让LLM先识别实体、再识别这些实体之间的关系再按指定格式输出使用few-shot prompt让LLM的实体和关系提取更准确(prompt在graphrag/index/graph/extractors/graph/prompts.py里)。 GRAPH_EXTRACTION_PROMPT -Goal- Given a text document that is potentially relevant to this activity and a list of entity types, identify all entities of those types from the text and all relationships among the identified entities.-Steps- 1. Identify all entities. For each identified entity, extract the following information: - entity_name: Name of the entity, capitalized - entity_type: One of the following types: [{entity_types}] - entity_description: Comprehensive description of the entitys attributes and activities Format each entity as (entity{tuple_delimiter}entity_name{tuple_delimiter}entity_type{tuple_delimiter}entity_description2. From the entities identified in step 1, identify all pairs of (source_entity, target_entity) that are *clearly related* to each other. For each pair of related entities, extract the following information: - source_entity: name of the source entity, as identified in step 1 - target_entity: name of the target entity, as identified in step 1 - relationship_description: explanation as to why you think the source entity and the target entity are related to each other - relationship_strength: a numeric score indicating strength of the relationship between the source entity and target entityFormat each relationship as (relationship{tuple_delimiter}source_entity{tuple_delimiter}target_entity{tuple_delimiter}relationship_description{tuple_delimiter}relationship_strength)3. Return output in English as a single list of all the entities and relationships identified in steps 1 and 2. Use **{record_delimiter}** as the list delimiter.4. When finished, output {completion_delimiter}###################### -Examples- ###################### Example 1:Entity_types: [person, technology, mission, organization, location] Text: while Alex clenched his jaw, the buzz of frustration dull against the backdrop of Taylors authoritarian certainty. It was this competitive undercurrent that kept him alert, the sense that his and Jordans shared commitment to discovery was an unspoken rebellion against Cruzs narrowing vision of control and order.Then Taylor did something unexpected. They paused beside Jordan and, for a moment, observed the device with something akin to reverence. “If this tech can be understood... Taylor said, their voice quieter, It could change the game for us. For all of us.”The underlying dismissal earlier seemed to falter, replaced by a glimpse of reluctant respect for the gravity of what lay in their hands. Jordan looked up, and for a fleeting heartbeat, their eyes locked with Taylors, a wordless clash of wills softening into an uneasy truce.It was a small transformation, barely perceptible, but one that Alex noted with an inward nod. They had all been brought here by different paths ################ Output: (entity{tuple_delimiter}Alex{tuple_delimiter}person{tuple_delimiter}Alex is a character who experiences frustration and is observant of the dynamics among other characters.){record_delimiter} (entity{tuple_delimiter}Taylor{tuple_delimiter}person{tuple_delimiter}Taylor is portrayed with authoritarian certainty and shows a moment of reverence towards a device, indicating a change in perspective.){record_delimiter} (entity{tuple_delimiter}Jordan{tuple_delimiter}person{tuple_delimiter}Jordan shares a commitment to discovery and has a significant interaction with Taylor regarding a device.){record_delimiter} (entity{tuple_delimiter}Cruz{tuple_delimiter}person{tuple_delimiter}Cruz is associated with a vision of control and order, influencing the dynamics among other characters.){record_delimiter} (entity{tuple_delimiter}The Device{tuple_delimiter}technology{tuple_delimiter}The Device is central to the story, with potential game-changing implications, and is revered by Taylor.){record_delimiter} (relationship{tuple_delimiter}Alex{tuple_delimiter}Taylor{tuple_delimiter}Alex is affected by Taylors authoritarian certainty and observes changes in Taylors attitude towards the device.{tuple_delimiter}7){record_delimiter} (relationship{tuple_delimiter}Alex{tuple_delimiter}Jordan{tuple_delimiter}Alex and Jordan share a commitment to discovery, which contrasts with Cruzs vision.{tuple_delimiter}6){record_delimiter} (relationship{tuple_delimiter}Taylor{tuple_delimiter}Jordan{tuple_delimiter}Taylor and Jordan interact directly regarding the device, leading to a moment of mutual respect and an uneasy truce.{tuple_delimiter}8){record_delimiter} (relationship{tuple_delimiter}Jordan{tuple_delimiter}Cruz{tuple_delimiter}Jordans commitment to discovery is in rebellion against Cruzs vision of control and order.{tuple_delimiter}5){record_delimiter} (relationship{tuple_delimiter}Taylor{tuple_delimiter}The Device{tuple_delimiter}Taylor shows reverence towards the device, indicating its importance and potential impact.{tuple_delimiter}9){completion_delimiter} ############################# Example 2:Entity_types: [person, technology, mission, organization, location] Text: They were no longer mere operatives; they had become guardians of a threshold, keepers of a message from a realm beyond stars and stripes. This elevation in their mission could not be shackled by regulations and established protocols—it demanded a new perspective, a new resolve.Tension threaded through the dialogue of beeps and static as communications with Washington buzzed in the background. The team stood, a portentous air enveloping them. It was clear that the decisions they made in the ensuing hours could redefine humanitys place in the cosmos or condemn them to ignorance and potential peril.Their connection to the stars solidified, the group moved to address the crystallizing warning, shifting from passive recipients to active participants. Mercers latter instincts gained precedence— the teams mandate had evolved, no longer solely to observe and report but to interact and prepare. A metamorphosis had begun, and Operation: Dulce hummed with the newfound frequency of their daring, a tone set not by the earthly ############# Output: (entity{tuple_delimiter}Washington{tuple_delimiter}location{tuple_delimiter}Washington is a location where communications are being received, indicating its importance in the decision-making process.){record_delimiter} (entity{tuple_delimiter}Operation: Dulce{tuple_delimiter}mission{tuple_delimiter}Operation: Dulce is described as a mission that has evolved to interact and prepare, indicating a significant shift in objectives and activities.){record_delimiter} (entity{tuple_delimiter}The team{tuple_delimiter}organization{tuple_delimiter}The team is portrayed as a group of individuals who have transitioned from passive observers to active participants in a mission, showing a dynamic change in their role.){record_delimiter} (relationship{tuple_delimiter}The team{tuple_delimiter}Washington{tuple_delimiter}The team receives communications from Washington, which influences their decision-making process.{tuple_delimiter}7){record_delimiter} (relationship{tuple_delimiter}The team{tuple_delimiter}Operation: Dulce{tuple_delimiter}The team is directly involved in Operation: Dulce, executing its evolved objectives and activities.{tuple_delimiter}9){completion_delimiter} ############################# Example 3:Entity_types: [person, role, technology, organization, event, location, concept] Text: their voice slicing through the buzz of activity. Control may be an illusion when facing an intelligence that literally writes its own rules, they stated stoically, casting a watchful eye over the flurry of data.Its like its learning to communicate, offered Sam Rivera from a nearby interface, their youthful energy boding a mix of awe and anxiety. This gives talking to strangers a whole new meaning.Alex surveyed his team—each face a study in concentration, determination, and not a small measure of trepidation. This might well be our first contact, he acknowledged, And we need to be ready for whatever answers back.Together, they stood on the edge of the unknown, forging humanitys response to a message from the heavens. The ensuing silence was palpable—a collective introspection about their role in this grand cosmic play, one that could rewrite human history.The encrypted dialogue continued to unfold, its intricate patterns showing an almost uncanny anticipation ############# Output: (entity{tuple_delimiter}Sam Rivera{tuple_delimiter}person{tuple_delimiter}Sam Rivera is a member of a team working on communicating with an unknown intelligence, showing a mix of awe and anxiety.){record_delimiter} (entity{tuple_delimiter}Alex{tuple_delimiter}person{tuple_delimiter}Alex is the leader of a team attempting first contact with an unknown intelligence, acknowledging the significance of their task.){record_delimiter} (entity{tuple_delimiter}Control{tuple_delimiter}concept{tuple_delimiter}Control refers to the ability to manage or govern, which is challenged by an intelligence that writes its own rules.){record_delimiter} (entity{tuple_delimiter}Intelligence{tuple_delimiter}concept{tuple_delimiter}Intelligence here refers to an unknown entity capable of writing its own rules and learning to communicate.){record_delimiter} (entity{tuple_delimiter}First Contact{tuple_delimiter}event{tuple_delimiter}First Contact is the potential initial communication between humanity and an unknown intelligence.){record_delimiter} (entity{tuple_delimiter}Humanitys Response{tuple_delimiter}event{tuple_delimiter}Humanitys Response is the collective action taken by Alexs team in response to a message from an unknown intelligence.){record_delimiter} (relationship{tuple_delimiter}Sam Rivera{tuple_delimiter}Intelligence{tuple_delimiter}Sam Rivera is directly involved in the process of learning to communicate with the unknown intelligence.{tuple_delimiter}9){record_delimiter} (relationship{tuple_delimiter}Alex{tuple_delimiter}First Contact{tuple_delimiter}Alex leads the team that might be making the First Contact with the unknown intelligence.{tuple_delimiter}10){record_delimiter} (relationship{tuple_delimiter}Alex{tuple_delimiter}Humanitys Response{tuple_delimiter}Alex and his team are the key figures in Humanitys Response to the unknown intelligence.{tuple_delimiter}8){record_delimiter} (relationship{tuple_delimiter}Control{tuple_delimiter}Intelligence{tuple_delimiter}The concept of Control is challenged by the Intelligence that writes its own rules.{tuple_delimiter}7){completion_delimiter} ############################# -Real Data- ###################### Entity_types: {entity_types} Text: {input_text} ###################### Output:CONTINUE_PROMPT MANY entities were missed in the last extraction. Add them below using the same format:\n LOOP_PROMPT It appears some entities may have still been missed. Answer YES | NO if there are still entities that need to be added.\n 让LLM针对提取的实体来进一步生成被称为covariate的claim包括subject, object, type, description, source text span, start and end dates属性(prompt在graphrag/index/graph/extractors/claims/prompts.py里) CLAIM_EXTRACTION_PROMPT -Target activity- You are an intelligent assistant that helps a human analyst to analyze claims against certain entities presented in a text document.-Goal- Given a text document that is potentially relevant to this activity, an entity specification, and a claim description, extract all entities that match the entity specification and all claims against those entities.-Steps- 1. Extract all named entities that match the predefined entity specification. Entity specification can either be a list of entity names or a list of entity types. 2. For each entity identified in step 1, extract all claims associated with the entity. Claims need to match the specified claim description, and the entity should be the subject of the claim. For each claim, extract the following information: - Subject: name of the entity that is subject of the claim, capitalized. The subject entity is one that committed the action described in the claim. Subject needs to be one of the named entities identified in step 1. - Object: name of the entity that is object of the claim, capitalized. The object entity is one that either reports/handles or is affected by the action described in the claim. If object entity is unknown, use **NONE**. - Claim Type: overall category of the claim, capitalized. Name it in a way that can be repeated across multiple text inputs, so that similar claims share the same claim type - Claim Status: **TRUE**, **FALSE**, or **SUSPECTED**. TRUE means the claim is confirmed, FALSE means the claim is found to be False, SUSPECTED means the claim is not verified. - Claim Description: Detailed description explaining the reasoning behind the claim, together with all the related evidence and references. - Claim Date: Period (start_date, end_date) when the claim was made. Both start_date and end_date should be in ISO-8601 format. If the claim was made on a single date rather than a date range, set the same date for both start_date and end_date. If date is unknown, return **NONE**. - Claim Source Text: List of **all** quotes from the original text that are relevant to the claim.Format each claim as (subject_entity{tuple_delimiter}object_entity{tuple_delimiter}claim_type{tuple_delimiter}claim_status{tuple_delimiter}claim_start_date{tuple_delimiter}claim_end_date{tuple_delimiter}claim_description{tuple_delimiter}claim_source)3. Return output in English as a single list of all the claims identified in steps 1 and 2. Use **{record_delimiter}** as the list delimiter.4. When finished, output {completion_delimiter}-Examples- Example 1: Entity specification: organization Claim description: red flags associated with an entity Text: According to an article on 2022/01/10, Company A was fined for bid rigging while participating in multiple public tenders published by Government Agency B. The company is owned by Person C who was suspected of engaging in corruption activities in 2015. Output:(COMPANY A{tuple_delimiter}GOVERNMENT AGENCY B{tuple_delimiter}ANTI-COMPETITIVE PRACTICES{tuple_delimiter}TRUE{tuple_delimiter}2022-01-10T00:00:00{tuple_delimiter}2022-01-10T00:00:00{tuple_delimiter}Company A was found to engage in anti-competitive practices because it was fined for bid rigging in multiple public tenders published by Government Agency B according to an article published on 2022/01/10{tuple_delimiter}According to an article published on 2022/01/10, Company A was fined for bid rigging while participating in multiple public tenders published by Government Agency B.) {completion_delimiter}Example 2: Entity specification: Company A, Person C Claim description: red flags associated with an entity Text: According to an article on 2022/01/10, Company A was fined for bid rigging while participating in multiple public tenders published by Government Agency B. The company is owned by Person C who was suspected of engaging in corruption activities in 2015. Output:(COMPANY A{tuple_delimiter}GOVERNMENT AGENCY B{tuple_delimiter}ANTI-COMPETITIVE PRACTICES{tuple_delimiter}TRUE{tuple_delimiter}2022-01-10T00:00:00{tuple_delimiter}2022-01-10T00:00:00{tuple_delimiter}Company A was found to engage in anti-competitive practices because it was fined for bid rigging in multiple public tenders published by Government Agency B according to an article published on 2022/01/10{tuple_delimiter}According to an article published on 2022/01/10, Company A was fined for bid rigging while participating in multiple public tenders published by Government Agency B.) {record_delimiter} (PERSON C{tuple_delimiter}NONE{tuple_delimiter}CORRUPTION{tuple_delimiter}SUSPECTED{tuple_delimiter}2015-01-01T00:00:00{tuple_delimiter}2015-12-30T00:00:00{tuple_delimiter}Person C was suspected of engaging in corruption activities in 2015{tuple_delimiter}The company is owned by Person C who was suspected of engaging in corruption activities in 2015) {completion_delimiter}-Real Data- Use the following input for your answer. Entity specification: {entity_specs} Claim description: {claim_description} Text: {input_text} Output: 将同名的实体和关系合并并让LLM对实体和关系的描述生成summary这里提到即使LLM对同一个实体不能保证每次都生成一样描述但也不影响整体方案的效果。(prompt在graphrag/index/graph/extractors/summarize/prompts.py里) SUMMARIZE_PROMPT You are a helpful assistant responsible for generating a comprehensive summary of the data provided below. Given one or two entities, and a list of descriptions, all related to the same entity or group of entities. Please concatenate all of these into a single, comprehensive description. Make sure to include information collected from all the descriptions. If the provided descriptions are contradictory, please resolve the contradictions and provide a single, coherent summary. Make sure it is written in third person, and include the entity names so we the have full context.####### -Data- Entities: {entity_name} Description List: {description_list} ####### Output:将前面提取的实体和关系构建成同构无向加权图实体作为图的节点关系作为图的边边的权重是关系的归一化计数。在图上应用层次化社区发现算法Leiden得到的层次结构的每个级别包含一个社区分区每个分区是互斥的但是整体构成一个图使得可以实现分而治之的全局摘要。 对生成的社区生成摘要按如下方式来生成摘要(prompt在graphrag/index/graph/extractors/community_reports/prompts.py) 对叶子级别的社区(Leaf-level communities)按照一定的优先级将节点、关系、covariate加入到LLM上下文窗口直到达到token上限。优先级定义为将社区中的边按照首尾节点的度之和来降序排序将首节点、尾节点、相关covariate、边的描述加入LLM上下文。对更高级别的社区(Higher-level communities):如果所有元素信息都可以放入LLM的上下文窗口则按叶子级别一样的处理逻辑。否则将子社区按照元素摘要token数目降序排序并迭代地用更短的子社区摘要来替换更长的元素摘要直到长度满足LLM上下文要求。(代码在graphrag/index/graph/extractors/community_reports/prep_community_report_context.py) GraphRAG的查询有Local和Global两种模式Local适用于回答关于某个实体相关的问题Global模式适合回答关于整个数据集相关的问题。 Local模式的步骤如下(如下图所示 将query在存储实体信息的向量库中检索出相关实体。将第一步实体相关的chunk信息、社区摘要、实体详情、实体关系、实体Covarites按一定的格式组织作为上下文。如果有历史聊天记录想历史聊天记录也作为上下文的一部分。让LLM根据上下文生成回答prompt路径为graphrag/query/structured_search/local_search/system_prompt.py)。 Global查询的步骤如下如下图所示prompt在graphrag/query/structured_search/global_search/map_system_prompt.py 和 graphrag/query/structured_search/global_search/reduce_system_prompt.py 将所有社区摘要shuffle并分块作为上下文另将历史对话构成的上下文与这些社区摘要块拼接在一起作为上下文。用map机制将前一步的多个上下文让LLM评估它们对于回答用户问题是否有帮助并进行0-100的打分。过滤掉分数为0的上下文。将前一步得到的结果合并且按照分数大小进行降序排序并将这些信息加入到LLM上下文窗口让LLM生成最终的回答。 GraphRAG在代码实现上有workflow概念如果需要修改运行流程只需要修改配置就可。构建索引时的流程定义在graphrag/index/create_pipeline_config.py中(pipeline基于微软开源的另一个包DataShaper实现的)实体抽取、社区发现等操作被定义为verb代码在graphrag/index/verbs目录下。但也因为它的workflow概念整个项目的代码可读性并不好。 参考资料 GraphRAG: arxiv, github, default dataflowblog: GraphRAG: Unlocking LLM discovery on narrative private data
http://www.hkea.cn/news/14439143/

相关文章:

  • 网站建设规划公司网站空间已到期 请尽快续费开通
  • 招商信息发布网站大全wordpress搭建网盘
  • 网站开发项目管理步骤网站背景图片怎么做
  • 还有用的网站做网站维护需要会什么
  • 四大门户网站是哪些电竞网站开发需求报告
  • 算命购物网站建设Wordpress免费版插件
  • 上海市杨浦区建设小学网站云南省住房和城乡建设厅网站首页
  • 信息图表网站公司网站不备案吗
  • 电商平台投诉找哪个部门企业网站搜索优化外包
  • 宣城网站建设 有限公司哪个网站做投票链接模板好看
  • 企业模板网站手机小程序怎么制作
  • 江苏省建设执业资格注册中心网站网站的策划和建设
  • 网站设计师介绍泰安网络犯罪案件
  • 家装室内设计案例分析图文网页seo如何优化
  • 保定建设信息网站商融交通建设工程有限公司网站
  • 网站开发用什么语言写建设工程合同分类有哪些
  • 网站转化路径无极电影网怎样下载电影
  • 做衬衫的作业网站html5 手机网站 图标
  • 周到的做pc端网站wordpress用户密码表
  • 做个营销型网站要多少钱cms系统
  • 做网站用什么格式做好北京流感最新消息
  • 钢丝高频退火设备网站建设营销渠道有哪些
  • 电商网站开发方案为什么要做一个营销型网站
  • 英语做课后作业的网站泰兴企业网站建设
  • 上海注册子公司流程和费用标准网站加载优化
  • 阿里巴巴网站建设目的网站建设 福步 2018
  • 西安企业建站费用建设银行网站登录
  • 电商运营网站 建设高端网站制造
  • 用数据库做学校网站wordpress内部服务器
  • 宝安网站开发怎么用手机免费下载1688视频