SentenceTransformer based on sentence-transformers/all-mpnet-base-v2

This is a sentence-transformers model finetuned from sentence-transformers/all-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/all-mpnet-base-v2
  • Maximum Sequence Length: 128 tokens
  • Output Dimensionality: 768 tokens
  • Similarity Function: Cosine Similarity

Model Sources

Full Model Architecture

SentenceTransformer(
  (0): Transformer({'max_seq_length': 128, 'do_lower_case': False}) with Transformer model: MPNetModel 
  (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("knguyennguyen/mpnet_laptop1k_adjusted")
# Run inference
sentences = [
    'a convertible laptop for working, watching, or writing',
    'Title: HP Flagship Pavilion X360 15 2-in-1 Laptop 15.6" HD Touchscreen WLED 10th Gen Intel 4-Core i5-10210U(Beats i7-8550U)\xa016GB RAM 512GB SSD B&O WiFi HDMI USB-C Win 10 + Pen Descripion: [\'PRODUCT OVERVIEW:\'\n "Offering a new hourglass design and a 360° hinge, the HP Pavilion x360 Convertible Laptop can be adjusted to a variety of comfortable angles, whether you\'re working, watching or writing"\n \'Product Details:\' \'Microprocessor:\'\n \'10th Generation Intel Core i5 Processors, Intel Quad-Core i5-10210U (Beats i7-8550U), 1.6 GHz up to 4.2 GHz, 6 MB Cache, 8 Threads\'\n \'Memory:\' \'16GB DDR4\' \'Storage:\' \'512GB SSD\' \'Operating system:\'\n \'Microsoft Windows 10 Home\\xa0(64-bit)\' \'Graphics & Video:\'\n \'15.6" diagonal HD(1366 x 768) Touchscreen SVA micro-edge WLED-backlit multitouch-enabled edge-to-edge glass, 220 nits, 45% NTSC Display Integrated Intel UHD Graphics\'\n \'Key Features:\'\n \'Wi-Fi: Yes Bluetooth: Yes Optical Drive: No Webcam: Yes Backlit Keyboard: No Fingerprint Reader: No Multi-format SD media card reader: Yes Audio: Yes\'\n \'Ports :\'\n \'1 USB 3.1 Gen 1 Type-C (Data Transfer Only, 5 Gb/s signaling rate); 2 USB 3.1 Gen 1 Type-A (Data Transfer Only); 1 AC smart pin; 1 HDMI 1.4; 1 headphone/microphone combo; 1 multi-format SD media card reader\'\n \'Additional Information:\'\n \'Dimension: 14.13" x 9.51" x 0.81" Approximate Weight: 4.39 lbs\'\n \'Accessory:\' \'Pen\']',
    'Title: HP Newest 2020 17 Premium Business Laptop I 17.3 inch HD+ Touchscreen Display I 10th Gen Intel Quad-Core i5-10210U (>i7-7500U) I 16GB DDR4 256GB SSD I Backlit KB DVD Win 10 +\xa016GB Micro SD Card Descripion: [\'If the computer has modifications (listed above), then the manufacturer box is opened for it to be tested and inspected and to install the upgrades to achieve the specifications as advertised. If no modification are listed, the item is unopened and untested. Defects & blemishes are significantly reduced by our in depth inspection & testing.\'\n \'PRODUCT OVERVIEW:\'\n \'Tackle assignments and stream HD content with this HP 17.3-inch laptop. An 10th Intel Core i5 processor delivers reliably fast performance, and the DDR4 of RAM let you run multiple programs simultaneously. This HP 17.3-inch laptop has a SSD Storage that provides plenty of storage space and helps improve startup and loading times.\'\n \'KEY SPECIFICATIONS:\' \'PC Type:\' \'Traditional Business Laptop Computer\'\n \'PC Series:\' \'HP 17 i5 laptop\' \'Display:\'\n \'17.3 inch HD+ ( 1600 x 900) Touchscreen BrightView WLED Display\'\n \'Processor:\'\n \'10th Gen Intel Quad-Core i5-10210U, 1.6GHz, up to 4.2GHz, 6 MB Cache, 8 Treads\'\n \'Memory:\' \'16GB DDR4\' \'Storage:\' \'256GB SSD\' \'Graphics:\'\n \'Integrated Intel UHD Graphics\' \'Communications:\'\n \'802.11ac Wi-Fi and Bluetooth 4.2\' \'Camera:\'\n \'HP Webcam with integrated digital microphone\' \'Keyboard:\'\n \'Backlit Keyboard\' \'Operating system:\' \'Windows 10 Home 64 bit\'\n \'Ports & Slots:\'\n \'2 x USB 3.1 (Data Transfer Only), 1 x USB 2.0 (Data Transfer Only), 1 x AC smart pin, 1 x HDMI, 1 x RJ-45, 1 x headphone/microphone combo, 1 x multi-format SD media card reader, 1 x DVD Optical Drive\'\n \'Battery Life:\' \'3-cell, 41 Wh Li-ion\' \'Additional Information:\'\n \'Dimensions: 16.33" x 10.71" x 0.96" Approximate Weight: 5.31 lbs\'\n \'Accessory:\' \'DELCA\\xa016GB\\xa0Microso\\xa0SD\\xa0included\']',
]
embeddings = model.encode(sentences)
print(embeddings.shape)
# [3, 768]

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

Training Details

Training Dataset

Unnamed Dataset

  • Size: 3,726 training samples
  • Columns: sentence_0 and sentence_1
  • Approximate statistics based on the first 1000 samples:
    sentence_0 sentence_1
    type string string
    details
    • min: 5 tokens
    • mean: 21.54 tokens
    • max: 76 tokens
    • min: 52 tokens
    • mean: 124.87 tokens
    • max: 128 tokens
  • Samples:
    sentence_0 sentence_1
    laptop with a large display, lightweight design, and multiple connectivity options. Title: HP 2022 Pavilion 17.3“ FHD IPS Laptop PC, AMD Ryzen 5 5500U (Beat i7 1065g7), 16GB DDR4 RAM, 1TB PCIe SSD, Fingerprint, WiFi 5, Bluetooth, Long Battery Life, Webcam, Windows 10, Silver w/ EBP Descripion: ["Purposefully designed: Get things done with a peace of mind, the HP 17 Laptop PC is designed with ocean-bound plastic. See more on the 17-inch diagonal high resolution screen with a narrow bezel, and get comfy while you type with a new lift-hinge that elevates the keyboard. Performance you can trust: Multitasking feels easy and fast with the performance of an AMD processor, powerful graphics, and speedy Wi-Fi technology. Store more of what you love with a lot of storage. Breathe easy: Everyday computing made easy, with comfort features like HP Fast Charge and a big click pad, this laptop let's you do you."
    'Specification Details:' 'AMD Ryzen 5 5500U Mobile Processor'
    'Create. Play. Work. Educate. Entertain. The possibilities are infinite. Be anywhere, go anywhere. Powers ultrathin notebooks that offer supreme performance, astonishing battery life, and modern features you need on-the-go.'
    '16GB DDR4 Memory'
    'Substantial high-bandwidth RAM to smoothly run your games and photo- and video-editing applications, as well as multiple programs and browser tabs all at once.'
    '1TB PCIe NVMe solid state drive (SSD)'
    'The flash-based SSD has no moving parts, resulting in faster start-up times and data access, no noise, and reduced heat production and power draw on the battery.'
    'Built-in HD webcam'
    'Makes it easy to video chat with family and friends or teleconference with colleagues over Skype or other popular applications.'
    'Wireless Technology' '802.11a/b/g/n/ac (1x1) Wi-Fi and Bluetooth combo.'
    'Ports:'
    '1 SuperSpeed USB Type-C; 2 SuperSpeed USB Type-A; 1 HDMI 1.4b; 1 AC smart pin; 1 headphone/microphone combo'
    'Dimension & Weight:' '15.78 x 10.15 x 0.78 in 5.25 lbs'
    'The mousepad is not part of the package and only available upon request.']
    a laptop for everyday computing tasks Title: Acer 2022 Chromebook 317 17.3" FHD Laptop Computer, Intel Celeron N4500 Processor up to 2.8GHz, 4GB LPDDR4 RAM, 80GB Storage (64GB eMMC + 16GB Flash Drive), WiFi 6, BT 5.0, Type-C, Silver, Chrome OS Descripion: ['Color' 'Silver' 'Operating System' 'Chrome' 'Processor'
    'Intel Celeron N4500 Processor 1.1 GHz (4M Cache, up to 2.8 GHz, 2 cores)'
    'Graphics' 'Intel UHD Graphics' 'Display'
    '17.3-inch, FHD (1920 x 1080, LCD, LED, Wide view, Anti-glare display, Narrow bezels'
    'Memory' '4GB LPDDR4X Memory' 'Storage' '64GB eMMC' 'I/O Ports'
    '2x USB 3.2 Gen 1 Type-A'
    '2x USB 3.2 Gen 1 Type-C(USB Type-C Port Supporting: USB 3.2 Gen 1 (up to 5 Gbps), DisplayPort over USB-C, USB charging 5/9/15/20 V; 3 A, DC-in port 20 V; 45 W)'
    '1x 3.5mm Combo Audio Jack' '1x Micro SD card reader' 'Keyboard'
    'Chiclet Keyboard' 'Audio' 'Built-in speaker' 'Built-in microphone'
    'Network and Communication' 'IEEE 802.11 a/b/g/n/ac/ax + Bluetooth 5.0'
    'Battery' '3-cell Li-ion' 'Power Supply' 'TYPE-C, 45W AC Adapter'
    'Weight' '5.29 lb' 'Dimensions (W x D x H)' '15.8" x 10.5" x 0.89")']
    laptop with a 15.6-inch display, upgraded storage, and integrated graphics capabilities. Title: 2021 Dell Inspiron 15 3505 Laptop 15.6” FHD Narrow Border Display, AMD Ryzen TM 3 3250U(up to 3.5GHz), 8GB RAM 512GB NVMe SSD, Integrated Graphics with AMD APU, Online Meeting Ready Webcam Win 10 Descripion: ['We sell computers with upgraded configurations. If the computer has modifications (listed above), then the manufacturer box is opened for it to be tested and inspected and to install the upgrades to achieve the specifications as advertised. If no modifications are listed, the item is unopened and untested. Defects & blemishes are significantly reduced by our in-depth inspection & testing.'
    'Hard Drive:' 'Upgraded to 512GB NVMe SSD' 'Memory:' '8GB DDR4 SDRAM'
    'Display:'
    '15.6-inch FHD (1920 x 1080) Anti-glare LED Backlight Non-Touch Narrow Border WVA Display'
    'Screen Resolution:' '1920 x 1080' 'Processor:'
    'AMD Ryzen TM 3 3250U Mobile Processor with Radeon TM Graphics (2-Core, 2.6 GHz Up to 3.5 GHz, 4 MB Cache)'
    'Graphics:' 'Integrated graphics with AMD APU' 'Operating system:'
    'Windows 10 Home' 'Bluetooth:' 'Yes' 'WLAN Connectivity:' '802_11_AC'
    'Built-in HD Webcam:' 'Yes']
  • Loss: MultipleNegativesRankingLoss with these parameters:
    {
        "scale": 20.0,
        "similarity_fct": "cos_sim"
    }
    

Training Hyperparameters

Non-Default Hyperparameters

  • per_device_train_batch_size: 128
  • per_device_eval_batch_size: 128
  • num_train_epochs: 5
  • 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: 128
  • per_device_eval_batch_size: 128
  • 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: 5
  • 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
  • eval_on_start: False
  • use_liger_kernel: False
  • eval_use_gather_object: False
  • batch_sampler: batch_sampler
  • multi_dataset_batch_sampler: round_robin

Framework Versions

  • Python: 3.11.11
  • Sentence Transformers: 3.1.1
  • Transformers: 4.45.2
  • PyTorch: 2.5.1+cu121
  • Accelerate: 1.2.1
  • Datasets: 3.2.0
  • Tokenizers: 0.20.3

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}
}
Downloads last month
3
Safetensors
Model size
109M params
Tensor type
F32
·
Inference Examples
This model does not have enough activity to be deployed to Inference API (serverless) yet. Increase its social visibility and check back later, or deploy to Inference Endpoints (dedicated) instead.

Model tree for knguyennguyen/mpnet_laptop1k_adjusted

Finetuned
(206)
this model