瀏覽代碼

fix empty children in mindmap (#2418)

### What problem does this PR solve?

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
tags/v0.11.0
Kevin Hu 1 年之前
父節點
當前提交
3f571a13c2
沒有連結到貢獻者的電子郵件帳戶。
共有 1 個檔案被更改,包括 1 行新增1 行删除
  1. 1
    1
      graphrag/mind_map_extractor.py

+ 1
- 1
graphrag/mind_map_extractor.py 查看文件

@@ -66,7 +66,7 @@ class MindMapExtractor:
obj = [obj]
if isinstance(obj, list):
for i in obj: keyset.add(i)
return [{"id": re.sub(r"\*+", "", i), "children": []} for i in obj]
return [{"id": re.sub(r"\*+", "", i), "children": []} for i in obj if re.sub(r"\*+", "", i)]
arr = []
for k, v in obj.items():
k = self._key(k)

Loading…
取消
儲存