Team Ai
Modelpublic

soof/miswag-category-mapper

sourceHugging Faceupdated 6mo agoView on Hugging Face
0likes84downloads
Model Card

SentenceTransformer based on sentence-transformers/paraphrase-multilingual-mpnet-base-v2

This is a sentence-transformers model finetuned from sentence-transformers/paraphrase-multilingual-mpnet-base-v2. 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
  • —Base model: sentence-transformers/paraphrase-multilingual-mpnet-base-v2 <!-- at revision 4328cf26390c98c5e3c738b4460a05b95f4911f5 -->
  • —Maximum Sequence Length: 128 tokens
  • —Output Dimensionality: 768 dimensions
  • —Similarity Function: Cosine Similarity <!-- - Training Dataset: Unknown --> <!-- - Language: Unknown --> <!-- - License: Unknown -->

Model Sources

Full Model Architecture

SentenceTransformer(
  (0): Transformer({'max_seq_length': 128, '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:

bash
pip install -U sentence-transformers

Then you can load this model and run inference.

python
from sentence_transformers import SentenceTransformer

# Download from the 🤗 Hub
model = SentenceTransformer("sentence_transformers_model_id")
# Run inference
sentences = [
    'أطفال | مندالان',
    'Kids | أطفال | مندالان',
    'Kids Footwear | أحذية الأطفال | أحذية الأطفال | Clothes, Shoes & Bags > Shoes > Kids Footwear | ملابس، أحذية وحقائب > أحذية > أحذية الأطفال',
]
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.9686, 0.3404],
#         [0.9686, 1.0000, 0.4502],
#         [0.3404, 0.4502, 1.0000]])

<!--

Direct Usage (Transformers)

<details><summary>Click to see the direct usage in Transformers</summary>

</details> -->

<!--

Downstream Usage (Sentence Transformers)

You can finetune this model on your own dataset.

<details><summary>Click to expand</summary>

</details> -->

<!--

Out-of-Scope Use

List how the model may foreseeably be misused and address what users ought not to do with the model. -->

Evaluation

Metrics

Information Retrieval
MetricValue
cosine_accuracy@10.7724
cosine_accuracy@50.869
cosine_accuracy@100.8858
cosine_precision@10.7724
cosine_precision@30.2833
cosine_precision@50.1738
cosine_precision@100.0886
cosine_recall@10.7724
cosine_recall@30.8499
cosine_recall@50.869
cosine_recall@100.8858
cosine_ndcg@10.7724
cosine_ndcg@50.8263
cosine_ndcg@100.8318
cosine_mrr@10.7724
cosine_mrr@50.8118
cosine_mrr@100.8141
cosine_map@1000.8152

<!--

Bias, Risks and Limitations

What are the known or foreseeable issues stemming from this model? You could also flag here known failure cases or weaknesses of the model. -->

<!--

Recommendations

What are recommendations with respect to the foreseeable issues? For example, filtering explicit content. -->

Training Details

Training Dataset

Unnamed Dataset
  • —Size: 41,454 training samples
  • —Columns: <code>sentence0</code>, <code>sentence1</code>, <code>sentence2</code>, <code>sentence3</code>, <code>sentence4</code>, <code>sentence5</code>, and <code>sentence_6</code>
  • —Approximate statistics based on the first 1000 samples: | | sentence0 | sentence1 | sentence2 | sentence3 | sentence4 | sentence5 | sentence_6 | |:--------|:----------------------------------------------------------------------------------|:----------------------------------------------------------------------------------|:---------------------------------------------------------------------------------|:----------------------------------------------------------------------------------|:-----------------------------------------------------------------------------------|:----------------------------------------------------------------------------------|:-----------------------------------------------------------------------------------| | type | string | string | string | string | string | string | string | | details | <ul><li>min: 5 tokens</li><li>mean: 21.23 tokens</li><li>max: 75 tokens</li></ul> | <ul><li>min: 2 tokens</li><li>mean: 56.88 tokens</li><li>max: 99 tokens</li></ul> | <ul><li>min: 2 tokens</li><li>mean: 57.2 tokens</li><li>max: 95 tokens</li></ul> | <ul><li>min: 2 tokens</li><li>mean: 56.71 tokens</li><li>max: 94 tokens</li></ul> | <ul><li>min: 2 tokens</li><li>mean: 55.42 tokens</li><li>max: 111 tokens</li></ul> | <ul><li>min: 2 tokens</li><li>mean: 56.14 tokens</li><li>max: 92 tokens</li></ul> | <ul><li>min: 2 tokens</li><li>mean: 56.79 tokens</li><li>max: 111 tokens</li></ul> |
  • —Samples: | sentence0 | sentence1 | sentence2 | sentence3 | sentence4 | sentence5 | sentence_6 | |:------------------------------------------------------------------------------------|:--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | <code>فرش تنظيف اللسان \| فرش تنظيف اللسان</code> | <code>Tongue Cleaning Brushes \| فرش تنظيف اللسان \| فرش تنظيف اللسان \| Health & Personal Care > Oral Hygiene > Teeth Cleaning & Care > Tongue Cleaning Brushes \| الصحة والعناية الشخصية > العناية بالفم > مستلزمات التنظيف والعناية بالأسنان > فرش تنظيف اللسان</code> | <code>Lip Care \| العناية بالشفاه \| العناية بالشفاه \| Beauty > Skincare > Lip Care \| الجمال والعناية > عناية بالبشرة > العناية بالشفاه</code> | <code>Oral Hygiene \| العناية بالفم \| العناية بالفم \| Health & Personal Care > Oral Hygiene \| الصحة والعناية الشخصية > العناية بالفم</code> | <code>Lip Liners \| تحديد الشفاه \| تحديد الشفاه \| Beauty > Makeup > Lips Makeup > Lip Liners \| الجمال والعناية > مكياج > مكياج الشفاه > تحديد الشفاه</code> | <code>General Oral Care Products \| منتجات متنوعة \| منتجات متنوعة \| Health & Personal Care > Oral Hygiene > Teeth Cleaning & Care > General Oral Care Products \| الصحة والعناية الشخصية > العناية بالفم > مستلزمات التنظيف والعناية بالأسنان > منتجات متنوعة</code> | <code>Electric Tooth Brushes \| فرش الأسنان الكهربائية \| فرش الأسنان الكهربائية \| Health & Personal Care > Oral Hygiene > Tooth Brushes > Electric Tooth Brushes \| الصحة والعناية الشخصية > العناية بالفم > فرش الأسنان > فرش الأسنان الكهربائية</code> | | <code>بنطلون منسوج بأرجل واسعة وكسرات أمامية Pleated Wide Leg Woven Trousers</code> | <code>Pants \| بناطيل \| Women Fashion > Pants \| ملابس نسائية > بناطيل</code> | <code>Women Jeans \| جينز نسائي \| Women Fashion > Women Jeans \| ملابس نسائية > جينز نسائي</code> | <code>Pants & Skirts \| تنورة وبنطلون نسائي \| تنورة وبنطلون نسائي \| Clothes, Shoes & Bags > Women Clothing > Pants & Skirts \| ملابس، أحذية وحقائب > ملابس نسائية > تنورة وبنطلون نسائي</code> | <code>Panties \| لباس داخلي \| لباس داخلي \| Clothes, Shoes & Bags > Women Clothing > Women Underwear > Panties \| ملابس، أحذية وحقائب > ملابس نسائية > ملابس داخلية نسائية > لباس داخلي</code> | <code>Casual Pants & Sweatpants \| بنطلون قماش \| بنطلون قماش \| Women Fashion > Pants > Casual Pants & Sweatpants \| ملابس نسائية > بناطيل > بنطلون قماش</code> | <code>Night Gown \| دشداشة \| دشداشة \| Women Fashion > Women Home Wear > Night Gown \| ملابس نسائية > ملابس بيت نسائية > دشداشة</code> | | <code>صابون جليسرين الاصلي سيت Original Glycerin Soap Set</code> | <code>Facial Cleansers \| غسولات وصابون الوجه \| غسولات وصابون الوجه \| Beauty > Skincare > Facial Skincare > Facial Cleansers \| الجمال والعناية > عناية بالبشرة > العناية ببشرة الوجه > غسولات وصابون الوجه</code> | <code>Shower Gel \| غسولات الجسم \| غسولات الجسم \| Beauty > Bathing > Bathing & Showering > Shower Gel \| الجمال والعناية > الحمام والإستحمام > الإستحمام > غسولات الجسم</code> | <code>Soap \| صابون \| صابون \| Beauty > Bathing > Bathing & Showering > Soap \| الجمال والعناية > الحمام والإستحمام > الإستحمام > صابون</code> | <code>Skincare Tools \| أدوات العناية ببشرة الوجه \| أدوات العناية ببشرة الوجه \| Beauty > Skincare > Facial Skincare > Skincare Tools \| الجمال والعناية > عناية بالبشرة > العناية ببشرة الوجه > أدوات العناية ببشرة الوجه</code> | <code>Lip Balm \| مرطب \| مرطب \| Beauty > Skincare > Lip Care > Lip Balm \| الجمال والعناية > عناية بالبشرة > العناية بالشفاه > مرطب</code> | <code>Eye Care \| العناية بالعين \| العناية بالعين \| Beauty > Skincare > Eye Care \| الجمال والعناية > عناية بالبشرة > العناية بالعين</code> |
  • —Loss: <code>MultipleNegativesRankingLoss</code> with these parameters:
json
  {
      "scale": 20.0,
      "similarity_fct": "cos_sim",
      "gather_across_devices": false,
      "directions": [
          "query_to_doc"
      ],
      "partition_mode": "joint",
      "hardness_mode": null,
      "hardness_strength": 0.0
  }

Training Hyperparameters

Non-Default Hyperparameters
  • —per_device_train_batch_size: 32
  • —num_train_epochs: 5
  • —per_device_eval_batch_size: 32
  • —multi_dataset_batch_sampler: round_robin
All Hyperparameters

<details><summary>Click to expand</summary>

  • —per_device_train_batch_size: 32
  • —num_train_epochs: 5
  • —max_steps: -1
  • —learning_rate: 5e-05
  • —lr_scheduler_type: linear
  • —lr_scheduler_kwargs: None
  • —warmup_steps: 0
  • —optim: adamwtorchfused
  • —optim_args: None
  • —weight_decay: 0.0
  • —adam_beta1: 0.9
  • —adam_beta2: 0.999
  • —adam_epsilon: 1e-08
  • —optim_target_modules: None
  • —gradient_accumulation_steps: 1
  • —average_tokens_across_devices: True
  • —max_grad_norm: 1
  • —label_smoothing_factor: 0.0
  • —bf16: False
  • —fp16: False
  • —bf16_full_eval: False
  • —fp16_full_eval: False
  • —tf32: None
  • —gradient_checkpointing: False
  • —gradient_checkpointing_kwargs: None
  • —torch_compile: False
  • —torch_compile_backend: None
  • —torch_compile_mode: None
  • —use_liger_kernel: False
  • —liger_kernel_config: None
  • —use_cache: False
  • —neftune_noise_alpha: None
  • —torch_empty_cache_steps: None
  • —auto_find_batch_size: False
  • —log_on_each_node: True
  • —logging_nan_inf_filter: True
  • —include_num_input_tokens_seen: no
  • —log_level: passive
  • —log_level_replica: warning
  • —disable_tqdm: False
  • —project: huggingface
  • —trackio_space_id: trackio
  • —eval_strategy: no
  • —per_device_eval_batch_size: 32
  • —prediction_loss_only: True
  • —eval_on_start: False
  • —eval_do_concat_batches: True
  • —eval_use_gather_object: False
  • —eval_accumulation_steps: None
  • —include_for_metrics: []
  • —batch_eval_metrics: False
  • —save_only_model: False
  • —save_on_each_node: False
  • —enable_jit_checkpoint: False
  • —push_to_hub: False
  • —hub_private_repo: None
  • —hub_model_id: None
  • —hub_strategy: every_save
  • —hub_always_push: False
  • —hub_revision: None
  • —load_best_model_at_end: False
  • —ignore_data_skip: False
  • —restore_callback_states_from_checkpoint: False
  • —full_determinism: False
  • —seed: 42
  • —data_seed: None
  • —use_cpu: False
  • —accelerator_config: {'splitbatches': False, 'dispatchbatches': None, 'evenbatches': True, 'useseedablesampler': True, 'nonblocking': False, 'gradientaccumulationkwargs': None}
  • —parallelism_config: None
  • —dataloader_drop_last: False
  • —dataloader_num_workers: 0
  • —dataloader_pin_memory: True
  • —dataloader_persistent_workers: False
  • —dataloader_prefetch_factor: None
  • —remove_unused_columns: True
  • —label_names: None
  • —train_sampling_strategy: random
  • —length_column_name: length
  • —ddp_find_unused_parameters: None
  • —ddp_bucket_cap_mb: None
  • —ddp_broadcast_buffers: False
  • —ddp_backend: None
  • —ddp_timeout: 1800
  • —fsdp: []
  • —fsdp_config: {'minnumparams': 0, 'xla': False, 'xlafsdpv2': False, 'xlafsdpgrad_ckpt': False}
  • —deepspeed: None
  • —debug: []
  • —skip_memory_metrics: True
  • —do_predict: False
  • —resume_from_checkpoint: None
  • —warmup_ratio: None
  • —local_rank: -1
  • —prompts: None
  • —batch_sampler: batch_sampler
  • —multi_dataset_batch_sampler: round_robin
  • —router_mapping: {}
  • —learning_rate_mapping: {}

</details>

Training Logs

EpochStepTraining Lossval_cosine_ndcg@10
0.38585001.7692-
0.771610001.1953-
1.01296-0.7897
1.157415000.9931-
1.543220000.8773-
1.929025000.8350-
2.02592-0.8176
2.314830000.6935-
2.700635000.6690-
3.03888-0.8264
3.086440000.6284-
3.472245000.5482-
3.858050000.5434-
4.05184-0.8315
4.243855000.5002-
4.629660000.4821-
5.06480-0.8318

Framework Versions

  • —Python: 3.14.3
  • —Sentence Transformers: 5.3.0
  • —Transformers: 5.5.0
  • —PyTorch: 2.11.0+cu130
  • —Accelerate: 1.13.0
  • —Datasets: 4.8.4
  • —Tokenizers: 0.22.2

Citation

BibTeX

Sentence Transformers
bibtex
@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
bibtex
@misc{oord2019representationlearningcontrastivepredictive,
      title={Representation Learning with Contrastive Predictive Coding},
      author={Aaron van den Oord and Yazhe Li and Oriol Vinyals},
      year={2019},
      eprint={1807.03748},
      archivePrefix={arXiv},
      primaryClass={cs.LG},
      url={https://arxiv.org/abs/1807.03748},
}

<!--

Glossary

Clearly define terms in order to be accessible across audiences. -->

<!--

Model Card Authors

Lists the people who create the model card, providing recognition and accountability for the detailed work that goes into its construction. -->

<!--

Model Card Contact

Provides a way for people who have updates to the Model Card, suggestions, or questions, to contact the Model Card authors. -->