Universal Sentence Encoder
Select a language
- Python
- JavaScript
Chroma also provides a convenient wrapper around Universal Sentence Encoder
This embedding function uses models hosted on Tensorflow Hub.
This embedding function relies on the tensforflow_hub
python package, which you can install with pip install tensforflow_hub
.
import chromadb.utils.embedding_functions as embedding_functions
huggingface_ef = embedding_functions.UniversalSentenceEncoderEmbeddingFunction()
huggingface_ef([
"The quick brown fox jumps over the lazy dog.",
"I am a sentence for which I would like to get its embedding"])
You can pass in an optional model_name
argument, which lets you choose which model to use. By default, Chroma uses Universal Sentence Encoder 4 provided by Tensorflow Hub
Support for Universal Sentence Encoder embedding function is not implemented yet. Feel free to contribute by following the doc: Custom Embedding Functions