Created
June 20, 2019 19:48
-
-
Save sbalnojan/f1048196942ddc76306155b6f88c7136 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
import h5py | |
with open(os.path.join(DATA_DIR,"dictionary.json"), "rt") as tf: | |
dictionary = json.load(tf) | |
user_id = "0" | |
offset = dictionary["entities"]["user_id"].index(user_id) | |
print("our offset for user_id " , user_id, " is: ", offset) | |
with h5py.File("model/example_1/embeddings_user_id_" + user_id + ".v10.h5", "r") as hf: | |
embedding = hf["embeddings"][0, :] | |
print(embedding) | |
print(embedding.shape) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment