From 3f571a13c2d443cec16500c807081ef99908ef77 Mon Sep 17 00:00:00 2001 From: Kevin Hu Date: Fri, 13 Sep 2024 17:19:47 +0800 Subject: [PATCH] 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) --- graphrag/mind_map_extractor.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/graphrag/mind_map_extractor.py b/graphrag/mind_map_extractor.py index 9a5560daf..e33650ba5 100644 --- a/graphrag/mind_map_extractor.py +++ b/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)