Commit 1a2d6502 authored by 赵威's avatar 赵威

get ids

parent 8a491b2f
......@@ -71,6 +71,11 @@ if __name__ == "__main__":
emb = np.array([embedding_dict[id]]).astype("float32")
print(emb)
D, I = index2.search(emb, 10)
res = I.tolist()
distances = D.tolist()[0]
ids = I.tolist()[0]
res = []
for index, i in enumerate(distances):
if i <= 0.1:
res.append(ids[i])
print(res, "\n")
print(D)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment