Views
No views yet
pip install -U sentence-transformers1from sentence_transformers import SentenceTransformer
2
3# Download from the 🤗 Hub
4model = SentenceTransformer("HasinMDG/multilingual-e5-large")
5# Run inference
6sentences = [
7 "passage: Fit Bodies Aren't Perfect, Either \n",
8 'passage: Royals attend extravagant ceremony to celebrate the opening of new museum',
9 'passage: Native-American Kids Doused With Beer at SD Hockey Game \n',
10]
11embeddings = model.encode(sentences)
12print(embeddings.shape)
13# [3, 1024]
14
15# Get the similarity scores for the embeddings
16similarities = model.similarity(embeddings, embeddings)
17print(similarities.shape)
18# [3, 3]