nace-pl-v2 / README.md
annazdr's picture
Add new SentenceTransformer model.
d2bbe26 verified
metadata
language: []
library_name: sentence-transformers
tags:
  - sentence-transformers
  - sentence-similarity
  - feature-extraction
  - generated_from_trainer
  - dataset_size:12822
  - loss:BatchAllTripletLoss
base_model: sentence-transformers/paraphrase-multilingual-MiniLM-L12-v2
datasets: []
widget:
  - source_sentence: parcel-packing and gift-wrapping
    sentences:
      - retail sale of cleaning products, e
      - cafeterias
      - ' '
  - source_sentence: Sprzedaż detaliczna mięsa i wyrobów z mięsa
    sentences:
      - ' '
      - ' revenues from sale of advertising space'
      - g
  - source_sentence: g
    sentences:
      - >-
        installation of the system and provision of training and support to
        users of the system- activities of auditing and certification of
        computing and data processing infrastructures and services
      - ' revenues from sale of advertising space'
      - 47.75 Retail sale of cosmetic and toilet articles
  - source_sentence: lighterage, salvage activities
    sentences:
      - hairstyling
      - ' this class also includes:  cladding of metal pipes with plastics'
      - usługi pośrednictwa w zakresie transportu pasażerskiego
  - source_sentence: manufacture of glass mirrors
    sentences:
      - manufacture of electroplating machinery
      - ' protective face shields/visors, of plastics, e'
      - cow peas
pipeline_tag: sentence-similarity

SentenceTransformer based on sentence-transformers/paraphrase-multilingual-MiniLM-L12-v2

This is a sentence-transformers model finetuned from sentence-transformers/paraphrase-multilingual-MiniLM-L12-v2. It maps sentences & paragraphs to a 384-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 Sources

Full Model Architecture

SentenceTransformer(
  (0): Transformer({'max_seq_length': 128, 'do_lower_case': False}) with Transformer model: BertModel 
  (1): Pooling({'word_embedding_dimension': 384, '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("annazdr/nace-pl-v2")
# Run inference
sentences = [
    'manufacture of glass mirrors',
    ' protective face shields/visors, of plastics, e',
    'manufacture of electroplating machinery',
]
embeddings = model.encode(sentences)
print(embeddings.shape)
# [3, 384]

# Get the similarity scores for the embeddings
similarities = model.similarity(embeddings, embeddings)
print(similarities.shape)
# [3, 3]

Training Details

Training Dataset

Unnamed Dataset

  • Size: 12,822 training samples
  • Columns: sentence_0 and label
  • Approximate statistics based on the first 1000 samples:
    sentence_0 label
    type string int
    details
    • min: 2 tokens
    • mean: 15.14 tokens
    • max: 128 tokens
    • 0: ~0.20%
    • 1: ~0.10%
    • 2: ~0.20%
    • 4: ~0.30%
    • 5: ~0.10%
    • 6: ~0.10%
    • 7: ~0.40%
    • 9: ~0.10%
    • 10: ~0.60%
    • 11: ~0.20%
    • 12: ~0.30%
    • 13: ~0.30%
    • 14: ~0.10%
    • 15: ~0.10%
    • 16: ~0.40%
    • 17: ~0.10%
    • 18: ~0.40%
    • 20: ~0.40%
    • 22: ~0.30%
    • 23: ~0.30%
    • 24: ~0.30%
    • 25: ~0.40%
    • 27: ~0.20%
    • 28: ~0.10%
    • 30: ~0.10%
    • 32: ~0.10%
    • 33: ~0.20%
    • 34: ~0.10%
    • 35: ~0.30%
    • 37: ~0.30%
    • 38: ~0.30%
    • 39: ~0.30%
    • 41: ~0.20%
    • 42: ~0.10%
    • 43: ~0.20%
    • 44: ~0.50%
    • 46: ~0.10%
    • 48: ~0.20%
    • 49: ~0.30%
    • 50: ~0.30%
    • 51: ~0.20%
    • 52: ~0.40%
    • 53: ~0.30%
    • 54: ~0.20%
    • 55: ~0.20%
    • 56: ~0.20%
    • 58: ~0.20%
    • 59: ~0.10%
    • 60: ~0.30%
    • 61: ~0.20%
    • 63: ~0.40%
    • 64: ~0.30%
    • 65: ~0.10%
    • 66: ~0.70%
    • 68: ~0.10%
    • 69: ~0.20%
    • 70: ~0.50%
    • 71: ~0.30%
    • 72: ~0.10%
    • 73: ~0.40%
    • 74: ~0.20%
    • 75: ~0.30%
    • 76: ~0.20%
    • 78: ~0.10%
    • 79: ~0.10%
    • 80: ~0.10%
    • 81: ~0.30%
    • 82: ~0.30%
    • 83: ~0.30%
    • 84: ~0.10%
    • 85: ~0.20%
    • 86: ~0.20%
    • 89: ~0.10%
    • 90: ~0.10%
    • 91: ~0.30%
    • 92: ~0.20%
    • 93: ~0.10%
    • 94: ~0.30%
    • 95: ~0.20%
    • 96: ~0.20%
    • 97: ~0.40%
    • 98: ~0.70%
    • 99: ~0.20%
    • 100: ~0.50%
    • 101: ~0.20%
    • 102: ~0.10%
    • 103: ~0.10%
    • 104: ~0.20%
    • 106: ~0.10%
    • 108: ~0.20%
    • 110: ~0.10%
    • 111: ~0.10%
    • 112: ~0.20%
    • 115: ~0.10%
    • 116: ~0.10%
    • 119: ~0.30%
    • 120: ~0.10%
    • 121: ~0.20%
    • 123: ~0.10%
    • 125: ~0.20%
    • 126: ~0.10%
    • 127: ~0.20%
    • 128: ~0.40%
    • 130: ~0.20%
    • 134: ~0.10%
    • 135: ~0.10%
    • 136: ~0.10%
    • 138: ~0.10%
    • 139: ~0.10%
    • 140: ~0.20%
    • 141: ~0.10%
    • 142: ~0.10%
    • 143: ~0.40%
    • 144: ~0.10%
    • 148: ~0.10%
    • 149: ~0.10%
    • 150: ~0.30%
    • 151: ~0.10%
    • 152: ~0.30%
    • 153: ~0.40%
    • 154: ~0.50%
    • 156: ~0.10%
    • 157: ~0.30%
    • 158: ~0.20%
    • 159: ~0.30%
    • 160: ~0.10%
    • 161: ~0.10%
    • 162: ~0.10%
    • 163: ~0.10%
    • 165: ~0.10%
    • 166: ~0.20%
    • 167: ~0.20%
    • 168: ~0.20%
    • 170: ~0.10%
    • 171: ~0.10%
    • 172: ~0.10%
    • 173: ~0.10%
    • 174: ~0.20%
    • 176: ~0.20%
    • 178: ~0.10%
    • 179: ~0.10%
    • 181: ~0.10%
    • 182: ~0.30%
    • 183: ~0.30%
    • 184: ~0.20%
    • 185: ~0.30%
    • 186: ~0.40%
    • 187: ~0.20%
    • 188: ~0.40%
    • 189: ~0.20%
    • 190: ~0.50%
    • 191: ~0.30%
    • 192: ~0.40%
    • 193: ~0.10%
    • 196: ~0.20%
    • 197: ~0.20%
    • 198: ~0.30%
    • 199: ~0.60%
    • 200: ~0.50%
    • 201: ~0.10%
    • 202: ~0.10%
    • 203: ~0.30%
    • 204: ~0.10%
    • 205: ~0.30%
    • 206: ~0.40%
    • 208: ~0.20%
    • 210: ~0.20%
    • 211: ~0.40%
    • 212: ~0.20%
    • 214: ~0.30%
    • 215: ~0.10%
    • 217: ~0.30%
    • 218: ~0.20%
    • 220: ~0.30%
    • 221: ~0.10%
    • 222: ~0.20%
    • 223: ~0.10%
    • 225: ~0.10%
    • 226: ~0.10%
    • 227: ~0.20%
    • 228: ~0.10%
    • 230: ~0.10%
    • 231: ~0.30%
    • 233: ~0.10%
    • 234: ~0.10%
    • 235: ~0.20%
    • 236: ~0.20%
    • 237: ~0.20%
    • 238: ~0.30%
    • 239: ~0.10%
    • 240: ~0.10%
    • 241: ~0.20%
    • 242: ~0.10%
    • 243: ~0.40%
    • 244: ~0.40%
    • 245: ~0.20%
    • 246: ~0.20%
    • 247: ~0.30%
    • 248: ~0.20%
    • 249: ~0.20%
    • 250: ~0.10%
    • 253: ~0.30%
    • 254: ~0.50%
    • 255: ~0.30%
    • 256: ~0.20%
    • 257: ~0.20%
    • 258: ~0.20%
    • 259: ~0.10%
    • 260: ~0.60%
    • 261: ~0.10%
    • 262: ~0.10%
    • 264: ~0.30%
    • 266: ~0.10%
    • 267: ~0.10%
    • 269: ~0.20%
    • 271: ~0.10%
    • 272: ~0.10%
    • 273: ~0.10%
    • 274: ~0.40%
    • 275: ~0.10%
    • 276: ~0.30%
    • 277: ~0.20%
    • 278: ~0.10%
    • 279: ~0.20%
    • 281: ~0.10%
    • 283: ~0.40%
    • 284: ~0.10%
    • 285: ~0.20%
    • 286: ~0.10%
    • 287: ~0.20%
    • 289: ~0.20%
    • 290: ~0.20%
    • 291: ~0.20%
    • 292: ~0.30%
    • 293: ~0.20%
    • 294: ~0.20%
    • 295: ~0.40%
    • 296: ~0.20%
    • 297: ~0.20%
    • 298: ~0.10%
    • 302: ~0.10%
    • 303: ~0.10%
    • 306: ~0.60%
    • 307: ~0.50%
    • 310: ~0.40%
    • 311: ~0.40%
    • 313: ~0.10%
    • 314: ~0.40%
    • 316: ~0.10%
    • 319: ~0.20%
    • 320: ~0.10%
    • 322: ~0.50%
    • 324: ~0.20%
    • 325: ~0.30%
    • 326: ~0.30%
    • 327: ~0.10%
    • 328: ~0.10%
    • 329: ~0.10%
    • 330: ~0.10%
    • 331: ~0.10%
    • 332: ~0.20%
    • 334: ~0.10%
    • 336: ~0.30%
    • 337: ~0.50%
    • 338: ~0.10%
    • 341: ~0.10%
    • 343: ~0.10%
    • 344: ~0.20%
    • 347: ~0.20%
    • 348: ~0.10%
    • 349: ~0.10%
    • 350: ~0.50%
    • 351: ~0.70%
    • 352: ~0.20%
    • 353: ~0.10%
    • 354: ~0.20%
    • 355: ~0.10%
    • 356: ~0.10%
    • 357: ~0.20%
    • 358: ~0.30%
    • 359: ~0.10%
    • 360: ~0.20%
    • 361: ~0.30%
    • 362: ~0.10%
    • 363: ~0.10%
    • 364: ~0.10%
    • 365: ~0.30%
    • 368: ~0.30%
    • 369: ~0.20%
    • 372: ~0.30%
    • 373: ~0.10%
    • 374: ~0.30%
    • 375: ~0.70%
    • 376: ~0.10%
    • 377: ~0.20%
    • 378: ~0.20%
    • 380: ~0.10%
    • 381: ~0.10%
    • 382: ~0.20%
    • 383: ~0.10%
    • 385: ~0.20%
    • 393: ~0.10%
    • 394: ~0.10%
    • 395: ~0.20%
    • 396: ~0.30%
    • 398: ~0.10%
    • 399: ~0.20%
    • 401: ~0.20%
    • 402: ~0.20%
    • 404: ~0.40%
    • 405: ~0.10%
    • 407: ~0.20%
    • 409: ~0.20%
    • 410: ~0.10%
    • 411: ~0.10%
    • 412: ~0.10%
    • 413: ~0.20%
    • 414: ~0.20%
    • 415: ~0.10%
    • 416: ~0.10%
    • 417: ~0.10%
    • 418: ~0.10%
    • 419: ~0.20%
    • 420: ~0.10%
    • 421: ~0.20%
    • 423: ~0.30%
    • 424: ~0.10%
    • 425: ~0.10%
    • 427: ~0.20%
    • 428: ~0.10%
    • 429: ~0.10%
    • 430: ~0.10%
    • 432: ~0.10%
    • 434: ~0.10%
    • 435: ~0.40%
    • 436: ~0.20%
    • 437: ~0.30%
    • 438: ~0.20%
    • 440: ~0.20%
    • 441: ~0.30%
    • 442: ~0.20%
    • 443: ~0.10%
    • 444: ~0.30%
    • 445: ~0.20%
    • 446: ~0.20%
    • 448: ~0.20%
    • 449: ~0.30%
    • 451: ~0.20%
    • 452: ~0.10%
    • 454: ~0.20%
    • 455: ~0.20%
    • 456: ~0.10%
    • 458: ~0.30%
    • 459: ~0.10%
    • 460: ~0.10%
    • 462: ~0.10%
    • 463: ~0.40%
    • 464: ~0.10%
    • 465: ~0.20%
    • 466: ~0.10%
    • 467: ~0.40%
    • 468: ~0.10%
    • 469: ~0.30%
    • 471: ~0.10%
    • 475: ~0.30%
    • 476: ~0.50%
    • 477: ~0.10%
    • 479: ~0.40%
    • 480: ~0.30%
    • 482: ~0.10%
    • 483: ~0.30%
    • 484: ~0.10%
    • 485: ~0.20%
    • 486: ~0.10%
    • 487: ~0.10%
    • 490: ~0.30%
    • 491: ~0.40%
    • 492: ~0.40%
    • 493: ~0.10%
    • 494: ~0.10%
    • 495: ~0.10%
    • 498: ~0.20%
    • 499: ~0.40%
    • 500: ~0.30%
    • 501: ~0.30%
    • 502: ~0.30%
    • 504: ~0.20%
    • 505: ~0.20%
    • 506: ~0.10%
    • 507: ~0.20%
    • 508: ~0.10%
    • 511: ~0.10%
    • 512: ~0.60%
    • 513: ~0.10%
    • 515: ~0.10%
    • 516: ~0.30%
    • 517: ~0.40%
    • 519: ~0.30%
    • 520: ~0.30%
    • 521: ~0.10%
    • 522: ~0.20%
    • 523: ~0.10%
    • 524: ~0.50%
    • 525: ~0.60%
    • 527: ~0.20%
    • 528: ~0.10%
    • 530: ~0.10%
    • 533: ~0.40%
    • 534: ~0.50%
    • 535: ~0.40%
    • 536: ~0.10%
    • 537: ~0.20%
    • 538: ~0.40%
    • 539: ~0.10%
    • 540: ~0.10%
    • 542: ~0.30%
    • 543: ~0.10%
    • 544: ~0.10%
    • 545: ~0.20%
    • 546: ~0.20%
    • 548: ~0.20%
    • 549: ~0.20%
    • 550: ~0.30%
    • 551: ~0.30%
    • 552: ~0.10%
    • 554: ~0.10%
    • 555: ~0.20%
    • 557: ~0.20%
    • 560: ~0.10%
    • 561: ~0.20%
    • 562: ~0.10%
    • 564: ~0.40%
    • 565: ~0.10%
    • 566: ~0.10%
    • 567: ~0.20%
    • 570: ~0.10%
    • 572: ~0.30%
    • 573: ~0.10%
    • 574: ~0.10%
    • 575: ~0.10%
    • 576: ~0.10%
    • 577: ~0.20%
    • 578: ~0.50%
    • 579: ~0.40%
    • 581: ~0.20%
    • 585: ~0.40%
    • 586: ~0.10%
    • 587: ~0.20%
    • 588: ~0.20%
    • 590: ~0.20%
    • 592: ~0.10%
    • 595: ~0.10%
    • 597: ~0.20%
    • 600: ~0.10%
    • 601: ~0.10%
    • 603: ~0.10%
    • 604: ~0.10%
    • 608: ~0.10%
    • 611: ~0.10%
    • 612: ~0.20%
    • 613: ~0.10%
    • 619: ~0.20%
    • 620: ~0.20%
    • 622: ~0.10%
    • 625: ~0.20%
    • 629: ~0.10%
    • 631: ~0.20%
    • 632: ~0.10%
    • 633: ~0.20%
    • 634: ~0.10%
    • 635: ~0.40%
    • 640: ~0.10%
    • 643: ~0.10%
    • 645: ~0.10%
    • 648: ~0.10%
  • Samples:
    sentence_0 label
    swimming clubs 475
    581
    this class includes: mining of ores valued chiefly for iron content 351
  • Loss: BatchAllTripletLoss

Training Hyperparameters

Non-Default Hyperparameters

  • per_device_train_batch_size: 256
  • per_device_eval_batch_size: 256
  • num_train_epochs: 4
  • 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: 256
  • per_device_eval_batch_size: 256
  • per_gpu_train_batch_size: None
  • per_gpu_eval_batch_size: None
  • gradient_accumulation_steps: 1
  • eval_accumulation_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: 4
  • 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: False
  • hub_always_push: False
  • gradient_checkpointing: False
  • gradient_checkpointing_kwargs: None
  • include_inputs_for_metrics: False
  • 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
  • dispatch_batches: None
  • split_batches: None
  • include_tokens_per_second: False
  • include_num_input_tokens_seen: False
  • neftune_noise_alpha: None
  • optim_target_modules: None
  • batch_eval_metrics: False
  • batch_sampler: batch_sampler
  • multi_dataset_batch_sampler: round_robin

Framework Versions

  • Python: 3.10.12
  • Sentence Transformers: 3.0.1
  • Transformers: 4.41.2
  • PyTorch: 2.3.0+cu121
  • Accelerate: 0.31.0
  • Datasets: 2.20.0
  • Tokenizers: 0.19.1

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",
}

BatchAllTripletLoss

@misc{hermans2017defense,
    title={In Defense of the Triplet Loss for Person Re-Identification}, 
    author={Alexander Hermans and Lucas Beyer and Bastian Leibe},
    year={2017},
    eprint={1703.07737},
    archivePrefix={arXiv},
    primaryClass={cs.CV}
}