Views
No views yet
SentenceTransformer(
(0): Transformer({'max_seq_length': 128, 'do_lower_case': False}) with Transformer model: 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})
)pip install -U sentence-transformers1from sentence_transformers import SentenceTransformer
2
3# Download from the 🤗 Hub
4model = SentenceTransformer("Fatoumataa/embedding_billingue_francais_bambara1")
5# Run inference
6sentences = [
7 'expliquez le rôle du contrat social selon john locke.',
8 "pour locke, le contrat social est un accord par lequel les individus sortent de l'état de nature pour protéger leurs droits naturels et établir un gouvernement limité. il fonde la société civile.",
9 'protection des droits naturels,le contrat social sert à rendre le peuple entièrement soumis à un souverain absolu. (locke défend un gouvernement limité, pas une soumission absolue comme hobbes).',
10]
11embeddings = model.encode(sentences)
12print(embeddings.shape)
13# [3, 768]
14
15# Get the similarity scores for the embeddings
16similarities = model.similarity(embeddings, embeddings)
17print(similarities.shape)
18# [3, 3]bambara_evalInformationRetrievalEvaluator| Metric | Value |
|---|---|
| cosine_accuracy@1 | 0.875 |
| cosine_accuracy@3 | 0.965 |
| cosine_accuracy@5 | 0.98 |
| cosine_accuracy@10 | 0.985 |
| cosine_precision@3 | 0.3217 |
| cosine_precision@5 | 0.196 |
| cosine_precision@10 | 0.0985 |
| cosine_recall@3 | 0.965 |
| cosine_recall@5 | 0.98 |
| cosine_recall@10 | 0.985 |
| cosine_ndcg@10 | 0.937 |
| cosine_mrr@10 | 0.9208 |
| cosine_map@100 | 0.9218 |
bambara_evalInformationRetrievalEvaluator| Metric | Value |
|---|---|
| cosine_accuracy@1 | 0.755 |
| cosine_accuracy@3 | 0.95 |
| cosine_accuracy@5 | 0.965 |
| cosine_accuracy@10 | 0.98 |
| cosine_precision@3 | 0.3167 |
| cosine_precision@5 | 0.193 |
| cosine_precision@10 | 0.098 |
| cosine_recall@3 | 0.95 |
| cosine_recall@5 | 0.965 |
| cosine_recall@10 | 0.98 |
| cosine_ndcg@10 | 0.8822 |
| cosine_mrr@10 | 0.8492 |
| cosine_map@100 | 0.8503 |
anchor, positive, negative, and label| anchor | positive | negative | label | |
|---|---|---|---|---|
| type | string | string | string | float |
| details |
|
|
|
|
| anchor | positive | negative | label |
|---|---|---|---|
quel instrument de musique traditionnel malien est une sorte de harpe-luth à 21 cordes, emblématique des griots ? | kora ye mali laadala fɔlifɛn ye min bɛ fɔ ni juru 21 ye, griotw bɛ baara kɛ ni a ye kosɛbɛ walasa ka fara u ka maanaw ni dɔnkiliw kan. | le balafon est la harpe-luth à 21 cordes. (confusion avec un xylophone africain). | 1.0 |
fɛn jumɛnw tun bɛ mali mansamara ka jago siratigɛ la? | les principaux produits échangés dans l'mansaya du mali étaient l'or, le sel, et les esclaves, complétés par des produits locaux comme le kola, le tissu et les céréales. | victor hugo tun ye faransi kanuya sɛbɛnnikɛla ŋana ye. 'les misérables' ye a ka baara tɔgɔba dɔ ye, gafe min bɛ sigida ka tɔɔrɔ jira. | 1.0 |
calcule le double de 9. | 18. sabula 9 siɲɛ fila ye 18 ye. | 24. erreur fréquente dans le calcul de double. | 1.0 |
MultipleNegativesRankingLoss with these parameters:
1{
2 "scale": 20.0,
3 "similarity_fct": "cos_sim"
4}anchor, positive, negative, and label| anchor | positive | negative | label | |
|---|---|---|---|---|
| type | string | string | string | float |
| details |
|
|
|
|
| anchor | positive | negative | label |
|---|---|---|---|
kɔrɔfɔli bɛ dɛmɛ jumɛn don seko ni dɔnko faamuyali la ? | la critique d'art offre des perspectives d'analyse, éclaire le contexte, et propose des interprétations, aidant ainsi le public à approfondir sa compréhension et son appréciation des œuvres. | tifoyidi bɛ sɔrɔ kosɛbɛ ji walima dumuni dunni fɛ min nɔgɔlen don banakisɛ bɛ mɔgɔ min na, o ka banakɔtaa fɛ. banakunbɛnni ye ji minta, bolo saniya ani dumuni tobili ye. | 1.0 |
polifoni ye mun ye fɔli la? | la polyphonie est une technique de composition où plusieurs mélodies indépendantes sont jouées simultanément. elle crée une richesse harmonique. | mali la, waati jiginni bɛ kɛ sababu ye ka ja waati janw ni sanjiw kɛ minnu tɛ kɛ tuma bɛɛ. o bɛ suman tigɛ dɔgɔya ani ka sɛnɛ bila farati la. a ka gɛlɛn sɛnɛkɛlaw ma. | 1.0 |
quelles sont les habitudes à adopter pour améliorer la qualité de son sommeil ? | walasa ka sunɔgɔ ɲuman sɔrɔ, aw ka kan ka sunɔgɔcogo dɔ sigi sen kan tuma bɛɛ, ka aw yɛrɛ tanga ɛkranw ma sani aw ka sunɔgɔ, ka dibi ni lafiya sigida dilan, ani ka farikoloɲɛnajɛ kɛ tile fɛ. aw bɛ aw yɛrɛ tanga kafeyin ma wula fɛ, o fana nafa ka bon. | manger une grande quantité de nourriture juste avant de dormir. (cela peut perturber la digestion et le sommeil, c'est une mauvaise habitude, erreur conceptuelle). | 1.0 |
MultipleNegativesRankingLoss with these parameters:
1{
2 "scale": 20.0,
3 "similarity_fct": "cos_sim"
4}eval_strategy: stepsper_device_train_batch_size: 16per_device_eval_batch_size: 32learning_rate: 1e-05weight_decay: 0.01num_train_epochs: 8warmup_ratio: 0.1fp16: Trueload_best_model_at_end: Trueoverwrite_output_dir: Falsedo_predict: Falseeval_strategy: stepsprediction_loss_only: Trueper_device_train_batch_size: 16per_device_eval_batch_size: 32per_gpu_train_batch_size: Noneper_gpu_eval_batch_size: Nonegradient_accumulation_steps: 1eval_accumulation_steps: Nonetorch_empty_cache_steps: Nonelearning_rate: 1e-05weight_decay: 0.01adam_beta1: 0.9adam_beta2: 0.999adam_epsilon: 1e-08max_grad_norm: 1.0num_train_epochs: 8max_steps: -1lr_scheduler_type: linearlr_scheduler_kwargs: {}warmup_ratio: 0.1warmup_steps: 0log_level: passivelog_level_replica: warninglog_on_each_node: Truelogging_nan_inf_filter: Truesave_safetensors: Truesave_on_each_node: Falsesave_only_model: Falserestore_callback_states_from_checkpoint: Falseno_cuda: Falseuse_cpu: Falseuse_mps_device: Falseseed: 42data_seed: Nonejit_mode_eval: Falseuse_ipex: Falsebf16: Falsefp16: Truefp16_opt_level: O1half_precision_backend: autobf16_full_eval: Falsefp16_full_eval: Falsetf32: Nonelocal_rank: 0ddp_backend: Nonetpu_num_cores: Nonetpu_metrics_debug: Falsedebug: []dataloader_drop_last: Falsedataloader_num_workers: 0dataloader_prefetch_factor: Nonepast_index: -1disable_tqdm: Falseremove_unused_columns: Truelabel_names: Noneload_best_model_at_end: Trueignore_data_skip: Falsefsdp: []fsdp_min_num_params: 0fsdp_config: {'min_num_params': 0, 'xla': False, 'xla_fsdp_v2': False, 'xla_fsdp_grad_ckpt': False}fsdp_transformer_layer_cls_to_wrap: Noneaccelerator_config: {'split_batches': False, 'dispatch_batches': None, 'even_batches': True, 'use_seedable_sampler': True, 'non_blocking': False, 'gradient_accumulation_kwargs': None}deepspeed: Nonelabel_smoothing_factor: 0.0optim: adamw_torchoptim_args: Noneadafactor: Falsegroup_by_length: Falselength_column_name: lengthddp_find_unused_parameters: Noneddp_bucket_cap_mb: Noneddp_broadcast_buffers: Falsedataloader_pin_memory: Truedataloader_persistent_workers: Falseskip_memory_metrics: Trueuse_legacy_prediction_loop: Falsepush_to_hub: Falseresume_from_checkpoint: Nonehub_model_id: Nonehub_strategy: every_savehub_private_repo: Nonehub_always_push: Falsehub_revision: Nonegradient_checkpointing: Falsegradient_checkpointing_kwargs: Noneinclude_inputs_for_metrics: Falseinclude_for_metrics: []eval_do_concat_batches: Truefp16_backend: autopush_to_hub_model_id: Nonepush_to_hub_organization: Nonemp_parameters:auto_find_batch_size: Falsefull_determinism: Falsetorchdynamo: Noneray_scope: lastddp_timeout: 1800torch_compile: Falsetorch_compile_backend: Nonetorch_compile_mode: Noneinclude_tokens_per_second: Falseinclude_num_input_tokens_seen: Falseneftune_noise_alpha: Noneoptim_target_modules: Nonebatch_eval_metrics: Falseeval_on_start: Falseuse_liger_kernel: Falseliger_kernel_config: Noneeval_use_gather_object: Falseaverage_tokens_across_devices: Falseprompts: Nonebatch_sampler: batch_samplermulti_dataset_batch_sampler: proportional| Epoch | Step | Training Loss | Validation Loss | bambara_eval_cosine_ndcg@10 |
|---|---|---|---|---|
| 0.2475 | 50 | 1.0849 | - | - |
| 0.4950 | 100 | 0.5428 | 0.5113 | 0.8522 |
| 0.7426 | 150 | 0.2423 | - | - |
| 0.9901 | 200 | 0.2538 | 0.2678 | 0.8872 |
| 1.2376 | 250 | 0.1232 | - | - |
| 1.4851 | 300 | 0.103 | 0.2104 | 0.9165 |
| 1.7327 | 350 | 0.0991 | - | - |
| 1.9802 | 400 | 0.1284 | 0.1878 | 0.9181 |
| 2.2277 | 450 | 0.0427 | - | - |
| 2.4752 | 500 | 0.0311 | 0.1282 | 0.9205 |
| 2.7228 | 550 | 0.0514 | - | - |
| 2.9703 | 600 | 0.0778 | 0.1101 | 0.9370 |
| 3.2178 | 650 | 0.0233 | - | - |
| 3.4653 | 700 | 0.0298 | 0.1158 | 0.9408 |
| 3.7129 | 750 | 0.0298 | - | - |
| 3.9604 | 800 | 0.0163 | 0.1134 | 0.9366 |
| 4.2079 | 850 | 0.0238 | - | - |
| 4.4554 | 900 | 0.0155 | 0.1225 | 0.9387 |
| 4.7030 | 950 | 0.0219 | - | - |
| 4.9505 | 1000 | 0.0095 | 0.1049 | 0.9376 |
| -1 | -1 | - | - | 0.9370 |
| 0.2475 | 50 | 3.2372 | - | - |
| 0.4950 | 100 | 2.0213 | 2.1683 | 0.4056 |
| 0.7426 | 150 | 1.3029 | - | - |
| 0.9901 | 200 | 0.844 | 0.9643 | 0.5978 |
| 1.2376 | 250 | 0.5074 | - | - |
| 1.4851 | 300 | 0.3533 | 0.5925 | 0.7219 |
| 1.7327 | 350 | 0.3124 | - | - |
| 1.9802 | 400 | 0.243 | 0.4317 | 0.8044 |
| 2.2277 | 450 | 0.143 | - | - |
| 2.4752 | 500 | 0.1499 | 0.3547 | 0.8294 |
| 2.7228 | 550 | 0.1366 | - | - |
| 2.9703 | 600 | 0.1302 | 0.2870 | 0.8478 |
| 3.2178 | 650 | 0.0999 | - | - |
| 3.4653 | 700 | 0.0805 | 0.2736 | 0.8403 |
| 3.7129 | 750 | 0.0606 | - | - |
| 3.9604 | 800 | 0.073 | 0.2396 | 0.8666 |
| 4.2079 | 850 | 0.0515 | - | - |
| 4.4554 | 900 | 0.0451 | 0.2285 | 0.8709 |
| 4.7030 | 950 | 0.0591 | - | - |
| 4.9505 | 1000 | 0.05 | 0.2258 | 0.8707 |
| 5.1980 | 1050 | 0.0435 | - | - |
| 5.4455 | 1100 | 0.059 | 0.2192 | 0.8722 |
| 5.6931 | 1150 | 0.0496 | - | - |
| 5.9406 | 1200 | 0.0408 | 0.2132 | 0.8724 |
| 6.1881 | 1250 | 0.0491 | - | - |
| 6.4356 | 1300 | 0.038 | 0.2060 | 0.8783 |
| 6.6832 | 1350 | 0.032 | - | - |
| 6.9307 | 1400 | 0.0385 | 0.1998 | 0.8822 |
| 7.1782 | 1450 | 0.0363 | - | - |
| 7.4257 | 1500 | 0.0349 | 0.1982 | 0.8750 |
| 7.6733 | 1550 | 0.038 | - | - |
| 7.9208 | 1600 | 0.0523 | 0.1944 | 0.8753 |
| -1 | -1 | - | - | 0.8822 |
1@inproceedings{reimers-2019-sentence-bert,
2 title = "Sentence-BERT: Sentence Embeddings using Siamese BERT-Networks",
3 author = "Reimers, Nils and Gurevych, Iryna",
4 booktitle = "Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing",
5 month = "11",
6 year = "2019",
7 publisher = "Association for Computational Linguistics",
8 url = "https://arxiv.org/abs/1908.10084",
9}1@misc{henderson2017efficient,
2 title={Efficient Natural Language Response Suggestion for Smart Reply},
3 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},
4 year={2017},
5 eprint={1705.00652},
6 archivePrefix={arXiv},
7 primaryClass={cs.CL}
8}