Skip to main content

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


Download files

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

Source Distribution

tf_sentence_transformers-0.2.tar.gz (3.3 kB view details)

Uploaded Source

Built Distribution

tf_sentence_transformers-0.2-py3-none-any.whl (3.8 kB view details)

Uploaded Python 3

File details

Details for the file tf_sentence_transformers-0.2.tar.gz.

File metadata

File hashes

Hashes for tf_sentence_transformers-0.2.tar.gz
Algorithm Hash digest
SHA256 65b9fef1cf2d3148b47e1f3a369e798df6a85d5e18118572b9bc920ba7a92e8a
MD5 825d9106ebc548d1bfc93e049218fa76
BLAKE2b-256 9caf0cbf530351e91d6fd40a192b5c71102347d8005699d57410a7b5cde6c8fd

See more details on using hashes here.

File details

Details for the file tf_sentence_transformers-0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for tf_sentence_transformers-0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 c374c0a43974c742b8a07d7619030d567347862dad16c0ecd662df2d9bd745f9
MD5 7ac999544dd7e0550d79c33658682ebb
BLAKE2b-256 b780c9f18908aba07949412e53fa13b85adde59ac10d37653299865ef1bf0be3

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page