Skip to content

Commit

Permalink
Update text2vec.py (langchain-ai#19657)
Browse files Browse the repository at this point in the history
Add that URL of the embedding tool "text2vec".
Fix minor mistakes in the doc-string.
  • Loading branch information
hulitaitai authored and gkorland committed Mar 30, 2024
1 parent 12de1be commit 38aed4b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions libs/community/langchain_community/embeddings/text2vec.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,19 @@ 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
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."
)
"""
Expand Down

0 comments on commit 38aed4b

Please sign in to comment.