Created
September 27, 2018 21:08
-
-
Save joeyism/5b929513e93c6e5c390fbb77bdbdabea 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 tensorflow_hub as hub | |
import tensorflow as tf | |
words_to_embed = ["dog", "cat", "sloth"] | |
elmo = hub.Module("https://tfhub.dev/google/elmo/2") | |
embedding_tensor = elmo(words_to_embed) # <-- removed other params | |
with tf.Session() as sess: | |
sess.run(tf.global_variables_initializer()) | |
embedding = sess.run(embedding_tensor) | |
print(embedding.shape) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment