Skip to content

Commit

Permalink
Update frequency in incremental
Browse files Browse the repository at this point in the history
  • Loading branch information
natoverse committed Feb 13, 2025
1 parent 36edd03 commit 4df1318
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions graphrag/index/update/entities.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,9 @@ def _group_and_resolve_entities(
.reset_index()
)

# recompute frequency to include new text units
aggregated["frequency"] = aggregated["text_unit_ids"].apply(len)

# Force the result into a DataFrame
resolved: pd.DataFrame = pd.DataFrame(aggregated)

Expand All @@ -85,6 +88,7 @@ def _group_and_resolve_entities(
"type",
"description",
"text_unit_ids",
"frequency",
"degree",
"x",
"y",
Expand Down

0 comments on commit 4df1318

Please sign in to comment.