Refactoring entity_resolution (#2692)

### What problem does this PR solve?

### Type of change

- [x] Refactoring
This commit is contained in:
lidp 2024-09-30 17:18:09 +08:00 committed by GitHub
parent 570ad420a8
commit d6db805885
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -94,11 +94,7 @@ class EntityResolution:
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()