Skip to content

Instantly share code, notes, and snippets.

@sbalnojan
Created June 20, 2019 19:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sbalnojan/f1048196942ddc76306155b6f88c7136 to your computer and use it in GitHub Desktop.
Save sbalnojan/f1048196942ddc76306155b6f88c7136 to your computer and use it in GitHub Desktop.
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