A Tensorflow SentenceTransformer layer that takes in strings as input.
Project description
tf-sentence-transformers
A simple tensorflow/keras wrapper around sentence-transformers
. The main class is SentenceTransformer
, a keras.Layer
that can be constructed from a pretrained checkpoint in huggingface model hub.
Example usage:
from tf_sentence_transformers import SentenceTransformer
layer = SentenceTransformer.from_pretrained(
"sentence-transformers/all-MiniLM-L6-v2"
)
inputs = [
["This is a test sentence."],
["This is another test sentence."],
]
embedding = layer(inputs)
# assert embedding.shape == (2, 384)
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
Built Distribution
Close
Hashes for tf_sentence_transformers-0.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 65b9fef1cf2d3148b47e1f3a369e798df6a85d5e18118572b9bc920ba7a92e8a |
|
MD5 | 825d9106ebc548d1bfc93e049218fa76 |
|
BLAKE2b-256 | 9caf0cbf530351e91d6fd40a192b5c71102347d8005699d57410a7b5cde6c8fd |
Close
Hashes for tf_sentence_transformers-0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c374c0a43974c742b8a07d7619030d567347862dad16c0ecd662df2d9bd745f9 |
|
MD5 | 7ac999544dd7e0550d79c33658682ebb |
|
BLAKE2b-256 | b780c9f18908aba07949412e53fa13b85adde59ac10d37653299865ef1bf0be3 |