mirror of
https://github.com/wassname/keras-language-modeling.git
synced 2026-10-29 13:10:54 +08:00
added word embeddings
This commit is contained in:
1 parent
894dc21914
commit
54e6dfd478
2 files changed
+1
-1
No files matched your search
@@ -264,7 +264,7 @@ if __name__ == '__main__':
|
||||
# np.save(open('models/embedding_200_dim.h5', 'wb'), weights)
|
||||
|
||||
# load pre-trained embedding layer
|
||||
weights = np.load('word2vec_100_dim.h5')
|
||||
weights = np.load('word2vec_100_dim.embeddings')
|
||||
language_model = model.prediction_model.layers[2]
|
||||
language_model.layers[2].set_weights([weights])
|
||||
|
||||
|
||||
Executable
BIN
Binary file not shown.
Reference in new issue
Block a user