ModelScope
ModelScope is big repository of the models and datasets.
Let's load the ModelScope Embedding class.
from langchain_community.embeddings import ModelScopeEmbeddings
API Reference:ModelScopeEmbeddings
model_id = "damo/nlp_corom_sentence-embedding_english-base"
embeddings = ModelScopeEmbeddings(model_id=model_id)
text = "This is a test document."
query_result = embeddings.embed_query(text)
doc_results = embeddings.embed_documents(["foo"])
Related
- Embedding model conceptual guide
- Embedding model how-to guides