TensorFlow Hub module producer for text embedding lookup
Project description
tfembedhub
Convert embeddings vectors (.txt format) into TensorFlowHub embedding lookup module.
How to
- 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 "" 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.
- Sonvert saved embeddings into TF Hub Module with "tfembedhub-convert" command.
tfembedhub-convert vectors.txt vectors-hub/
- Use embedding hub via columns in your estimator.
from tfembedhub text_embedding_column, sequence_text_embedding_column
my_words_embedding = sequence_text_embedding_column(
key='sparse_key_from_features',
module_spec='path/to/my/hub'
)
# Then pass my_words_embedding to estimator "columns" list.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
tfembedhub-1.2.1.tar.gz
(8.4 kB
view details)
File details
Details for the file tfembedhub-1.2.1.tar.gz
.
File metadata
- Download URL: tfembedhub-1.2.1.tar.gz
- Upload date:
- Size: 8.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.19.1 setuptools/39.1.0 requests-toolbelt/0.8.0 tqdm/4.23.4 CPython/3.6.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6717904c82730904b85d240dc30bcca3c1ed33df8d72a386841610b1d9bdfa4e |
|
MD5 | 4fd6fdd651f4bad043f93f55af52519d |
|
BLAKE2b-256 | 0da8ba4a08665950ef81a9ba71ce5e9548edcd37d66276bac2b144406167e959 |