SentenceTransformer based on Almawave/Velvet-2B

This is a sentence-transformers model finetuned from Almawave/Velvet-2B. It maps sentences & paragraphs to a 2048-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: Almawave/Velvet-2B
  • Maximum Sequence Length: 32768 tokens
  • Output Dimensionality: 2048 dimensions
  • Similarity Function: Cosine Similarity

Model Sources

Full Model Architecture

SentenceTransformer(
  (0): Transformer({'max_seq_length': 32768, 'do_lower_case': False}) with Transformer model: MistralModel 
  (1): Pooling({'word_embedding_dimension': 2048, 'pooling_mode_cls_token': False, 'pooling_mode_mean_tokens': False, 'pooling_mode_max_tokens': False, 'pooling_mode_mean_sqrt_len_tokens': False, 'pooling_mode_weightedmean_tokens': False, 'pooling_mode_lasttoken': True, 'include_prompt': True})
  (2): Normalize()
)

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("ancc/Velvet-2B-embedding-news")
# Run inference
sentences = [
    "NBA, dopo l’addio a Schroeder i Nets promuovono Simmons in quintetto: l'idea è correre",
    'Italia Viva e +Europa non parteciperanno alle elezioni regionali in Liguria',
    'Achille Costacurta rivela: «Sono stato rinchiuso per un anno e sette mesi in un centro penale',
]
embeddings = model.encode(sentences)
print(embeddings.shape)
# [3, 2048]

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

Evaluation

Metrics

Paraphrase Mining

Metric Value
average_precision 0.5284
f1 0.5502
precision 0.5568
recall 0.5439
threshold 0.931

Training Details

Training Dataset

Unnamed Dataset

  • Size: 152,913 training samples
  • Columns: sentence and label
  • Approximate statistics based on the first 1000 samples:
    sentence label
    type string int
    details
    • min: 3 tokens
    • mean: 19.14 tokens
    • max: 47 tokens
    • 0: ~0.50%
    • 1: ~0.50%
    • 2: ~0.50%
    • 3: ~0.50%
    • 4: ~0.50%
    • 5: ~0.20%
    • 6: ~0.50%
    • 7: ~0.50%
    • 8: ~0.20%
    • 9: ~0.50%
    • 11: ~0.50%
    • 12: ~0.50%
    • 13: ~0.50%
    • 15: ~0.50%
    • 16: ~0.20%
    • 17: ~0.30%
    • 18: ~0.50%
    • 19: ~0.40%
    • 20: ~0.50%
    • 21: ~0.50%
    • 22: ~0.30%
    • 23: ~0.50%
    • 24: ~0.50%
    • 25: ~0.50%
    • 26: ~0.50%
    • 27: ~0.50%
    • 28: ~0.40%
    • 29: ~0.50%
    • 30: ~0.20%
    • 31: ~0.30%
    • 32: ~0.40%
    • 33: ~0.50%
    • 34: ~0.50%
    • 36: ~0.50%
    • 38: ~0.50%
    • 39: ~0.50%
    • 40: ~0.30%
    • 41: ~0.20%
    • 43: ~0.50%
    • 44: ~0.50%
    • 45: ~0.50%
    • 46: ~0.40%
    • 47: ~0.30%
    • 48: ~0.30%
    • 49: ~0.50%
    • 50: ~0.30%
    • 51: ~0.50%
    • 52: ~0.50%
    • 53: ~0.50%
    • 54: ~0.50%
    • 55: ~0.20%
    • 56: ~0.50%
    • 57: ~0.50%
    • 59: ~0.50%
    • 60: ~0.40%
    • 62: ~0.50%
    • 63: ~0.20%
    • 64: ~0.50%
    • 65: ~0.40%
    • 66: ~0.50%
    • 67: ~0.40%
    • 68: ~0.50%
    • 69: ~0.50%
    • 70: ~0.50%
    • 71: ~0.20%
    • 72: ~0.50%
    • 73: ~0.20%
    • 74: ~0.50%
    • 75: ~0.50%
    • 77: ~0.50%
    • 78: ~0.30%
    • 79: ~0.50%
    • 80: ~0.40%
    • 81: ~0.30%
    • 82: ~0.20%
    • 83: ~0.40%
    • 84: ~0.30%
    • 85: ~0.50%
    • 87: ~0.50%
    • 88: ~0.20%
    • 90: ~0.50%
    • 91: ~0.20%
    • 92: ~0.50%
    • 93: ~0.40%
    • 94: ~0.50%
    • 95: ~0.50%
    • 97: ~0.50%
    • 98: ~0.40%
    • 99: ~0.50%
    • 100: ~0.30%
    • 101: ~0.50%
    • 103: ~0.20%
    • 104: ~0.50%
    • 106: ~0.40%
    • 107: ~0.20%
    • 108: ~0.40%
    • 109: ~0.30%
    • 110: ~0.50%
    • 111: ~0.40%
    • 112: ~0.50%
    • 113: ~0.30%
    • 115: ~0.30%
    • 116: ~0.50%
    • 117: ~0.50%
    • 118: ~0.30%
    • 120: ~0.30%
    • 121: ~0.50%
    • 122: ~0.20%
    • 123: ~0.40%
    • 124: ~0.30%
    • 125: ~0.40%
    • 126: ~0.50%
    • 127: ~0.50%
    • 128: ~0.50%
    • 129: ~0.50%
    • 130: ~0.50%
    • 131: ~0.50%
    • 132: ~0.40%
    • 133: ~0.50%
    • 134: ~0.30%
    • 135: ~0.50%
    • 136: ~0.30%
    • 137: ~0.30%
    • 138: ~0.50%
    • 139: ~0.50%
    • 140: ~0.20%
    • 141: ~0.50%
    • 142: ~0.50%
    • 143: ~0.50%
    • 144: ~0.30%
    • 145: ~0.30%
    • 146: ~0.30%
    • 147: ~0.50%
    • 148: ~0.30%
    • 149: ~0.20%
    • 150: ~0.50%
    • 151: ~0.30%
    • 152: ~0.20%
    • 153: ~0.50%
    • 154: ~0.50%
    • 155: ~0.40%
    • 156: ~0.20%
    • 158: ~0.50%
    • 159: ~0.50%
    • 160: ~0.50%
    • 161: ~0.40%
    • 162: ~0.20%
    • 163: ~0.40%
    • 164: ~0.20%
    • 165: ~0.50%
    • 166: ~0.50%
    • 167: ~0.50%
    • 168: ~0.20%
    • 169: ~0.50%
    • 170: ~0.50%
    • 171: ~0.20%
    • 172: ~0.50%
    • 173: ~0.50%
    • 174: ~0.40%
    • 175: ~0.50%
    • 176: ~0.30%
    • 178: ~0.50%
    • 180: ~0.20%
    • 182: ~0.50%
    • 183: ~0.50%
    • 184: ~0.30%
    • 185: ~0.50%
    • 187: ~0.20%
    • 188: ~0.50%
    • 189: ~0.50%
    • 191: ~0.50%
    • 192: ~0.50%
    • 193: ~0.50%
    • 194: ~0.20%
    • 195: ~0.30%
    • 196: ~0.50%
    • 197: ~0.50%
    • 199: ~0.50%
    • 200: ~0.50%
    • 201: ~0.20%
    • 202: ~0.50%
    • 203: ~0.50%
    • 204: ~0.30%
    • 205: ~0.50%
    • 206: ~0.20%
    • 207: ~0.40%
    • 208: ~0.50%
    • 209: ~0.30%
    • 210: ~0.30%
    • 211: ~0.50%
    • 212: ~0.20%
    • 213: ~0.50%
    • 214: ~0.50%
    • 215: ~0.40%
    • 216: ~0.50%
    • 217: ~0.40%
    • 218: ~0.50%
    • 219: ~0.50%
    • 220: ~0.20%
    • 221: ~0.50%
    • 222: ~0.40%
    • 223: ~0.50%
    • 224: ~0.30%
    • 225: ~0.40%
    • 227: ~0.20%
    • 228: ~0.30%
    • 230: ~0.40%
    • 231: ~0.40%
    • 232: ~0.50%
    • 233: ~0.50%
    • 234: ~0.50%
    • 235: ~0.50%
    • 236: ~0.40%
    • 237: ~0.50%
    • 238: ~0.40%
    • 239: ~0.50%
    • 240: ~0.50%
    • 241: ~0.50%
    • 242: ~0.30%
    • 243: ~0.50%
    • 244: ~0.50%
    • 245: ~0.50%
    • 246: ~0.50%
    • 247: ~0.20%
    • 248: ~0.50%
    • 249: ~0.50%
    • 250: ~0.50%
    • 251: ~0.50%
    • 252: ~0.20%
    • 253: ~0.50%
    • 254: ~0.50%
    • 255: ~0.30%
    • 256: ~0.50%
    • 257: ~0.50%
    • 258: ~0.20%
    • 259: ~0.50%
    • 260: ~0.30%
    • 261: ~0.50%
    • 262: ~0.50%
    • 263: ~0.20%
    • 264: ~0.50%
    • 265: ~0.20%
  • Samples:
    sentence label
    MERCATO LBA - Treviso, Giofrè: "Mercato in continua osservazione, vedremo..." 0
    Ky Bowman: Non sono soddisfatto delle mie performance 0
    LBA - Treviso, Giofrè: "Sabato la Reggiana, dobbiamo vincere. Punto" 0
  • Loss: BatchAllTripletLoss

Evaluation Dataset

Unnamed Dataset

  • Size: 9,310 evaluation samples
  • Columns: sentence and label
  • Approximate statistics based on the first 1000 samples:
    sentence label
    type string int
    details
    • min: 4 tokens
    • mean: 19.04 tokens
    • max: 78 tokens
    • 0: ~0.50%
    • 1: ~0.30%
    • 2: ~0.50%
    • 4: ~0.50%
    • 5: ~0.20%
    • 6: ~0.30%
    • 7: ~0.50%
    • 8: ~0.50%
    • 9: ~0.50%
    • 10: ~0.50%
    • 12: ~0.40%
    • 13: ~0.30%
    • 14: ~0.30%
    • 15: ~0.40%
    • 16: ~0.20%
    • 17: ~0.50%
    • 18: ~0.40%
    • 19: ~0.40%
    • 20: ~0.50%
    • 21: ~0.50%
    • 22: ~0.50%
    • 23: ~0.50%
    • 24: ~0.20%
    • 25: ~0.20%
    • 26: ~0.50%
    • 27: ~0.50%
    • 28: ~0.50%
    • 30: ~0.50%
    • 31: ~0.20%
    • 32: ~0.30%
    • 33: ~0.50%
    • 34: ~0.20%
    • 35: ~0.50%
    • 37: ~0.50%
    • 38: ~0.20%
    • 39: ~0.50%
    • 40: ~0.50%
    • 41: ~0.20%
    • 42: ~0.30%
    • 43: ~0.30%
    • 44: ~0.50%
    • 45: ~0.30%
    • 46: ~0.50%
    • 47: ~0.50%
    • 48: ~0.30%
    • 49: ~0.40%
    • 50: ~0.30%
    • 51: ~0.20%
    • 52: ~0.50%
    • 53: ~0.20%
    • 54: ~0.30%
    • 55: ~0.50%
    • 56: ~0.50%
    • 57: ~0.20%
    • 58: ~0.50%
    • 59: ~0.50%
    • 60: ~0.50%
    • 61: ~0.30%
    • 62: ~0.30%
    • 63: ~0.20%
    • 65: ~0.50%
    • 67: ~0.40%
    • 68: ~0.50%
    • 69: ~0.50%
    • 70: ~0.20%
    • 71: ~0.40%
    • 72: ~0.50%
    • 73: ~0.50%
    • 74: ~0.30%
    • 77: ~0.20%
    • 78: ~0.50%
    • 79: ~0.50%
    • 80: ~0.20%
    • 81: ~0.50%
    • 82: ~0.20%
    • 83: ~0.50%
    • 84: ~0.50%
    • 85: ~0.50%
    • 89: ~0.20%
    • 90: ~0.50%
    • 91: ~0.50%
    • 92: ~0.30%
    • 93: ~0.40%
    • 94: ~0.50%
    • 95: ~0.30%
    • 96: ~0.20%
    • 97: ~0.50%
    • 98: ~0.20%
    • 99: ~0.50%
    • 100: ~0.50%
    • 101: ~0.50%
    • 102: ~0.50%
    • 103: ~0.30%
    • 104: ~0.50%
    • 105: ~0.50%
    • 106: ~0.50%
    • 107: ~0.50%
    • 108: ~0.50%
    • 109: ~0.50%
    • 110: ~0.20%
    • 111: ~0.50%
    • 112: ~0.50%
    • 113: ~0.20%
    • 114: ~0.50%
    • 115: ~0.40%
    • 116: ~0.50%
    • 117: ~0.20%
    • 118: ~0.50%
    • 120: ~0.50%
    • 121: ~0.30%
    • 122: ~0.50%
    • 123: ~0.40%
    • 124: ~0.20%
    • 125: ~0.50%
    • 126: ~0.20%
    • 129: ~0.50%
    • 130: ~0.30%
    • 131: ~0.50%
    • 132: ~0.40%
    • 133: ~0.50%
    • 134: ~0.50%
    • 135: ~0.50%
    • 136: ~0.20%
    • 137: ~0.30%
    • 138: ~0.50%
    • 140: ~0.30%
    • 141: ~0.30%
    • 142: ~0.50%
    • 143: ~0.40%
    • 144: ~0.50%
    • 145: ~0.50%
    • 146: ~0.30%
    • 147: ~0.20%
    • 148: ~0.50%
    • 149: ~0.40%
    • 150: ~0.50%
    • 151: ~0.20%
    • 152: ~0.50%
    • 154: ~0.20%
    • 155: ~0.20%
    • 156: ~0.50%
    • 157: ~0.50%
    • 158: ~0.50%
    • 159: ~0.50%
    • 160: ~0.20%
    • 162: ~0.50%
    • 163: ~0.20%
    • 164: ~0.20%
    • 165: ~0.20%
    • 166: ~0.20%
    • 167: ~0.30%
    • 168: ~0.50%
    • 169: ~0.50%
    • 170: ~0.50%
    • 171: ~0.40%
    • 172: ~0.30%
    • 173: ~0.50%
    • 174: ~0.50%
    • 175: ~0.30%
    • 176: ~0.50%
    • 178: ~0.50%
    • 179: ~0.20%
    • 180: ~0.50%
    • 181: ~0.50%
    • 182: ~0.30%
    • 183: ~0.40%
    • 184: ~0.20%
    • 185: ~0.50%
    • 186: ~0.50%
    • 187: ~0.50%
    • 188: ~0.20%
    • 189: ~0.50%
    • 191: ~0.20%
    • 192: ~0.50%
    • 193: ~0.20%
    • 194: ~0.20%
    • 195: ~0.40%
    • 196: ~0.20%
    • 197: ~0.20%
    • 198: ~0.50%
    • 199: ~0.40%
    • 200: ~0.50%
    • 201: ~0.50%
    • 202: ~0.50%
    • 203: ~0.40%
    • 205: ~0.50%
    • 206: ~0.50%
    • 207: ~0.50%
    • 208: ~0.50%
    • 209: ~0.50%
    • 210: ~0.50%
    • 211: ~0.40%
    • 212: ~0.50%
    • 213: ~0.50%
    • 214: ~0.20%
    • 215: ~0.20%
    • 216: ~0.50%
    • 217: ~0.50%
    • 218: ~0.50%
    • 219: ~0.30%
    • 220: ~0.50%
    • 221: ~0.50%
    • 223: ~0.50%
    • 224: ~0.50%
    • 225: ~0.50%
    • 227: ~0.20%
    • 228: ~0.50%
    • 230: ~0.20%
    • 231: ~0.50%
    • 232: ~0.50%
    • 234: ~0.30%
    • 235: ~0.40%
    • 236: ~0.50%
    • 237: ~0.50%
    • 238: ~0.20%
    • 239: ~0.50%
    • 240: ~0.20%
    • 241: ~0.50%
    • 242: ~0.20%
    • 243: ~0.20%
    • 244: ~0.20%
    • 246: ~0.50%
    • 247: ~0.20%
    • 248: ~0.50%
    • 249: ~0.50%
    • 250: ~0.40%
    • 251: ~0.50%
    • 252: ~0.50%
    • 253: ~0.20%
    • 254: ~0.50%
    • 255: ~0.50%
    • 256: ~0.50%
    • 257: ~0.50%
    • 258: ~0.20%
    • 259: ~0.20%
    • 260: ~0.50%
    • 261: ~0.50%
    • 262: ~0.20%
    • 263: ~0.40%
    • 264: ~0.50%
    • 265: ~0.50%
    • 266: ~0.50%
    • 267: ~0.50%
    • 268: ~0.20%
    • 269: ~0.20%
    • 270: ~0.40%
    • 272: ~0.30%
    • 273: ~0.20%
    • 274: ~0.50%
    • 275: ~0.50%
    • 276: ~0.40%
    • 277: ~0.30%
    • 278: ~0.30%
  • Samples:
    sentence label
    Supplenze: come funzionano i contratti fino al 31 dicembre 2024 e il calcolo del punteggio? 0
    Docente non abilitato assunto a tempo determinato da concorso PNRR1: in quale scuola "andrò a finire" se nella mia si perde un posto? 0
    Docenti non abilitati nominati dopo il 31 agosto da graduatorie pubblicate prima: otterranno sede di titolarità all’esito delle operazioni di mobilità [Chiarimenti] 0
  • Loss: BatchAllTripletLoss

Training Hyperparameters

Non-Default Hyperparameters

  • per_device_train_batch_size: 32
  • num_train_epochs: 4
  • lr_scheduler_type: cosine
  • warmup_ratio: 0.25
  • seed: 17
  • data_seed: 17
  • bf16: True
  • batch_sampler: group_by_label

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: 8
  • 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.0
  • num_train_epochs: 4
  • max_steps: -1
  • lr_scheduler_type: cosine
  • lr_scheduler_kwargs: {}
  • warmup_ratio: 0.25
  • 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: 17
  • data_seed: 17
  • jit_mode_eval: False
  • use_ipex: False
  • bf16: True
  • 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
  • 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
  • eval_on_start: False
  • use_liger_kernel: False
  • eval_use_gather_object: False
  • average_tokens_across_devices: False
  • prompts: None
  • batch_sampler: group_by_label
  • multi_dataset_batch_sampler: proportional

Training Logs

Epoch Step Training Loss Validation Loss average_precision
0.0002 1 0.0521 - -
0.8002 3824 0.0195 - -
1.7732 7648 0.0071 - -
2.7462 11472 0.0052 - -
3.7192 15296 0.0046 - -
3.8272 15812 - 0.0011 0.5284

Framework Versions

  • Python: 3.12.8
  • Sentence Transformers: 3.4.1
  • Transformers: 4.48.3
  • PyTorch: 2.6.0+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",
}

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}
}
Downloads last month
128
Safetensors
Model size
1.96B params
Tensor type
BF16
·
Inference Providers NEW
This model is not currently available via any of the supported Inference Providers.

Model tree for ancc/Velvet-2B-embedding-news

Base model

Almawave/Velvet-2B
Finetuned
(1)
this model

Evaluation results