diff --git a/docs/embeddings.md b/docs/embeddings.md index 680efb5..f6a6ab8 100644 --- a/docs/embeddings.md +++ b/docs/embeddings.md @@ -21,6 +21,8 @@ Chroma provides lightweight wrappers around popular embedding providers, making | [Hugging Face Embedding Server](/embeddings/hugging-face-embedding-server) | ✅ | ✅ | | [Jina AI](/embeddings/jinaai) | ✅ | ✅ | | [Roboflow](/embeddings/roboflow-api) | ✅ | ➖ | +| [Universal Sentence Encoder](/embeddings/universal-sentence-encoder) | ✅ | ➖ | + We welcome pull requests to add new Embedding Functions to the community. diff --git a/docs/embeddings/universal-sentence-encoder.md b/docs/embeddings/universal-sentence-encoder.md new file mode 100644 index 0000000..f442e3a --- /dev/null +++ b/docs/embeddings/universal-sentence-encoder.md @@ -0,0 +1,44 @@ +--- +--- + +# Universal Sentence Encoder + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +
Select a language
+ + + + + + + + + + +Chroma also provides a convenient wrapper around [Universal Sentence Encoder](https://research.google.com/pubs/archive/46808.pdf) + +This embedding function uses models hosted on [Tensorflow Hub](https://tfhub.dev/). + +This embedding function relies on the `tensforflow_hub` python package, which you can install with `pip install tensforflow_hub`. + +```python +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](https://tfhub.dev/google/universal-sentence-encoder/4) provided by Tensorflow Hub + + + + Support for [Universal Sentence Encoder](https://research.google.com/pubs/archive/46808.pdf) embedding function is not implemented yet. Feel free to contribute by following the doc: [Custom Embedding Functions](https://docs.trychroma.com/embeddings?lang=js) + + + diff --git a/sidebars.js b/sidebars.js index 0f613ab..576baa0 100644 --- a/sidebars.js +++ b/sidebars.js @@ -93,8 +93,8 @@ const sidebars = { 'embeddings/hugging-face-embedding-server', 'embeddings/instructor', 'embeddings/roboflow-api', - 'embeddings/hugging-face-embedding-server', 'embeddings/jinaai', + 'embeddings/universal-sentence-encoder', ], }, ],