Skip to content

Commit c98c145

Browse files
authored
HNSW support for soft-remove and hard-remove. (#227)
1 parent 8baa603 commit c98c145

File tree

3 files changed

+457
-146
lines changed

3 files changed

+457
-146
lines changed

benchmark/indexes/jaccard/hnsw.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ def search_hnsw_minhash_jaccard_topk(index_data, query_data, index_params, k):
127127
for i in tqdm.tqdm(
128128
range(len(index_keys)),
129129
desc="Indexing",
130-
unit=" query",
130+
unit=" minhash",
131131
total=len(index_keys),
132132
):
133133
index.insert(i, index_minhashes[num_perm][i])
@@ -156,7 +156,8 @@ def search_hnsw_minhash_jaccard_topk(index_data, query_data, index_params, k):
156156
# Recover the retrieved indexed sets and
157157
# compute the exact Jaccard similarities.
158158
result = [
159-
[index_keys[i], compute_jaccard(query_set, index_sets[i])] for i in result
159+
[index_keys[i], compute_jaccard(query_set, index_sets[i])]
160+
for i, _ in result
160161
]
161162
# Sort by similarity.
162163
result.sort(key=lambda x: x[1], reverse=True)

0 commit comments

Comments
 (0)