Skip to main content

TensorFlow Hub module producer for text embedding lookup

Project description


Convert embeddings vectors (.txt format) into TensorFlowHub embedding lookup module.

How to

  1. Save lookup keys and embeddings values in text file.

Keys should be in first column. Other columns treated as embedding values. Any space-like characters allowed as columns separator.

Non-existing keys will refer to "<UNQ>" key embeddings. You may provide embedding values for that, otherwise it will be initialized with zeros.

key1 1. 2. 3.
key2 4. 5. 6.
<UNQ> 0. -1. 0.
  1. Sonvert saved embeddings into TF Hub Module with "tfembedhub-convert" command.
tfembedhub-convert vectors.txt vectors-hub/
  1. Use embedding hub via columns in your estimator.
from tfembedhub text_embedding_column, sequence_text_embedding_column

my_words_embedding = sequence_text_embedding_column(

# Then pass my_words_embedding to estimator "columns" list.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for tfembedhub, version 1.2.1
Filename, size File type Python version Upload date Hashes
Filename, size tfembedhub-1.2.1.tar.gz (8.4 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page