当前位置: 首页 > 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…...

脑机新手指南(八):OpenBCI_GUI:从环境搭建到数据可视化(下)

一、数据处理与分析实战 &#xff08;一&#xff09;实时滤波与参数调整 基础滤波操作 60Hz 工频滤波&#xff1a;勾选界面右侧 “60Hz” 复选框&#xff0c;可有效抑制电网干扰&#xff08;适用于北美地区&#xff0c;欧洲用户可调整为 50Hz&#xff09;。 平滑处理&…...

工业安全零事故的智能守护者:一体化AI智能安防平台

前言&#xff1a; 通过AI视觉技术&#xff0c;为船厂提供全面的安全监控解决方案&#xff0c;涵盖交通违规检测、起重机轨道安全、非法入侵检测、盗窃防范、安全规范执行监控等多个方面&#xff0c;能够实现对应负责人反馈机制&#xff0c;并最终实现数据的统计报表。提升船厂…...

AI Agent与Agentic AI:原理、应用、挑战与未来展望

文章目录 一、引言二、AI Agent与Agentic AI的兴起2.1 技术契机与生态成熟2.2 Agent的定义与特征2.3 Agent的发展历程 三、AI Agent的核心技术栈解密3.1 感知模块代码示例&#xff1a;使用Python和OpenCV进行图像识别 3.2 认知与决策模块代码示例&#xff1a;使用OpenAI GPT-3进…...

Redis相关知识总结(缓存雪崩,缓存穿透,缓存击穿,Redis实现分布式锁,如何保持数据库和缓存一致)

文章目录 1.什么是Redis&#xff1f;2.为什么要使用redis作为mysql的缓存&#xff1f;3.什么是缓存雪崩、缓存穿透、缓存击穿&#xff1f;3.1缓存雪崩3.1.1 大量缓存同时过期3.1.2 Redis宕机 3.2 缓存击穿3.3 缓存穿透3.4 总结 4. 数据库和缓存如何保持一致性5. Redis实现分布式…...

QMC5883L的驱动

简介 本篇文章的代码已经上传到了github上面&#xff0c;开源代码 作为一个电子罗盘模块&#xff0c;我们可以通过I2C从中获取偏航角yaw&#xff0c;相对于六轴陀螺仪的yaw&#xff0c;qmc5883l几乎不会零飘并且成本较低。 参考资料 QMC5883L磁场传感器驱动 QMC5883L磁力计…...

Module Federation 和 Native Federation 的比较

前言 Module Federation 是 Webpack 5 引入的微前端架构方案&#xff0c;允许不同独立构建的应用在运行时动态共享模块。 Native Federation 是 Angular 官方基于 Module Federation 理念实现的专为 Angular 优化的微前端方案。 概念解析 Module Federation (模块联邦) Modul…...

【Web 进阶篇】优雅的接口设计:统一响应、全局异常处理与参数校验

系列回顾&#xff1a; 在上一篇中&#xff0c;我们成功地为应用集成了数据库&#xff0c;并使用 Spring Data JPA 实现了基本的 CRUD API。我们的应用现在能“记忆”数据了&#xff01;但是&#xff0c;如果你仔细审视那些 API&#xff0c;会发现它们还很“粗糙”&#xff1a;有…...

鸿蒙中用HarmonyOS SDK应用服务 HarmonyOS5开发一个生活电费的缴纳和查询小程序

一、项目初始化与配置 1. 创建项目 ohpm init harmony/utility-payment-app 2. 配置权限 // module.json5 {"requestPermissions": [{"name": "ohos.permission.INTERNET"},{"name": "ohos.permission.GET_NETWORK_INFO"…...

算法岗面试经验分享-大模型篇

文章目录 A 基础语言模型A.1 TransformerA.2 Bert B 大语言模型结构B.1 GPTB.2 LLamaB.3 ChatGLMB.4 Qwen C 大语言模型微调C.1 Fine-tuningC.2 Adapter-tuningC.3 Prefix-tuningC.4 P-tuningC.5 LoRA A 基础语言模型 A.1 Transformer &#xff08;1&#xff09;资源 论文&a…...

SiFli 52把Imagie图片,Font字体资源放在指定位置,编译成指定img.bin和font.bin的问题

分区配置 (ptab.json) img 属性介绍&#xff1a; img 属性指定分区存放的 image 名称&#xff0c;指定的 image 名称必须是当前工程生成的 binary 。 如果 binary 有多个文件&#xff0c;则以 proj_name:binary_name 格式指定文件名&#xff0c; proj_name 为工程 名&…...