text2vec embedding models.
Install text2vec first, run 'pip install -U text2vec'. The github repository for text2vec is : https://github.com/shibing624/text2vec
Example:
.. code-block:: python
from langchain_community.embeddings.text2vec import Text2vecEmbeddings
embedding = Text2vecEmbeddings() embedding.embed_documents([ "This is a CoSENT(Cosine Sentence) model.", "It maps sentences to a 768 dimensional dense vector space.", ]) embedding.embed_query( "It can be used for text matching or semantic search." )
Embed documents using the text2vec embeddings model.
Embed a query using the text2vec embeddings model.