Uasge
pip install -U FlagEmbedding
Generate embedding for text (only Dense)
from FlagEmbedding import FlagModel
model_name = "puppyyyo/larceny-m3-law-knowledge-v3"
model = FlagModel(
model_name,
use_fp16=False
)
sentences_1 = ["What is BGE M3?", "Defination of BM25"]
sentences_2 = ["BGE M3 is an embedding model supporting dense retrieval, lexical matching and multi-vector interaction.",
"BM25 is a bag-of-words retrieval function that ranks a set of documents based on the query terms appearing in each document"]
embeddings_1 = model.encode(sentences_1)
embeddings_2 = model.encode(sentences_2)
similarity = embeddings_1 @ embeddings_2.T
print(similarity)
# m3-v1
# [[0.64422363 0.41711098], [0.5521891 0.75232375]]
# m3-v2
# [[0.5995765 0.26392284], [0.27698418 0.6981832 ]]
# m3-v3
# [[0.5663224 0.24284379], [0.26776457 0.68114114]]
- Downloads last month
- 4
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support
Model tree for puppyyyo/larceny-m3-ICT_v3
Base model
BAAI/bge-m3