Fix too long context issue. (#4735)

### What problem does this PR solve?

#4728

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
Kevin Hu
2025-02-06 11:37:23 +08:00
committed by GitHub
parent a3a70431f3
commit 2a07eb69a7
4 changed files with 6 additions and 3 deletions

View File

@ -70,6 +70,8 @@ class CommunityReportsExtractor(Extractor):
weight = ents["weight"]
ents = ents["nodes"]
ent_df = pd.DataFrame(self._get_entity_(ents)).dropna()#[{"entity": n, **graph.nodes[n]} for n in ents])
if ent_df.empty:
continue
ent_df["entity"] = ent_df["entity_name"]
del ent_df["entity_name"]
rela_df = pd.DataFrame(self._get_relation_(list(ent_df["entity"]), list(ent_df["entity"]), 10000))