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

GRAPHARG——学习

20250106
项目git地址:https://github.com/microsoft/graphrag.git
版本:1.2.0

### This config file contains required core defaults that must be set, along with a handful of common optional settings.
### For a full list of available settings, see https://microsoft.github.io/graphrag/config/yaml/### LLM settings ###
## There are a number of settings to tune the threading and token limits for LLM calls - check the docs.encoding_model: cl100k_base # this needs to be matched to your model!
`hiuuh`
llm:api_key: `填你自己的` # set this in the generated .env filetype: openai_chat # or azure_openai_chatmodel: deepseek-chatmodel_supports_json: true # recommended if this is available for your model.# audience: "https://cognitiveservices.azure.com/.default"api_base: https://api.deepseek.com # https://<instance>.openai.azure.comapi_version: V3# organization: <organization_id>deployment_name: maweijunparallelization:stagger: 0.3# num_threads: 50async_mode: threaded # or asyncioembeddings:async_mode: threaded # or asynciovector_store: type: lancedbdb_uri: 'output/lancedb'container_name: defaultoverwrite: truellm:api_key: `填你自己的`type: openai_embedding # or azure_openai_embeddingmodel: embedding-2api_base: https://open.bigmodel.cn/api/paas/v4# api_base: https://<instance>.openai.azure.com# api_version: 2024-02-15-preview# audience: "https://cognitiveservices.azure.com/.default"# organization: <organization_id># deployment_name: <azure_model_deployment_name>### Input settings ###input:type: file # or blobfile_type: text # or csvbase_dir: "input"file_encoding: utf-8file_pattern: ".*\\.txt$"chunks:size: 1200overlap: 100group_by_columns: [id]### Storage settings ###
## If blob storage is specified in the following four sections,
## connection_string and container_name must be providedcache:type: file # one of [blob, cosmosdb, file]base_dir: "cache"reporting:type: file # or console, blobbase_dir: "output/${timestamp}/logs"storage:type: file # one of [blob, cosmosdb, file]base_dir: "output/${timestamp}/artifacts"## only turn this on if running `graphrag index` with custom settings
## we normally use `graphrag update` with the defaults
update_index_storage:# type: file # or blob# base_dir: "update_output"### Workflow settings ###skip_workflows: []entity_extraction:prompt: "prompts/entity_extraction.txt"entity_types: [organization,person,geo,event]max_gleanings: 1summarize_descriptions:prompt: "prompts/summarize_descriptions.txt"max_length: 500claim_extraction:enabled: falseprompt: "prompts/claim_extraction.txt"description: "Any claims or facts that could be relevant to information discovery."max_gleanings: 1community_reports:prompt: "prompts/community_report.txt"max_length: 2000max_input_length: 8000cluster_graph:max_cluster_size: 10embed_graph:enabled: false # if true, will generate node2vec embeddings for nodesumap:enabled: false # if true, will generate UMAP embeddings for nodes (embed_graph must also be enabled)snapshots:graphml: trueembeddings: falsetransient: false### Query settings ###
## The prompt locations are required here, but each search method has a number of optional knobs that can be tuned.
## See the config docs: https://microsoft.github.io/graphrag/config/yaml/#querylocal_search:prompt: "prompts/local_search_system_prompt.txt"global_search:map_prompt: "prompts/global_search_map_system_prompt.txt"reduce_prompt: "prompts/global_search_reduce_system_prompt.txt"knowledge_prompt: "prompts/global_search_knowledge_system_prompt.txt"drift_search:prompt: "prompts/drift_search_system_prompt.txt"reduce_prompt: "prompts/drift_search_reduce_prompt.txt"basic_search:prompt: "prompts/basic_search_system_prompt.txt"

这段代码是一个配置文件,用于设置和调整 GraphARG 框架的行为。GraphARG 是一个基于图结构的推理框架,通常用于处理图数据和自然语言数据的联合任务。以下是对配置文件的详细解释:


1. LLM 设置 (LLM Settings)

这部分配置与 大语言模型 (LLM) 相关,用于定义如何调用和处理 LLM 的 API。

  • encoding_model: cl100k_base
    指定编码模型,需要与使用的 LLM 模型匹配。cl100k_base 是 OpenAI 模型常用的编码器。

  • llm
    配置 LLM 的 API 调用参数:

    • api_key: LLM 的 API 密钥,通常存储在 .env 文件中。
    • type: LLM 的类型,例如 openai_chatazure_openai_chat
    • model: 使用的 LLM 模型名称,例如 deepseek-chat
    • model_supports_json: 是否支持 JSON 格式的输入输出。
    • api_base: LLM API 的基础 URL。
    • api_version: API 的版本号。
    • deployment_name: 部署名称(适用于 Azure OpenAI)。
  • parallelization
    配置并行化参数:

    • stagger: 调用 API 时的延迟时间(秒),用于避免速率限制。
    • num_threads: 并行线程数(未启用)。
  • async_mode
    指定异步模式,可以是 threaded(多线程)或 asyncio(异步 I/O)。


2. 嵌入模型设置 (Embeddings Settings)

这部分配置与 嵌入模型 相关,用于生成文本或节点的向量表示。

  • async_mode
    指定嵌入模型的异步模式。

  • vector_store
    配置向量存储:

    • type: 向量存储类型,例如 lancedb
    • db_uri: 数据库的 URI。
    • container_name: 容器名称。
    • overwrite: 是否覆盖现有数据。
  • llm
    配置嵌入模型的 API 调用参数:

    • api_key: 嵌入模型的 API 密钥。
    • type: 嵌入模型类型,例如 openai_embeddingazure_openai_embedding
    • model: 嵌入模型名称,例如 embedding-2
    • api_base: 嵌入模型 API 的基础 URL。

3. 输入设置 (Input Settings)

这部分配置与输入数据的处理相关。

  • input
    配置输入数据的来源和格式:

    • type: 输入类型,例如 file(文件)或 blob(Blob 存储)。
    • file_type: 文件类型,例如 text(文本)或 csv
    • base_dir: 输入文件的根目录。
    • file_encoding: 文件编码格式,例如 utf-8
    • file_pattern: 文件名的正则表达式模式,用于匹配文件。
  • chunks
    配置文本分块参数:

    • size: 每个块的大小(字符数)。
    • overlap: 块之间的重叠字符数。
    • group_by_columns: 按列分组(适用于结构化数据)。

4. 存储设置 (Storage Settings)

这部分配置与缓存、报告和存储相关。

  • cache
    配置缓存存储:

    • type: 缓存类型,例如 file(文件)或 blob(Blob 存储)。
    • base_dir: 缓存文件的根目录。
  • reporting
    配置报告输出:

    • type: 报告类型,例如 file(文件)或 console(控制台)。
    • base_dir: 报告文件的根目录。
  • storage
    配置存储:

    • type: 存储类型,例如 file(文件)或 blob(Blob 存储)。
    • base_dir: 存储文件的根目录。
  • update_index_storage
    配置索引更新存储(通常不需要手动启用)。


5. 工作流设置 (Workflow Settings)

这部分配置与框架的工作流相关。

  • skip_workflows
    指定要跳过的工作流。

  • entity_extraction
    配置实体抽取任务:

    • prompt: 实体抽取的提示模板文件路径。
    • entity_types: 要抽取的实体类型,例如 organizationperson 等。
    • max_gleanings: 最大抽取数量。
  • summarize_descriptions
    配置文本摘要任务:

    • prompt: 摘要生成的提示模板文件路径。
    • max_length: 摘要的最大长度。
  • claim_extraction
    配置声明抽取任务(默认禁用):

    • prompt: 声明抽取的提示模板文件路径。
    • description: 任务的描述。
    • max_gleanings: 最大抽取数量。
  • community_reports
    配置社区报告生成任务:

    • prompt: 报告生成的提示模板文件路径。
    • max_length: 报告的最大长度。
    • max_input_length: 输入的最大长度。
  • cluster_graph
    配置图聚类任务:

    • max_cluster_size: 最大聚类大小。
  • embed_graph
    配置图嵌入任务(默认禁用)。

  • umap
    配置 UMAP 降维任务(默认禁用)。

  • snapshots
    配置快照输出:

    • graphml: 是否生成 GraphML 格式的快照。
    • embeddings: 是否生成嵌入快照。
    • transient: 是否生成临时快照。

6. 查询设置 (Query Settings)

这部分配置与查询任务相关。

  • local_search
    配置本地搜索任务:

    • prompt: 本地搜索的提示模板文件路径。
  • global_search
    配置全局搜索任务:

    • map_prompt: 全局搜索的 Map 阶段提示模板。
    • reduce_prompt: 全局搜索的 Reduce 阶段提示模板。
    • knowledge_prompt: 全局搜索的知识提示模板。
  • drift_search
    配置漂移搜索任务:

    • prompt: 漂移搜索的提示模板文件路径。
    • reduce_prompt: 漂移搜索的 Reduce 阶段提示模板。
  • basic_search
    配置基础搜索任务:

    • prompt: 基础搜索的提示模板文件路径。

总结

这个配置文件定义了 GraphARG 框架的核心行为,包括:

  1. LLM 和嵌入模型的 API 调用。
  2. 输入数据的处理方式。
  3. 缓存、报告和存储的设置。
  4. 工作流的任务配置。
  5. 查询任务的提示模板和参数。

通过调整这些配置,可以灵活地适应不同的应用场景和需求。如果需要更详细的配置选项,可以参考官方文档:GraphARG 配置文档。

相关文章:

GRAPHARG——学习

20250106 项目git地址&#xff1a;https://github.com/microsoft/graphrag.git 版本&#xff1a;1.2.0 ### This config file contains required core defaults that must be set, along with a handful of common optional settings. ### For a full list of available setti…...

【Rust自学】15.6. RefCell与内部可变性:“摆脱”安全性限制

题外话&#xff0c;这篇文章一共4050字&#xff0c;是截止到目前为止最长的文章&#xff0c;如果你能坚持读完并理解&#xff0c;那真的很强&#xff01; 喜欢的话别忘了点赞、收藏加关注哦&#xff08;加关注即可阅读全文&#xff09;&#xff0c;对接下来的教程有兴趣的可以…...

14.模型,纹理,着色器

模型、纹理和着色器是计算机图形学中的三个核心概念&#xff0c;用通俗易懂的方式来解释&#xff1a; 1. 模型&#xff1a;3D物体的骨架 通俗解释&#xff1a; 模型就像3D物体的骨架&#xff0c;定义了物体的形状和结构。 比如&#xff0c;一个房子的模型包括墙、屋顶、窗户等…...

【C语言分支与循环结构详解】

目录 ---------------------------------------begin--------------------------------------- 一、分支结构 1. if语句 2. switch语句 二、循环结构 1. for循环 2. while循环 3. do-while循环 三、嵌套结构 结语 -----------------------------------------end----…...

新项目上传gitlab

Git global setup git config --global user.name “FUFANGYU” git config --global user.email “fyfucnic.cn” Create a new repository git clone gitgit.dev.arp.cn:casDs/sawrd.git cd sawrd touch README.md git add README.md git commit -m “add README” git push…...

qt-QtQuick笔记之常见项目类简要介绍

qt-QtQuick笔记之常见项目类简要介绍 code review! 文章目录 qt-QtQuick笔记之常见项目类简要介绍1.QQuickItem2.QQuickRectangle3.QQuickImage4.QQuickText5.QQuickBorderImage6.QQuickTextInput7.QQuickButton8.QQuickSwitch9.QQuickListView10.QQuickGridView11.QQuickPopu…...

Continuous Batching 连续批处理

原始论文题目: Continuous Batching — ORCA: a distributed serving system for Transformer-based generative models 关键词: Continuous Batching, iteration-level scheduling, selective batching 1.迭代级调度(iteration-level scheduling) Orca系统又由几个关键…...

海外问卷调查渠道查如何设置:最佳实践+示例

随着经济全球化和一体化进程的加速&#xff0c;企业间的竞争日益加剧&#xff0c;为了获得更大的市场份额&#xff0c;对企业和品牌而言&#xff0c;了解受众群体的的需求、偏好和痛点才是走向成功的关键。而海外问卷调查才是获得受众群体痛点的关键&#xff0c;制作海外问卷调…...

把本地搭建的hexo博客部署到自己的服务器上

配置远程服务器的git 安装git 安装依赖工具包 yum install -y curl-devel expat-devel gettext-devel openssl-devel zlib-devel安装编译工具 yum install -y gcc perl-ExtUtils-MakeMaker package下载git&#xff0c;也可以去官网下载了传到服务器上 wget https://www.ke…...

初阶数据结构:链表(二)

目录 一、前言 二、带头双向循环链表 1.带头双向循环链表的结构 &#xff08;1)什么是带头&#xff1f; (2)什么是双向呢&#xff1f; &#xff08;3&#xff09;那什么是循环呢&#xff1f; 2.带头双向循环链表的实现 &#xff08;1&#xff09;节点结构 &#xff08;2…...

postgresql根据主键ID字段分批删除表数据

生产环境针对大表的处理相对比较麻烦。 方案1、直接truncate&#xff0c;可能会遇到系统卡主的情况&#xff0c;因为truncate的过程中会对表进行加锁&#xff0c;会导致数据不能正常的写入 方案2、创建一个同结构的表结构&#xff0c;rename旧表&#xff0c;不停业务rename表担…...

10.business english-global market

eco-friendly case study: 案例学习 At the workshop工作坊, they agreed to emphasize eco-friendliness,adapt messageing, and boost digital marketing to stand out globally. Our study shows that more people want eco-friendly products in different places.Looks …...

C 语言实现计算一年中指定日期是第几天 题】

引言 在编程的世界里&#xff0c;处理日期和时间相关的问题是非常常见的。比如在日历应用、任务管理系统、数据分析等场景中&#xff0c;经常需要计算某个日期在一年中是第几天。本文将详细介绍如何使用 C 语言来实现这一功能&#xff0c;通过分析代码的结构、逻辑以及可能存在…...

深入理解三高架构:高可用性、高性能、高扩展性的最佳实践

引言 在现代互联网环境下&#xff0c;随着用户规模和业务需求的快速增长&#xff0c;系统架构的设计变得尤为重要。为了确保系统能够在高负载和复杂场景下稳定运行&#xff0c;"三高架构"&#xff08;高可用性、高性能、高扩展性&#xff09;成为技术架构设计中的核…...

【反悔堆】力扣1642. 可以到达的最远建筑

给你一个整数数组 heights &#xff0c;表示建筑物的高度。另有一些砖块 bricks 和梯子 ladders 。 你从建筑物 0 开始旅程&#xff0c;不断向后面的建筑物移动&#xff0c;期间可能会用到砖块或梯子。 当从建筑物 i 移动到建筑物 i1&#xff08;下标 从 0 开始 &#xff09;…...

关于使用Mybatis-plus的TableNameHandler动态表名处理器实现分表业务的详细介绍

引言 随着互联网应用的快速发展&#xff0c;数据量呈爆炸式增长。传统的单表设计在面对海量数据时显得力不从心&#xff0c;容易出现性能瓶颈、查询效率低下等问题。为了提高数据库的扩展性和响应速度&#xff0c;分表&#xff08;Sharding&#xff09;成为了一种常见的解决方案…...

docker 安装 redis 详解

在平常的开发工作中&#xff0c;我们经常会用到 redis&#xff0c;那么 docker 下应该如何安装 redis 呢&#xff1f;简单来说&#xff1a;第一步&#xff1a;拉取redis镜像&#xff1b;第二步&#xff1a;设置 redis.conf 配置文件&#xff1b;第三步&#xff1a;编写 docker-…...

56. 合并区间

【题目】&#xff1a;56. 合并区间 class Solution { public:vector<vector<int>> merge(vector<vector<int>>& intervals) {// 按照左端点排序sort(intervals.begin(), intervals.end(), [&](vector<int> lhs, vector<int> rhs)…...

BOM对象location与数组操作结合——查询串提取案例

BOM对象location与数组操作结合——查询串提取案例 前置知识 1. Location 对象 Location 对象是 JavaScript 提供的内置对象之一&#xff0c;它表示当前窗口或框架的 URL&#xff0c;并允许你通过它操作或获取 URL 的信息。可以通过 window.location 访问。 主要属性&#…...

Jetson Orin Nano Super之 onnxruntime 编译安装

Jetson Orin Nano Super之 onnxruntime 编译安装 1. 源由2. 步骤步骤一&#xff1a;安装3.26 cmake步骤二&#xff1a;下载代码步骤三&#xff1a;编译代码步骤四&#xff1a;找到安装包步骤五&#xff1a;安装whl包 3. 注意4. 参考资料 1. 源由 Build onnxruntime 1.19.2 fai…...

大数据学习栈记——Neo4j的安装与使用

本文介绍图数据库Neofj的安装与使用&#xff0c;操作系统&#xff1a;Ubuntu24.04&#xff0c;Neofj版本&#xff1a;2025.04.0。 Apt安装 Neofj可以进行官网安装&#xff1a;Neo4j Deployment Center - Graph Database & Analytics 我这里安装是添加软件源的方法 最新版…...

Python:操作 Excel 折叠

💖亲爱的技术爱好者们,热烈欢迎来到 Kant2048 的博客!我是 Thomas Kant,很开心能在CSDN上与你们相遇~💖 本博客的精华专栏: 【自动化测试】 【测试经验】 【人工智能】 【Python】 Python 操作 Excel 系列 读取单元格数据按行写入设置行高和列宽自动调整行高和列宽水平…...

uniapp中使用aixos 报错

问题&#xff1a; 在uniapp中使用aixos&#xff0c;运行后报如下错误&#xff1a; AxiosError: There is no suitable adapter to dispatch the request since : - adapter xhr is not supported by the environment - adapter http is not available in the build 解决方案&…...

代码随想录刷题day30

1、零钱兑换II 给你一个整数数组 coins 表示不同面额的硬币&#xff0c;另给一个整数 amount 表示总金额。 请你计算并返回可以凑成总金额的硬币组合数。如果任何硬币组合都无法凑出总金额&#xff0c;返回 0 。 假设每一种面额的硬币有无限个。 题目数据保证结果符合 32 位带…...

django blank 与 null的区别

1.blank blank控制表单验证时是否允许字段为空 2.null null控制数据库层面是否为空 但是&#xff0c;要注意以下几点&#xff1a; Django的表单验证与null无关&#xff1a;null参数控制的是数据库层面字段是否可以为NULL&#xff0c;而blank参数控制的是Django表单验证时字…...

0x-3-Oracle 23 ai-sqlcl 25.1 集成安装-配置和优化

是不是受够了安装了oracle database之后sqlplus的简陋&#xff0c;无法删除无法上下翻页的苦恼。 可以安装readline和rlwrap插件的话&#xff0c;配置.bahs_profile后也能解决上下翻页这些&#xff0c;但是很多生产环境无法安装rpm包。 oracle提供了sqlcl免费许可&#xff0c…...

规则与人性的天平——由高考迟到事件引发的思考

当那位身着校服的考生在考场关闭1分钟后狂奔而至&#xff0c;他涨红的脸上写满绝望。铁门内秒针划过的弧度&#xff0c;成为改变人生的残酷抛物线。家长声嘶力竭的哀求与考务人员机械的"这是规定"&#xff0c;构成当代中国教育最尖锐的隐喻。 一、刚性规则的必要性 …...

webpack面试题

面试题&#xff1a;webpack介绍和简单使用 一、webpack&#xff08;模块化打包工具&#xff09;1. webpack是把项目当作一个整体&#xff0c;通过给定的一个主文件&#xff0c;webpack将从这个主文件开始找到你项目当中的所有依赖文件&#xff0c;使用loaders来处理它们&#x…...

CTF show 数学不及格

拿到题目先查一下壳&#xff0c;看一下信息 发现是一个ELF文件&#xff0c;64位的 ​ 用IDA Pro 64 打开这个文件 ​ 然后点击F5进行伪代码转换 可以看到有五个if判断&#xff0c;第一个argc ! 5这个判断并没有起太大作用&#xff0c;主要是下面四个if判断 ​ 根据题目…...

Qt的学习(二)

1. 创建Hello Word 两种方式&#xff0c;实现helloworld&#xff1a; 1.通过图形化的方式&#xff0c;在界面上创建出一个控件&#xff0c;显示helloworld 2.通过纯代码的方式&#xff0c;通过编写代码&#xff0c;在界面上创建控件&#xff0c; 显示hello world&#xff1b; …...