Skip to content

Commit 4f79f58

Browse files
Ruff again
1 parent 9b905dc commit 4f79f58

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/neo4j_graphrag/experimental/components/resolver.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,8 @@ async def run(self) -> ResolutionStats:
245245
for (id1, emb1), (id2, emb2) in combinations(node_embeddings.items(), 2):
246246
sim = self._cosine_similarity(
247247
np.asarray(emb1, dtype=np.float64),
248-
np.asarray(emb2, dtype=np.float64))
248+
np.asarray(emb2, dtype=np.float64),
249+
)
249250
if sim >= self.similarity_threshold:
250251
pairs_to_merge.append({id1, id2})
251252

@@ -294,8 +295,7 @@ def _consolidate_sets(pairs: List[set[str]]) -> List[set[str]]:
294295

295296
@staticmethod
296297
def _cosine_similarity(
297-
vec1: NDArray[np.float64],
298-
vec2: NDArray[np.float64]
298+
vec1: NDArray[np.float64], vec2: NDArray[np.float64]
299299
) -> float:
300300
"""Calculate cosine similarity between two embedding vectors."""
301301
dot_product = np.dot(vec1, vec2)

0 commit comments

Comments
 (0)