SentenceTransformer based on FacebookAI/roberta-base

This is a sentence-transformers model finetuned from FacebookAI/roberta-base. 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: FacebookAI/roberta-base
  • 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: RobertaModel 
  (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/fashion_5k")
# Run inference
sentences = [
    "I'm looking for a charming ring that embodies innocence and purity, suitable for daily wear. It should have a minimalistic design and be stackable with other rings. Durability is key, and I prefer it to be available in a unique metallic finish.",
    "Title: CozzySayido Daisy Flower Ring Bands for Woman Innocent Daisy Promise Dainty Delicate Design Minimalistic Stackable Available in Silver and Rose Gold Descripion: ['“Always have something beautiful in sight, even if it’s just a daisy in a jelly glass.”'\n '- H. Jackson, Brown Jr.'\n 'Simple, sweet, stackable everyday ring for the sweetest ones.' 'Perks'\n 'Silver or rose gold Stainless steel No corrosion No peeling No spotting or staining No green fingers Resistant to perfume, sweat, and salt water Styling versatility (stack rings, minimalistic one-piece, knuckle, toe, stopper) Medical-grade stainless steel Unbreakable Unbendable Dainty, sweet, and delicate design 30-day full refund'\n 'Sizing'\n 'Available in size 3-10 (For sizing specs and how to know your size, please consult out sizing guide in the photo panel above.)'\n 'CozzySayido'\n 'We brainstorm for our customer to get the best value product. Proudly present, a daisy flower ring. We chose stainless-steel material which is no allergies for sensitive skin, durable and tough in any conditions, no matter if you wash your hand with alcohol sanitizer or washing tons of dishes or swimming in chlorine and salt water, it never gets spotting, staining or turn your finger green or any other color. Unbreakable and unbendable no matter, how you wear it.'\n 'Meaningful design, daisy flower is the symbol of innocence, purity, true love and new beginning to make every of your day the start of something new.'\n 'Designs as well as on-trend fashion jewelry for women with minimalist, dainty, sweet, and delicate style.']",
    'Title: Chelsea FC Official Soccer Gift Mens Graphic T-Shirt Navy XXL Descripion: [\'Official CFC mens T-shirt Large club crest & text print to front Garment Size (Chest): Sm. 40"; Med. 41"; Lge. 42"; XL 44"; XXL 48"; 3XL 52" 100% cotton, top quality T-shirt Many more gift ideas for him @ FootballShopOnline\']',
]
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: 4,693 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: 26 tokens
    • mean: 44.9 tokens
    • max: 87 tokens
    • min: 21 tokens
    • mean: 106.64 tokens
    • max: 128 tokens
  • Samples:
    sentence_0 sentence_1
    I'm looking for a spooky mask that can enhance my costume for a Halloween event. It should have a unique design, feature some lighting effects, and come with hair, suitable for adults. Title: Scary Clown Mask for Penny It Cosplay Costume Halloween Led Light Up Joker Mask with Hair Latex Horror Adult Mask Party Props Descripion: ['This clown costume mask for adults is available in a standard size that fits most adults and teens and is perfect for Halloween, themed parties, haunted houses, and more. Does not include shoes or costume. Care for this 100% latex mask with attached synthetic polyester hair']
    I'm looking for a festive accessory set to celebrate a special birthday. It should include a stylish decorative piece that can be adjusted for comfort and a fun headpiece that adds a touch of sparkle, perfect for both intimate gatherings and lively celebrations. Title: Birthday Queen Sash & Rhinestone Headband Set - Silver Glitter Birthday Sash Birthday Gifts for Women Birthday Party Supplies Descripion: ['"Birthday Queen" sash & rhinestone headband set ↑ No need to keep looking...it's the ultimate birthday party gifts set! ✓ Silver glitter sash + black lettering looks great on Instagram. Make the birthday queen feel special and stand out from the crowd. ✓ It's party tested and approved...will last day into night! Not only perfect for the cozy birthday parties with family but also for the crazy night at Vegas. ✓ No size trouble + Comfortable wearing: Sash can be adjust by clip on to fit from all type body figure. Headband can sit comfortably on the head and the letters are large enough to be clearly identifiable We had so much fun designing this birthday gifts set, we hope they add just as much fun to your parties too. Get the sash and headband at the same time and be prepare for the birthday celebration!']
    I'm looking for a cozy and stylish outerwear option for the colder months, ideally with a hood and a playful design. It should be warm and plush, perfect for layering, and have a comfortable fit. Title: OutTop Sherpa Jacket Women Fall Winter Plush Warm Hooded Stripe Color Block Thicken Warm Fleece Coats Parka Outwear Descripion: ['Package Include:1 PC Coats'
    '==========================================================================='
    'SIZE TABLE' ': International standard : 1 inch = 2.54 cm☺'
    "Size:S____US:4____Bust:100cm/39.37''____Sleeve:56.5cm/22.24''____Length:88cm/34.65''"
    "Size:M____US:6____Bust:105cm/41.34''____Sleeve:57cm/22.44''____Length:89cm/35.04''"
    "Size:L____US:8____Bust:110cm/43.31''____Sleeve:57.5cm/22.64''____Length:90cm/35.43''"
    "Size:XL____US:10____Bust:115cm/45.28''____Sleeve:58cm/22.83''____Length:91cm/35.83''"
    "Size:XXL____US:12____Bust:120cm/47.24''____Sleeve:58.5cm/23.03''____Length:92cm/36.22''"
    "Size:XXXL____US:14____Bust:125cm/49.21''____Sleeve:59cm/23.23''____Length:93cm/36.61''"
    "Size:XXXXL____US:16____Bust:130cm/51.18''____Sleeve:59.5cm/23.43''____Length:94cm/37.01''"
    "Size:XXXXXL____US:18____Bust:135cm/53.15''____Sleeve:60cm/23.62''____Length:95cm/37.40''"
    '==========================================================================='
    'Any questions, please feel free to contact us.☺☺' 'Delivery:'
    'Standard express would take 7-20 days to deliver. Expedited express need 5-7 days.☺☺']
  • 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
7
Safetensors
Model size
125M params
Tensor type
F32
·
Inference Providers NEW
This model is not currently available via any of the supported third-party Inference Providers, and the model is not deployed on the HF Inference API.

Model tree for knguyennguyen/fashion_5k

Finetuned
(1629)
this model