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.
1from sentence_transformers import SentenceTransformer
2
3# Load the model
4model = SentenceTransformer('mhaseeb1604/bge-m3-law')
5
6# Sample sentences
7sentences = ["This is an example sentence", "Each sentence is converted"]
8
9# Generate embeddings
10embeddings = model.encode(sentences)
11
12# Output embeddings
13print(embeddings)
The model was fine-tuned on Arabic and English legal texts using the following configurations:
1SentenceTransformer(
2 (0): Transformer({'max_seq_length': 8192, 'do_lower_case': False}) - XLMRobertaModel
3 (1): Pooling({'word_embedding_dimension': 1024, 'pooling_mode_cls_token': True, 'pooling_mode_mean_tokens': False})
4 (2): Normalize()
5)
1@misc {muhammad_haseeb_2024,
2 author = { {Muhammad Haseeb} },
3 title = { bge-m3-law (Revision 2fc0289) },
4 year = 2024,
5 url = { https://huggingface.co/mhaseeb1604/bge-m3-law },
6 doi = { 10.57967/hf/3217 },
7 publisher = { Hugging Face }
8}