這個 repo 提供你已經做過 Indexing pipeline 的文件,讓你可以快速 Microsoft GraphRAG 進行知識圖譜的建立和問答;另外提供視覺化的文檔,方便你快速實作。
English | 中文
確保你已經閱讀過 Microsoft GraphRAG 的文檔-英文,或我的文章-中文。
將 OpenAI API 或 Azure OpenAI 的 API key 輸入到 .env.sample
中,便將其重新命名為 .env
安裝 requirements.txt 套件,注意 Python 版本要在 3.10 到 3.12 之間。
pip install -r requirements.txt
接著打開 graph-visualization.ipynb 並修改 INPUT_DIR 為你的的索引結果目錄,如果你下載了整個 repo,使用預設即可。
在 settings.yaml 中啟用 GraphML 輸出:
snapshots:
graphml: True
完成 Indexing pipeline 後,使用如 Gephi 或 yEd Graph Editor 等工具開啟生成的 GraphML 文件。