SentenceTransformer
This is a
sentence-transformers
model trained. It maps sentences & paragraphs to a 768-dimensional dense vector space and can be used for semantic textual similarity, semantic search, paraphrase mining, text classification, clustering, and more.
Model Details
Model Description
Model Type:
Sentence Transformer
Maximum Sequence Length:
256 tokens
Output Dimensionality:
768 dimensions
Similarity Function:
Cosine Similarity
Model Sources
Full Model Architecture
SentenceTransformer(
(0): Transformer({'max_seq_length': 256, 'do_lower_case': False, 'architecture': 'XLMRobertaModel'})
(1): Pooling({'word_embedding_dimension': 768, 'pooling_mode_cls_token': False, 'pooling_mode_mean_tokens': True, 'pooling_mode_max_tokens': False, 'pooling_mode_mean_sqrt_len_tokens': False, 'pooling_mode_weightedmean_tokens': False, 'pooling_mode_lasttoken': False, 'include_prompt': True})
)
Usage
Direct Usage (Sentence Transformers)
First install the Sentence Transformers library:
pip install -U sentence-transformers
Then you can load this model and run inference.
from sentence_transformers import SentenceTransformer
# Download from the 🤗 Hub
model = SentenceTransformer("alakxender/e5-dhivehi-combined-trained-mnr-mx" )
# Run inference
sentences = [
'query: ޔުމްނުގެ ބަޔާން ނަގަން ރަސްމީކޮށް ފުލުހުން އެދިފައެއް ނުވޭ: އާއިލާ' ,
'passage: އެ ސިޓީގައި، ފުލުހުން ނެރުނު ބަޔާނުގައި ހުރީ ހަގީގަތާ ހިލާފު ވާހަކަތަކެއް ކަމަށް ބުނެފައިވެ އެވެ. އަދި އެ މައްސަލައާ ގުޅިގެން މީގެ ކުރިން ވެސް ހަގީގަތާ ހިލާފު މައުލޫމާތު ފުލުހުން ހާމަކޮށްފައިވާ ކަމަށް ތުހުމަތުކޮށްފައިވެ އެވެ.\n\nހ. ފެންޓެނޯއީ ގޭގެ ނުވަވަނަ ފަންގިފިލާއިން ގުދަނެއްގެ ފުރާޅު މައްޗަށް ހައްވާ ޔުމްނު ރަޝީދުގެ ބަޔާން ނެގުމަށް ރަސްމީކޮށް ފުލުހުން އެދިފައި ނުވާ ކަމަށް އާއިލާއިން ބުނެފި އެވެ.\n\nމި މައްސަލައާ ގުޅިގެން ފުލުހުން މިދިޔަ ބުރާސްފަތި ދުވަހު ނެރުނު ބަޔާނެއްގައި ބުނެފައި ވަނީ ޔުމްނުގެ ބަޔާން ނެގުމަށް މަސައްކަތް ކުރަމުންދާ ކަމަށާއި ނަމަވެސް އާއިލާގެ އެއްބާރުލުން ނުލިބޭ ކަމަށެވެ. ޔުމްނު މެލޭޝިއާއަށް އިތުރު ފަރުވާއަށް ގެންދިޔަ ދުވަހުން ފެށިގެން ދެ ފުލުހުން އެ ގައުމުގައި ތިބި ކަމަށް ވެސް ފުލުހުން ބުންޏެވެ.ފުލުހުން ނެރުނު ބަޔާނާ ގުޅިގެން ޔުމްނުގެ އާއިލާއިން މިއަދު ވަނީ\xa0އެކްޓިން ޕޮލިސް ކޮމިޝަނަރު އިސްމާއީލް ނަވީނަށް ސިޓީއެއް ފޮނުވައިފަ އެވެ. އެ ސިޓީގައި، ފުލުހުން ނެރުނު ބަޔާނުގައި ހުރީ ހަގީގަތާ ހިލާފު ވާހަކަތަކެއް ކަމަށް ބުނެފައިވެ އެވެ. އަދި އެ މައްސަލައާ ގުޅިގެން މީގެ ކުރިން ވެސް ހަގީގަތާ ހިލާފު މައުލޫމާތު ފުލުހުން ހާމަކޮށްފައިވާ ކަމަށް ތުހުމަތުކޮށްފައިވެ އެވެ.އޭގެ އިތުރުން، ތަހުގީގަށް އެންމެ ނާޒުކު ދަނޑިވަޅުގައި ފުލުހުން އަމަލުކޮށްފައިވާ ގޮތުން، އިންސާފުވެރިކަމާއެކު ތަހުގީގު ކުރިއަށް ގެންދާނެ ކަމުގެ ޔަގީންކަން މިހާރު ނެތް ކަމަށާއި، ނަމަވެސް ރާއްޖޭގެ ގާނޫނުތަކާއި ގަވައިދުތަކަށް ތަބާވުމުގެ ގޮތުން ފުލުހުން ކުރިއަށް ގެންދާ އެއްވެސް ތަހުގީގަކަށް އާއިލާއިން ހުރަސް ނާޅާނެ ކަމަށް ސިޓީގައިވެ އެވެ.ޔުމްނުގެ ދައްތަ، އާއިޝަތު ނާއިޝާ އަހުމަދު ރަޝީދު ސޮއިކޮށް ފޮނުވި އެ ސިޓީގައި ވަނީ ޔުމްނުގެ ބަޔާން ނަގަން ފުލުހުން ރަސްމީކޮށް އެދިފައި ނުވާ ކަމަށާއި، ބަޔާނެއް ނަގަން ރަސްމީކޮށް ލިޔުމުން އަންގައިފިނަމަ، އެކަމަށް އާއިލާއިން ޖަވާބުދާރީވާނެ ކަމަށެވެ.\xa0\n\n"ހައްވާ ޔުމްނު ރަޝީދަށް ލިބިފައިވާ އަނިޔާތަކާ ގުޅިގެން އޭނާ މިވަގުުތު އޮތީ ތަހުގީގަށް ބަޔާން ދެވޭ ފަދަ ހާލަތެއްގައި ނޫންކަން ޑޮކްޓަރުންގެ ރަސްމީ ލިޔުންތަކުން ވެސް އެނގެން އޮތްކަމުގައި ދަންނަވަމެވެ." އެ ސިޓީގައިވެ އެވެ.ސިޓީގައި ބުނެފައި ވަނީ ޔުމްނުގެ ހާލަތާ ގުޅޭ އެއްވެސް މައުލޫމާތެއް އާއިލާއިން ފުލުހުންނާ ހިއްސާ ނުކުރާ ކަމަށް ފުލުހުން ބުނި ނަމަވެސް، އެފަދަ މައުލޫމާތެއް ހޯދަން ފުލުހުންގެ ފަރާތުން އެދިފައިވެސް ނުވާ ކަމަށެވެ. އަދި، ފުލުހުންގެ ތަހުގީގަށް އާއިލާއިން އެއްބާރުލުން ނުދޭ ކަމަށް ބުނާ ވާހަކަ ވެސް ދޮގުކޮށްފައިވެ އެވެ. އެގޮތުން، ޔުމްނުގެ އާއިލާއާ ޗީފް އިންސްޕެކްޓާ އޮފް ޕޮލިސް ޑރ. ހަސަން އުމައިރު، މެލޭޝިއާގައި ދޮޅުގަޑިއެއްހާއިރު ބައްދަލުވުމެއް ބާއްވައިފައިވާކަން އެ ސިޓީގައި ބަޔާންކޮށްފައިވެ އެވެ."އާއިލާގެ އެންމެ ބޮޑު މަސްލަހަތެއް މިވަގުތު އޮތީ އޭނާއަށް އެކަށީގެންވާ ފަރުވާ ލިބިދިނުމާއެކު، އޭނާއަށް އިންސާފު ހޯދުމަށް މަސައްކަތް ކުރުމުގައެވެ. އެކަމުގައި ގާނޫނުތަކާއި ގަވައިދުތަކާ އެއްގޮތްވާ ގޮތުގެ މަތީން ފުލުހުންނަށް ދޭން ޖެހޭ އެންމެހާ އެއްބާރުލުމެއް އާއިލާގެ ފަރާތުން ދޭނެކަމުގައި ދަންނަވަމެވެ." އެ ސިޓީގައިވެ އެވެ.\n\nމި މަސައްކަތުގައި އަހަރެމެން ހަމަ ހަމަ ވާނެ، އިންސާފުވެރި ވާނެ، އިތުބާރު ދަމަހައްޓާނެ' ,
'query: ޖެނުއަރީ 2008 ގައި ކޭބީޖީވައި އިން ވަނީ އެމްއެންގެ އަލްބަނީގައި ހުންނަ ކޭއެލްސީއައި 106.1 އާއި އެމްއެންގެ އެލްކް ރިވަރގައި ހުންނަ ކޭޑީޑީޖީ 105.5 އިން ހެނދުނުގެ ޝޯ އެއްފަހަރާ ކާސްޓް ކުރަން ފަށާފައެވެ .' ,
]
embeddings = model.encode(sentences)
print (embeddings.shape)
# [3, 768]
# Get the similarity scores for the embeddings
similarities = model.similarity(embeddings, embeddings)
print (similarities)
# tensor([[ 1.0000, 0.7517, -0.0737],
# [ 0.7517, 1.0000, -0.0515],
# [-0.0737, -0.0515, 1.0000]])
Training Details
Training Dataset
Training Hyperparameters
Non-Default Hyperparameters
per_device_train_batch_size
: 32
per_device_eval_batch_size
: 32
num_train_epochs
: 10
multi_dataset_batch_sampler
: round_robin
All Hyperparameters
Click to expand
overwrite_output_dir
: False
do_predict
: False
eval_strategy
: no
prediction_loss_only
: True
per_device_train_batch_size
: 32
per_device_eval_batch_size
: 32
per_gpu_train_batch_size
: None
per_gpu_eval_batch_size
: None
gradient_accumulation_steps
: 1
eval_accumulation_steps
: None
torch_empty_cache_steps
: None
learning_rate
: 5e-05
weight_decay
: 0.0
adam_beta1
: 0.9
adam_beta2
: 0.999
adam_epsilon
: 1e-08
max_grad_norm
: 1
num_train_epochs
: 10
max_steps
: -1
lr_scheduler_type
: linear
lr_scheduler_kwargs
: {}
warmup_ratio
: 0.0
warmup_steps
: 0
log_level
: passive
log_level_replica
: warning
log_on_each_node
: True
logging_nan_inf_filter
: True
save_safetensors
: True
save_on_each_node
: False
save_only_model
: False
restore_callback_states_from_checkpoint
: False
no_cuda
: False
use_cpu
: False
use_mps_device
: False
seed
: 42
data_seed
: None
jit_mode_eval
: False
use_ipex
: False
bf16
: False
fp16
: False
fp16_opt_level
: O1
half_precision_backend
: auto
bf16_full_eval
: False
fp16_full_eval
: False
tf32
: None
local_rank
: 0
ddp_backend
: None
tpu_num_cores
: None
tpu_metrics_debug
: False
debug
: []
dataloader_drop_last
: False
dataloader_num_workers
: 0
dataloader_prefetch_factor
: None
past_index
: -1
disable_tqdm
: False
remove_unused_columns
: True
label_names
: None
load_best_model_at_end
: False
ignore_data_skip
: False
fsdp
: []
fsdp_min_num_params
: 0
fsdp_config
: {'min_num_params': 0, 'xla': False, 'xla_fsdp_v2': False, 'xla_fsdp_grad_ckpt': False}
fsdp_transformer_layer_cls_to_wrap
: None
accelerator_config
: {'split_batches': False, 'dispatch_batches': None, 'even_batches': True, 'use_seedable_sampler': True, 'non_blocking': False, 'gradient_accumulation_kwargs': None}
deepspeed
: None
label_smoothing_factor
: 0.0
optim
: adamw_torch
optim_args
: None
adafactor
: False
group_by_length
: False
length_column_name
: length
ddp_find_unused_parameters
: None
ddp_bucket_cap_mb
: None
ddp_broadcast_buffers
: False
dataloader_pin_memory
: True
dataloader_persistent_workers
: False
skip_memory_metrics
: True
use_legacy_prediction_loop
: False
push_to_hub
: False
resume_from_checkpoint
: None
hub_model_id
: None
hub_strategy
: every_save
hub_private_repo
: None
hub_always_push
: False
gradient_checkpointing
: False
gradient_checkpointing_kwargs
: None
include_inputs_for_metrics
: False
include_for_metrics
: []
eval_do_concat_batches
: True
fp16_backend
: auto
push_to_hub_model_id
: None
push_to_hub_organization
: None
mp_parameters
:
auto_find_batch_size
: False
full_determinism
: False
torchdynamo
: None
ray_scope
: last
ddp_timeout
: 1800
torch_compile
: False
torch_compile_backend
: None
torch_compile_mode
: None
include_tokens_per_second
: False
include_num_input_tokens_seen
: False
neftune_noise_alpha
: None
optim_target_modules
: None
batch_eval_metrics
: False
eval_on_start
: False
use_liger_kernel
: False
eval_use_gather_object
: False
average_tokens_across_devices
: False
prompts
: None
batch_sampler
: batch_sampler
multi_dataset_batch_sampler
: round_robin
router_mapping
: {}
learning_rate_mapping
: {}
Training Logs
Click to expand
Epoch
Step
Training Loss
0.0866
500
0.375
0.1732
1000
0.2806
0.2597
1500
0.268
0.3463
2000
0.2511
0.4329
2500
0.2376
0.5195
3000
0.2261
0.6061
3500
0.2264
0.6926
4000
0.2109
0.7792
4500
0.2116
0.8658
5000
0.2054
0.9524
5500
0.1963
1.0390
6000
0.1863
1.1255
6500
0.1716
1.2121
7000
0.1632
1.2987
7500
0.1648
1.3853
8000
0.1628
1.4719
8500
0.1552
1.5584
9000
0.1565
1.6450
9500
0.1557
1.7316
10000
0.1508
1.8182
10500
0.1521
1.9048
11000
0.1409
1.9913
11500
0.1435
2.0779
12000
0.1265
2.1645
12500
0.1268
2.2511
13000
0.1193
2.3377
13500
0.1162
2.4242
14000
0.1209
2.5108
14500
0.1183
2.5974
15000
0.1214
2.6840
15500
0.1203
2.7706
16000
0.1143
2.8571
16500
0.1128
2.9437
17000
0.1158
3.0303
17500
0.101
3.1169
18000
0.0945
3.2035
18500
0.0954
3.2900
19000
0.0936
3.3766
19500
0.095
3.4632
20000
0.0975
3.5498
20500
0.0937
3.6364
21000
0.0961
3.7229
21500
0.0937
3.8095
22000
0.0887
3.8961
22500
0.0864
3.9827
23000
0.0912
4.0693
23500
0.0763
4.1558
24000
0.0761
4.2424
24500
0.0788
4.3290
25000
0.0772
4.4156
25500
0.0784
4.5022
26000
0.078
4.5887
26500
0.078
4.6753
27000
0.0784
4.7619
27500
0.0764
4.8485
28000
0.0715
4.9351
28500
0.0759
5.0216
29000
0.0707
5.1082
29500
0.0712
5.1948
30000
0.0643
5.2814
30500
0.0641
5.3680
31000
0.0656
5.4545
31500
0.0632
5.5411
32000
0.0682
5.6277
32500
0.0612
5.7143
33000
0.0624
5.8009
33500
0.0616
5.8874
34000
0.0606
5.9740
34500
0.0613
6.0606
35000
0.0572
6.1472
35500
0.0551
6.2338
36000
0.0575
6.3203
36500
0.0532
6.4069
37000
0.0554
6.4935
37500
0.051
6.5801
38000
0.0562
6.6667
38500
0.053
6.7532
39000
0.0552
6.8398
39500
0.0535
6.9264
40000
0.0549
7.0130
40500
0.0517
7.0996
41000
0.0453
7.1861
41500
0.0437
7.2727
42000
0.0498
7.3593
42500
0.0507
7.4459
43000
0.0471
7.5325
43500
0.0487
7.6190
44000
0.0477
7.7056
44500
0.0481
7.7922
45000
0.049
7.8788
45500
0.043
7.9654
46000
0.0429
8.0519
46500
0.0457
8.1385
47000
0.0412
8.2251
47500
0.0423
8.3117
48000
0.0409
8.3983
48500
0.0412
8.4848
49000
0.0435
8.5714
49500
0.0437
8.6580
50000
0.043
8.7446
50500
0.0433
8.8312
51000
0.0415
8.9177
51500
0.0407
9.0043
52000
0.0421
9.0909
52500
0.0376
9.1775
53000
0.0411
9.2641
53500
0.0367
9.3506
54000
0.0395
9.4372
54500
0.0398
9.5238
55000
0.0409
9.6104
55500
0.0373
9.6970
56000
0.0402
9.7835
56500
0.0371
9.8701
57000
0.0359
9.9567
57500
0.0376
Framework Versions
Python: 3.9.21
Sentence Transformers: 5.0.0
Transformers: 4.52.4
PyTorch: 2.5.1+cu124
Accelerate: 1.3.0
Datasets: 3.2.0
Tokenizers: 0.21.0
Citation
BibTeX
Sentence Transformers
@inproceedings{reimers-2019-sentence-bert,
title = "Sentence-BERT: Sentence Embeddings using Siamese BERT-Networks",
author = "Reimers, Nils and Gurevych, Iryna",
booktitle = "Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing",
month = "11",
year = "2019",
publisher = "Association for Computational Linguistics",
url = "https://arxiv.org/abs/1908.10084",
}
MultipleNegativesRankingLoss
@misc{henderson2017efficient,
title={Efficient Natural Language Response Suggestion for Smart Reply},
author={Matthew Henderson and Rami Al-Rfou and Brian Strope and Yun-hsuan Sung and Laszlo Lukacs and Ruiqi Guo and Sanjiv Kumar and Balint Miklos and Ray Kurzweil},
year={2017},
eprint={1705.00652},
archivePrefix={arXiv},
primaryClass={cs.CL}
}