随笔 - 325,  文章 - 0,  评论 - 0,  阅读 - 16万

GraphRAG是微软研究院开发的一种创新型检索增强生成(RAG)方法,旨在提高大语言模型LLM在处理复杂信息和私有数据集时的推理能力

命令

  1. down graph rag

  2. pip install graphrag

  3. 在根目录下创建一个 ragtest/input 文件夹,在input下放入文件

  4. python -m graphrag.index --init --root ./ragtest --resume data
    python -m graphrag.index --init --root ./ragtest
    --resume data => 如果上一次运行失败,下一次运行的时候,就会接着上次失败的哪里接着运行,而不会重新运行
    初始化完毕之后,会创建一些文件

    • .env => 针对某一些模型,对某一些模型的 api_key 的配置
    • settings.yaml => 其他的配置,比如模型,key,类型...
    • prmpts/entity_extraction.txt => 实体抽取
    • summarize_desctriptions.txt => 摘要总结
    • claim_extraction.txt => 社区报告
    • community_report.txt => 社区描述
  5. python -m graphrag.index --root ./ragtest
    --data ./ragtest/output/doupo/artifacts => 指定具体加载的那个一个索引

  6. 查询
    全局查询
    python -m graphrag.query --root ./ragtest --method global "What are the top themes in this story?"
    本地的
    python -m graphrag.query --root ./ragtest --method local "Who is Scrooge, and what are his main relationships?"

  • _document_workflows
    • base_documents => 基本文档
    • final_documents => 最终文档

问题①
❌ create_summarized_entities
❌ Errors occurred during the pipeline run, see logs for more details.

问题②
❌ create_base_entity_graph
❌ Errors occurred during the pipeline run, see logs for more details.
解决 =>
 在.env环境当中填入你的key即可
 或者切换模型

问题③
❌ create_base_text_units
❌ Errors occurred during the pipeline run, see logs for more details.
解决 => 没有输入 知识库

问题④
❌ create_final_covariates
❌ Errors occurred during the pipeline run, see logs for more details.
解决 => 在.env文件下添加GRAPHRAG_CLAIM_EXTRACTION_ENABLED=True

posted on   文种玉  阅读(385)  评论(0编辑  收藏  举报
(评论功能已被禁用)
相关博文:
阅读排行:
· DeepSeek “源神”启动!「GitHub 热点速览」
· 我与微信审核的“相爱相杀”看个人小程序副业
· 微软正式发布.NET 10 Preview 1:开启下一代开发框架新篇章
· 如何使用 Uni-app 实现视频聊天(源码,支持安卓、iOS)
· C# 集成 DeepSeek 模型实现 AI 私有化(本地部署与 API 调用教程)
< 2025年2月 >
26 27 28 29 30 31 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 1
2 3 4 5 6 7 8

点击右上角即可分享
微信分享提示