Views
No views yet
SentenceTransformer(
(0): Transformer({'max_seq_length': 256, '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})
)pip install -U sentence-transformers1from sentence_transformers import SentenceTransformer
2
3# Download from the 🤗 Hub
4model = SentenceTransformer("knguyennguyen/mpnet_laptop1k_adjustedv2")
5# Run inference
6sentences = [
7 'laptop with a large display, integrated graphics, and multiple connectivity options, featuring a sleek design and lightweight build. intended for general use.',
8 'Title: HP Envy 17t CG 17.3" Touch FHD Laptop (Intel i7-1195G7 4-Core, 32GB RAM, 1TB PCIe SSD + 2TB HDD, Intel Iris Xe, 1920x1080, Backlit KB, FP Reader, WiFi 6, Win11H) w/Hub Descripion: [\'GreatPriceTech sells computers with custom/upgraded configurations to enhance system performance. If the computer has modifications as listed above, the manufacturer’s box was opened by our highly skilled technicians for testing, inspection, and installation of the upgrades according to the specifications advertised. All computers and components are brand new.\'\n \'Processor: Intel Core i7-1195G7 2.80GHz Processor (11th Gen, upto 5 GHz, 12MB Cache, 4-Cores)\'\n \'Processor:\'\n \'Intel Core i7-1195G7 2.80GHz Processor (11th Gen, upto 5 GHz, 12MB Cache, 4-Cores)\'\n \'Storage: 1TB PCIe SSD (Solid State Drive) + 2TB HDD (Hard Disk Drive)\'\n \'Storage:\' \'1TB PCIe SSD (Solid State Drive) + 2TB HDD (Hard Disk Drive)\'\n \'Memory: 32GB DDR4 SO-DIMM\' \'Memory:\' \'32GB DDR4 SO-DIMM\'\n \'Graphics: Intel Iris Xe Integrated Graphics,\' \'Graphics:\'\n \'Intel Iris Xe Integrated Graphics,\'\n \'Operating System: Windows 11 Home-64\' \'Operating System:\'\n \'Windows 11 Home-64\' \'Connectivity: Wi-Fi 6 AX201 Wifi, Bluetooth 5.0,\'\n \'Connectivity:\' \'Wi-Fi 6 AX201 Wifi, Bluetooth 5.0,\'\n \'Camera: 720p HD Webcam\' \'Camera:\' \'720p HD Webcam\'\n \'Input/Output: ,, Backlit Keyboard,\' \'Input/Output:\'\n \',, Backlit Keyboard,\'\n \'Display: 17.3" Full HD (1920x1080) 60Hz 16:9 Display\' \'Display:\'\n \'17.3" Full HD (1920x1080) 60Hz 16:9 Display\'\n \'Ports/Slots:, 2 USB 3.2 Gen1, 1 USB 2.0, 1 HDMI, Thunderbolt 3 (Type-C), SD Card Reader, No Optical Drive, Headphone/Microphone Combo Jack\'\n \'Ports/Slots:\'\n \', 2 USB 3.2 Gen1, 1 USB 2.0, 1 HDMI, Thunderbolt 3 (Type-C), SD Card Reader, No Optical Drive, Headphone/Microphone Combo Jack\'\n \'Battery: 65W Power Supply, 4-Cell 55 WHr Battery\' \'Battery:\'\n \'65W Power Supply, 4-Cell 55 WHr Battery\' \'Color: Natural Silver\'\n \'Color:\' \'Natural Silver\' \'Form/Style: Standard\' \'Form/Style:\' \'Standard\'\n \'Product Dimensions (WxLxH): 15.7 IN x 10.2 IN x 0.76 IN. Weight: 5.8lb\'\n \'Product Dimensions (WxLxH): 15.7 IN x 10.2 IN x 0.76 IN.\' \'Weight:\'\n \'5.8lb\'\n \'1 Year Manufacturer warranty from GreatPriceTech (Professionally upgraded by GreatPriceTech)\'\n \'1 Year Manufacturer warranty from GreatPriceTech (Professionally upgraded by GreatPriceTech)\']',
9 'Title: Lenovo ThinkPad E14 14" FHD Business Laptop Computer, Intel Quad-Core i5 10210U Up to 4.2GHz (Beats i7-7500U), 8GB DDR4 RAM, 128GB SSD + 1TB HDD, AC WiFi, BT 5.0, Windows 10 Pro, 64GB USB Flash Drive Descripion: [\'iPuzzle sells 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. Through our in-depth inspection and testing, and defects can be significantly reduced.\'\n \'Processor\' \'Intel Core i5-10210U (4C / 8T, 1.6 / 4.2GHz, 6MB)\'\n \'Graphics\' \'Intel UHD Graphics\' \'Memory\' \'8GB DDR4-2666\' \'Storage\'\n \'128GB M.2 SSD + 1TB HDD 5400rpm 2.5"\' \'Display\'\n \'14" FHD (1920x1080) IPS 250nits Anti-glare\' \'Ethernet\' \'100/1000M\'\n \'WLAN + Bluetooth\' \'RTL8822CE 11ac, 2x2 + BT5.0\' \'Ports\'\n \'1x USB-C 3.1 Gen 1 (support data transfer, Power Delivery and DisplayPort)\'\n \'1x USB 3.1 Gen 1 (Always On)\' \'1x HDMI 1.4b\'\n \'1x headphone / microphone combo jack (3.5mm)\' \'1x USB 2.0\'\n \'1x Ethernet (RJ-45)\' \'1x USB 3.1 Gen 1\' \'Audio Chip\'\n \'High Definition (HD) Audio, Synaptic CX11880 codec\' \'Speakers\'\n \'Stereo speakers, 2W x2, Dolby Advanced Audio\' \'Camera\'\n \'720p with ThinkShutter\' \'Microphone\' \'2x, Array\' \'Battery\' \'45Wh\'\n \'Power Adapter\' \'65W USB-C\' \'Keyboard\' \'Non-backlit, English\' \'Color\'\n \'Black\' \'Dimensions(WxDxH)\' \'12.8 x 9.13 x 0.74 in\' \'Weight\' \'3.73 lbs\'\n \'Operating System\' \'Windows 10 Pro 64, English\']',
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]sentence_0 and sentence_1| sentence_0 | sentence_1 | |
|---|---|---|
| type | string | string |
| details |
|
|
| sentence_0 | sentence_1 |
|---|---|
a laptop for online classes and remote learning. laptop with a large display, integrated graphics, substantial memory, and ample storage capacity. | Title: Lenovo 2022 Newest IdeaPad 3 17 17.3" FHD Laptop Computer, Intel Quard-Core i7-1165G7, 20GB DDR4 RAM, 1TB PCIe SSD, WiFi 6, Bluetooth 5.1, Webcam, Arctic Grey, Windows 11, broag 64GB Flash Drive Descripion: ['Processor' 'Intel Core i7-1165G7 (4C / 8T, 2.8 / 4.7GHz, 12MB)'[object Object] 'Graphics' 'Integrated Intel Iris Xe Graphics' 'Memory' '20GB DDR4'[object Object] 'Storage' '1TB SSD M.2 PCIe NVMe' 'Display'[object Object] '17.3" FHD (1920x1080) IPS 300nits Anti-glare, 72% NTSC' 'Ports & Slots'[object Object] '1x USB 2.0' '1x USB 3.2 Gen 1'[object Object] '1x USB-C 3.2 Gen 1 (support data transfer only)' '1x HDMI 1.4b'[object Object] '1x Card reader' '1x Headphone / microphone combo jack (3.5mm)'[object Object] '1x Power connector' 'WLAN + Bluetooth' 'Wi-Fi 6 11ax, 2x2 + BT5.1'[object Object] 'Camera' '720p with Privacy Shutter' 'Microphone' '2x, Array' 'Speakers'[object Object] 'Stereo speakers, 1.5W x2, Dolby Audio' 'Color' 'Arctic Grey' 'Keyboard'[object Object] 'Non-backlit, English' 'Security Chip' 'Firmware TPM 2.0'[object Object] 'Fingerprint Reader' 'Touch Style' 'Other Security'[object Object] 'Camera privacy shutter' 'Battery' 'Integrated 45Wh' 'Power Adapter'[object Object] '65W Round Tip Wall-mount' 'Operating System' 'Windows 11 Home, English'[object Object] 'Dimensions(WxDxH)' '15.71 x 10.79 x 0.78 inches' 'Weight' '4.63 lbs'] |
a laptop for high-speed multitasking and performance enhancement | Title: HP 2021 Newest 15.6" Pavilion Laptop with FHD & IPS Display (AMD Ryzen 5 5500U 6-Core, 16GB RAM, 2TB PCIe SSD, AMD Radeon, (1920x1080), FP Reader, WiFi, Webcam, Bluetooth, Win 10 Home) w/Hub Descripion: ["GreatPriceTech sells computers with custom/upgraded configurations to enhance system performance. If the computer has modifications as listed above, the manufacturer’s box was opened by our highly skilled technicians for testing, inspection, and installation of the upgrades according to the specifications advertised. All computers and components are brand new.Processor: AMD Ryzen 5 5500U 2.1GHz Processor (5th Gen, upto 4 GHz, 8MB Cache, 6-Cores) Storage: 2TB PCIe SSD (Solid State Drive) Memory: 16GB DDR4 SO-DIMM Graphics: AMD Radeon Integrated Graphics, Operating System: Windows 10 Home-64 Connectivity: Wi-Fi 6 AX201 Wifi, Bluetooth 4.2, Camera: 720p HD Webcam Input/Output: Fingerprint Security System, Full-size Blue Keyboard, Display: 15.6'' Full HD (1920x1080) 60Hz 16:9 IPS Display Ports/Slots: 2 USB 3.1 Gen1, 1 HDMI, USB 3.1 Type-C Gen1, Micro SD Reader, Headphone/Microphone Combo Jack Battery: 45W Power Supply, 3-Cell 41 WHr Battery Color: Fog Blue Form/Style: Standard Product Dimensions (WxLxH): 9.1 IN x 14 IN x 0.5 IN. Weight: 4.1lb 1 Year Manufacturer warranty from GreatPriceTech (Professionally upgraded by GreatPriceTech)"] |
a laptop for multitasking and casual gaming | Title: HP Probook 450 15.6" HD Flagship Business Laptop Computer Intel Quad-Core i5-8265U(Up to 3.9GHz, Beat i7-7500U), 16GB DDR4 RAM, 128GB PCIe SSD, 1TB HDD, Webcam, USB-C, HDMI, Win10 Pro,w/GM Accessories Descripion: ['We sells 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.'[object Object] 'Product Name:' 'HP laptop' 'Operating System:' 'Windows 10 Pro (64-Bit)'[object Object] 'Processor:'[object Object] '8th Generation Intel Core i5-8265U Processor @ 1.60GHz (4 Cores, 6M Cache, up to 3.90 GHz)'[object Object] 'Memory:' '16GB DDR4' 'Graphics:' 'Intel UHD Graphics 620' 'Display:'[object Object] '15.6" 1366 x 768' 'Storage:' '1TB HDD; 128GB PCIe SSD' 'Optical Drive:'[object Object] 'None' 'Ports:'[object Object] '2 x USB 3.1 Gen 1, 1 x USB 3.1 Type-C Gen 1 (Power delivery, DisplayPort), 1 x USB 2.0 (power port), 1 x HDMI, 1 x Headphone/Microphone Combo Jack'[object Object] 'Audio:' 'Single digital microphone' 'Input Device:'[object Object] '720p HD webcam, SD, SDHC, SDXC' 'Communications:'[object Object] 'Wi-Fi (802.11ac), Bluetooth 4.2' 'Battery:'[object Object] 'HP Long Life 3-cell, 45 Wh Li-ion' 'AC Adapter:' '45-watt AC adapter'[object Object] 'Dimensions:' '14.37" x 10.11" x 0.75"' 'Weight:' '4.41 lbs'] |
MultipleNegativesRankingLoss with these parameters:
1{
2 "scale": 20.0,
3 "similarity_fct": "cos_sim"
4}per_device_train_batch_size: 128per_device_eval_batch_size: 128multi_dataset_batch_sampler: round_robinoverwrite_output_dir: Falsedo_predict: Falseeval_strategy: noprediction_loss_only: Trueper_device_train_batch_size: 128per_device_eval_batch_size: 128per_gpu_train_batch_size: Noneper_gpu_eval_batch_size: Nonegradient_accumulation_steps: 1eval_accumulation_steps: Nonetorch_empty_cache_steps: Nonelearning_rate: 5e-05weight_decay: 0.0adam_beta1: 0.9adam_beta2: 0.999adam_epsilon: 1e-08max_grad_norm: 1num_train_epochs: 3max_steps: -1lr_scheduler_type: linearlr_scheduler_kwargs: {}warmup_ratio: 0.0warmup_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: Falsefp16_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: Falseignore_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: Falsehub_always_push: Falsegradient_checkpointing: Falsegradient_checkpointing_kwargs: Noneinclude_inputs_for_metrics: Falseeval_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: Nonedispatch_batches: Nonesplit_batches: Noneinclude_tokens_per_second: Falseinclude_num_input_tokens_seen: Falseneftune_noise_alpha: Noneoptim_target_modules: Nonebatch_eval_metrics: Falseeval_on_start: Falseuse_liger_kernel: Falseeval_use_gather_object: Falsebatch_sampler: batch_samplermulti_dataset_batch_sampler: round_robin1@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}