Downloads · 30 days
220
0% of all-time downloads
mhaseeb1604/bge-m3-law
bge-m3-law is a sentence similarity model from mhaseeb1604. Use it when you need a score for how close two texts are. It is set up for sentence-transformers.
This model is a fine-tuned version of the BAAI/bge-m3 model, which is specialized for sentence similarity tasks in Arabic legal texts in both Arabic and English. It maps sentences and paragraphs to a 1024-dimensional…
Downloads · 30 days
220
0% of all-time downloads
All-time downloads
94.7K
Public
Parameters
568M
2.3 GB on disk
Likes
6
Public
Click a slice to open those files.
.safetensors2.3 GB · 99%
From the Hugging Face model README
This model is a fine-tuned version of the BAAI/bge-m3 model, which is specialized for sentence similarity tasks in Arabic legal texts in both Arabic and English. It maps sentences and paragraphs to a 1024-dimensional dense vector space, useful for tasks like clustering, semantic search, and more.
To use this model, you need to have the sentence-transformers library installed. You can install it via pip:
pip install -U sentence-transformers
You can easily load and use this model in Python with the following code:
from sentence_transformers import SentenceTransformer
# Load the model
model = SentenceTransformer('mhaseeb1604/bge-m3-law')
# Sample sentences
sentences = ["This is an example sentence", "Each sentence is converted"]
# Generate embeddings
embeddings = model.encode(sentences)
# Output embeddings
print(embeddings)
The model was fine-tuned on Arabic and English legal texts using the following configurations:
MultipleNegativesRankingLoss with cosine similarity.2e-05.This model consists of three main components:
SentenceTransformer(
(0): Transformer({'max_seq_length': 8192, 'do_lower_case': False}) - XLMRobertaModel
(1): Pooling({'word_embedding_dimension': 1024, 'pooling_mode_cls_token': True, 'pooling_mode_mean_tokens': False})
(2): Normalize()
)
If you find this repository useful, please consider giving a star : and citation
@misc {muhammad_haseeb_2024,
author = { {Muhammad Haseeb} },
title = { bge-m3-law (Revision 2fc0289) },
year = 2024,
url = { https://huggingface.co/mhaseeb1604/bge-m3-law },
doi = { 10.57967/hf/3217 },
publisher = { Hugging Face }
}
<!--- Describe where people can find more information -->