Commit 499d138b authored by 赵威's avatar 赵威

update format

parent 73e77473
...@@ -51,9 +51,9 @@ if __name__ == "__main__": ...@@ -51,9 +51,9 @@ if __name__ == "__main__":
content_level = str(item["_source"]["content_level"]) content_level = str(item["_source"]["content_level"])
# print(id, content_level, content) # print(id, content_level, content)
level_dict[content_level].append(id) level_dict[content_level].append(id)
embedding_dict[id] = bc.encode([content]) embedding_dict[id] = bc.encode([content]).tolist()[0]
print(random.choice(list(embedding_dict.item()))) print(random.choice(list(embedding_dict.items())))
answer_ids = np.array(list(embedding_dict.keys())).astype("int") answer_ids = np.array(list(embedding_dict.keys())).astype("int")
answer_embeddings = np.array(list(embedding_dict.values())).astype("float32") answer_embeddings = np.array(list(embedding_dict.values())).astype("float32")
print(answer_embeddings.shape) print(answer_embeddings.shape)
......
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