Created
December 3, 2019 20:43
-
-
Save hamletbatista/398da7a634db206bd422ead1f8999b78 to your computer and use it in GitHub Desktop.
This file contains 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 | |
embed = hub.load("https://tfhub.dev/google/universal-sentence-encoder/3") | |
embeddings = embed([ | |
"The quick brown fox jumps over the lazy dog.", | |
"I am a sentence for which I would like to get its embedding"])["outputs"] | |
print embeddings | |
# The following are example embedding output of 512 dimensions per sentence | |
# Embedding for: The quick brown fox jumps over the lazy dog. | |
# [-0.03133016 -0.06338634 -0.01607501, ...] | |
# Embedding for: I am a sentence for which I would like to get its embedding. | |
# [0.05080863 -0.0165243 0.01573782, ...] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment