Skip to content

Commit

Permalink
Refactoring entity_resolution (infiniflow#2692)
Browse files Browse the repository at this point in the history
### What problem does this PR solve?

### Type of change

- [x] Refactoring
  • Loading branch information
guoyuhao2330 authored Sep 30, 2024
1 parent 570ad42 commit d6db805
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions graphrag/entity_resolution.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,7 @@ def __call__(self, graph: nx.Graph, prompt_variables: dict[str, Any] | None = No

candidate_resolution = {entity_type: [] for entity_type in entity_types}
for k, v in node_clusters.items():
candidate_resolution_tmp = []
for a, b in itertools.permutations(v, 2):
if self.is_similarity(a, b) and (b, a) not in candidate_resolution_tmp:
candidate_resolution_tmp.append((a, b))
candidate_resolution[k] = candidate_resolution_tmp
candidate_resolution[k] = [(a, b) for a, b in itertools.combinations(v, 2) if self.is_similarity(a, b)]

gen_conf = {"temperature": 0.5}
resolution_result = set()
Expand Down

0 comments on commit d6db805

Please sign in to comment.