From ab8c44892b60ec9eaeb6a35b17e7387a7d6ec9f4 Mon Sep 17 00:00:00 2001 From: Vishnu Nandakumar <38393302+Vishnunkumar@users.noreply.github.com> Date: Fri, 3 May 2024 00:15:58 +0530 Subject: [PATCH 1/2] docs: added docs for using spacy models --- docs/embeddings/spacy.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 docs/embeddings/spacy.md diff --git a/docs/embeddings/spacy.md b/docs/embeddings/spacy.md new file mode 100644 index 0000000..aeec99a --- /dev/null +++ b/docs/embeddings/spacy.md @@ -0,0 +1,18 @@ +--- +--- + +# spaCy + +Pre-trained embeddings that are available from [spaCy](https://spacy.io/models/) can be used for encoding text into vectors. They are fast, robust and good alternative for a lot of language models. To use spacy models in embedding function we have to install spacy module and also download a model of our choice. Please use the below snippet to install and download a model of our choice. + +```pip install spacy``` + +```spacy download model_name``` + +For the list models please visit: [spacy-models](https://spacy.io/models/) + +```python +import chromadb.utils.embedding_functions as embedding_functions +ef = embedding_functions.SpacyEmbeddingFunction(model_name) +embeddings = ef(["text-1", "text-2"]) +``` \ No newline at end of file From 56fbdd94ce08eddea8181139cdc53448663b37d0 Mon Sep 17 00:00:00 2001 From: Vishnu Nandakumar <38393302+Vishnunkumar@users.noreply.github.com> Date: Fri, 3 May 2024 00:17:00 +0530 Subject: [PATCH 2/2] fix: fixed docs for spacy module --- docs/embeddings/spacy.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/embeddings/spacy.md b/docs/embeddings/spacy.md index aeec99a..8a25e67 100644 --- a/docs/embeddings/spacy.md +++ b/docs/embeddings/spacy.md @@ -13,6 +13,6 @@ For the list models please visit: [spacy-models](https://spacy.io/models/) ```python import chromadb.utils.embedding_functions as embedding_functions -ef = embedding_functions.SpacyEmbeddingFunction(model_name) +ef = embedding_functions.SpacyEmbeddingFunction(model_name="en_core_web_md") embeddings = ef(["text-1", "text-2"]) ``` \ No newline at end of file