Update text2vec.py (#19657)

Add that URL of the embedding tool "text2vec".
Fix minor mistakes in the doc-string.
pull/19666/head
hulitaitai 3 months ago committed by GitHub
parent 7630e9529c
commit dc2c9dd4d7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -10,6 +10,7 @@ class Text2vecEmbeddings(Embeddings, BaseModel):
"""text2vec embedding models.
Install text2vec first, run 'pip install -U text2vec'.
The gitbub repository for text2vec is : https://github.com/shibing624/text2vec
Example:
.. code-block:: python
@ -17,11 +18,11 @@ class Text2vecEmbeddings(Embeddings, BaseModel):
from langchain_community.embeddings.text2vec import Text2vecEmbeddings
embedding = Text2vecEmbeddings()
bookend.embed_documents([
embedding.embed_documents([
"This is a CoSENT(Cosine Sentence) model.",
"It maps sentences to a 768 dimensional dense vector space.",
])
bookend.embed_query(
embedding.embed_query(
"It can be used for text matching or semantic search."
)
"""

Loading…
Cancel
Save