Skip to content

Files

Latest commit

Jul 19, 2024
6820243 · Jul 19, 2024

History

History
40 lines (24 loc) · 1.36 KB

File metadata and controls

40 lines (24 loc) · 1.36 KB

GraphRAG Visualization Tutorial

這個 repo 提供你已經做過 Indexing pipeline 的文件,讓你可以快速 Microsoft GraphRAG 進行知識圖譜的建立和問答;另外提供視覺化的文檔,方便你快速實作。

English | 中文

事前準備

確保你已經閱讀過 Microsoft GraphRAG 的文檔-英文,或我的文章-中文

環境變數

將 OpenAI API 或 Azure OpenAI 的 API key 輸入到 .env.sample 中,便將其重新命名為 .env

視覺化使用

方法 1: 使用 yFiles Graphs

安裝 requirements.txt 套件,注意 Python 版本要在 3.10 到 3.12 之間。

pip install -r requirements.txt

接著打開 graph-visualization.ipynb 並修改 INPUT_DIR 為你的的索引結果目錄,如果你下載了整個 repo,使用預設即可。

方法 2: 使用 GraphML 和第三方軟體

在 settings.yaml 中啟用 GraphML 輸出:

snapshots:
  graphml: True

完成 Indexing pipeline 後,使用如 Gephi 或 yEd Graph Editor 等工具開啟生成的 GraphML 文件。