Views
No views yet
SentenceTransformer(
(0): Transformer({'transformer_task': 'feature-extraction', 'modality_config': {'text': {'method': 'forward', 'method_output_name': 'last_hidden_state'}}, 'module_output_name': 'token_embeddings', 'architecture': 'BertModel'})
(1): Pooling({'embedding_dimension': 128, 'pooling_mode': 'mean', 'include_prompt': True})
)pip install -U sentence-transformers1from sentence_transformers import SentenceTransformer
2
3# Download from the 🤗 Hub
4model = SentenceTransformer("swardiantara/bert-tiny-amazon_reviews-k10-adaptive-cosine")
5# Run inference
6sentences = [
7 "Arrived broken. Manufacturer defect. Two of the legs of the base were not completely formed, so there was no way to insert the casters. I unpackaged the entire chair and hardware before noticing this. So, I'll spend twice the amount of time boxing up the whole useless thing and send it back with a 1-star review of part of a chair I never got to sit in. I will go so far as to include a picture of what their injection molding and quality assurance process missed though. I will be hesitant to buy again. It makes me wonder if there aren't missing structures and supports that don't impede the assembly process.",
8 'I like the design of the bag, though it came a little crumpled up. Hoping everything smoothes out with use. Also very upset that I paid more for this bag and my key chain was never sent.',
9 'Had to return. This unit is tiny and very cheap quality.',
10]
11embeddings = model.encode(sentences)
12print(embeddings.shape)
13# [3, 128]
14
15# Get the similarity scores for the embeddings
16similarities = model.similarity(embeddings, embeddings)
17print(similarities)
18# tensor([[ 1.0000, -0.1525, 0.4489],
19# [-0.1525, 1.0000, -0.0192],
20# [ 0.4489, -0.0192, 1.0000]])text_a, text_b, and label| text_a | text_b | label | |
|---|---|---|---|
| type | string | string | list |
| modality | text | text | |
| details |
|
|
|
| text_a | text_b | label |
|---|---|---|
Arrived broken. Manufacturer defect. Two of the legs of the base were not completely formed, so there was no way to insert the casters. I unpackaged the entire chair and hardware before noticing this. So, I'll spend twice the amount of time boxing up the whole useless thing and send it back with a 1-star review of part of a chair I never got to sit in. I will go so far as to include a picture of what their injection molding and quality assurance process missed though. I will be hesitant to buy again. It makes me wonder if there aren't missing structures and supports that don't impede the assembly process. | I ordered this a while ago, even using prime it took over a month to get here, now that I finally got it, I only receved 6 of the 12! Im a little upset. It's still funny, but would not recomend for someone who needs foam quick and in bulk like i do. | [1.0, 0.0] |
Arrived broken. Manufacturer defect. Two of the legs of the base were not completely formed, so there was no way to insert the casters. I unpackaged the entire chair and hardware before noticing this. So, I'll spend twice the amount of time boxing up the whole useless thing and send it back with a 1-star review of part of a chair I never got to sit in. I will go so far as to include a picture of what their injection molding and quality assurance process missed though. I will be hesitant to buy again. It makes me wonder if there aren't missing structures and supports that don't impede the assembly process. | I was happy to find this piece to replace on my broken Shark. Price was good and had it in a few days. When I installed it however, I was no longer satisfied. It wouldn't stay attached and kept popping of with any pull on the handle. Returned the same day it areived. | [0.0, 0.25] |
Arrived broken. Manufacturer defect. Two of the legs of the base were not completely formed, so there was no way to insert the casters. I unpackaged the entire chair and hardware before noticing this. So, I'll spend twice the amount of time boxing up the whole useless thing and send it back with a 1-star review of part of a chair I never got to sit in. I will go so far as to include a picture of what their injection molding and quality assurance process missed though. I will be hesitant to buy again. It makes me wonder if there aren't missing structures and supports that don't impede the assembly process. | Had to return. This unit is tiny and very cheap quality. | [0.0, 0.25] |
[object Object].OrdinalProxyContrastiveLossper_device_train_batch_size: 1024num_train_epochs: 10learning_rate: 2e-05load_best_model_at_end: Trueper_device_train_batch_size: 1024num_train_epochs: 10max_steps: -1learning_rate: 2e-05lr_scheduler_type: linearlr_scheduler_kwargs: Nonewarmup_steps: 0optim: adamw_torchoptim_args: Noneweight_decay: 0.0adam_beta1: 0.9adam_beta2: 0.999adam_epsilon: 1e-08optim_target_modules: Nonegradient_accumulation_steps: 1average_tokens_across_devices: Truemax_grad_norm: 1.0label_smoothing_factor: 0.0bf16: Falsefp16: Falsebf16_full_eval: Falsefp16_full_eval: Falsetf32: Nonegradient_checkpointing: Falsegradient_checkpointing_kwargs: Nonetorch_compile: Falsetorch_compile_backend: Nonetorch_compile_mode: Noneuse_liger_kernel: Falseliger_kernel_config: Noneuse_cache: Falseneftune_noise_alpha: Nonetorch_empty_cache_steps: Noneauto_find_batch_size: Falselog_on_each_node: Truelogging_nan_inf_filter: Trueinclude_num_input_tokens_seen: nolog_level: passivelog_level_replica: warningdisable_tqdm: Falseproject: huggingfacetrackio_space_id: Nonetrackio_bucket_id: Nonetrackio_static_space_id: Noneper_device_eval_batch_size: 8prediction_loss_only: Trueeval_on_start: Falseeval_do_concat_batches: Trueeval_use_gather_object: Falseeval_accumulation_steps: Noneinclude_for_metrics: []batch_eval_metrics: Falsesave_only_model: Falsesave_on_each_node: Falseenable_jit_checkpoint: Falsepush_to_hub: Falsehub_private_repo: Nonehub_model_id: Nonehub_strategy: every_savehub_always_push: Falsehub_revision: Noneload_best_model_at_end: Trueignore_data_skip: Falserestore_callback_states_from_checkpoint: Falsefull_determinism: Falseseed: 42data_seed: Noneuse_cpu: Falseaccelerator_config: {'split_batches': False, 'dispatch_batches': None, 'even_batches': True, 'use_seedable_sampler': True, 'non_blocking': False, 'gradient_accumulation_kwargs': None}parallelism_config: Nonedataloader_drop_last: Falsedataloader_num_workers: 0dataloader_pin_memory: Truedataloader_persistent_workers: Falsedataloader_prefetch_factor: Noneremove_unused_columns: Truelabel_names: Nonetrain_sampling_strategy: randomlength_column_name: lengthddp_find_unused_parameters: Noneddp_bucket_cap_mb: Noneddp_broadcast_buffers: Falseddp_static_graph: Noneddp_backend: Noneddp_timeout: 1800fsdp: Nonefsdp_config: Nonedeepspeed: Nonedebug: []skip_memory_metrics: Truedo_predict: Falseresume_from_checkpoint: Nonewarmup_ratio: Nonelocal_rank: -1prompts: Nonebatch_sampler: batch_samplermulti_dataset_batch_sampler: proportionalrouter_mapping: {}learning_rate_mapping: {}| Epoch | Step | Training Loss |
|---|---|---|
| 0.0624 | 500 | 0.0198 |
| 0.1248 | 1000 | 0.0086 |
| 0.1873 | 1500 | 0.0073 |
| 0.2497 | 2000 | 0.0067 |
| 0.3121 | 2500 | 0.0063 |
| 0.3745 | 3000 | 0.0061 |
| 0.4370 | 3500 | 0.0058 |
| 0.4994 | 4000 | 0.0056 |
| 0.5618 | 4500 | 0.0054 |
| 0.6242 | 5000 | 0.0054 |
| 0.6866 | 5500 | 0.0052 |
| 0.7491 | 6000 | 0.0051 |
| 0.8115 | 6500 | 0.0051 |
| 0.8739 | 7000 | 0.0050 |
| 0.9363 | 7500 | 0.0050 |
| 0.9988 | 8000 | 0.0049 |
| 1.0 | 8010 | - |
| 1.0612 | 8500 | 0.0047 |
| 1.1236 | 9000 | 0.0047 |
| 1.1860 | 9500 | 0.0047 |
| 1.2484 | 10000 | 0.0047 |
| 1.3109 | 10500 | 0.0046 |
| 1.3733 | 11000 | 0.0046 |
| 1.4357 | 11500 | 0.0045 |
| 1.4981 | 12000 | 0.0045 |
| 1.5605 | 12500 | 0.0044 |
| 1.6230 | 13000 | 0.0044 |
| 1.6854 | 13500 | 0.0044 |
| 1.7478 | 14000 | 0.0043 |
| 1.8102 | 14500 | 0.0043 |
| 1.8727 | 15000 | 0.0042 |
| 1.9351 | 15500 | 0.0043 |
| 1.9975 | 16000 | 0.0043 |
| 2.0 | 16020 | - |
| 2.0599 | 16500 | 0.0041 |
| 2.1223 | 17000 | 0.0042 |
| 2.1848 | 17500 | 0.0041 |
| 2.2472 | 18000 | 0.0041 |
| 2.3096 | 18500 | 0.0040 |
| 2.3720 | 19000 | 0.0040 |
| 2.4345 | 19500 | 0.0040 |
| 2.4969 | 20000 | 0.0040 |
| 2.5593 | 20500 | 0.0041 |
| 2.6217 | 21000 | 0.0040 |
| 2.6841 | 21500 | 0.0040 |
| 2.7466 | 22000 | 0.0040 |
| 2.8090 | 22500 | 0.0039 |
| 2.8714 | 23000 | 0.0039 |
| 2.9338 | 23500 | 0.0040 |
| 2.9963 | 24000 | 0.0039 |
| 3.0 | 24030 | - |
| 3.0587 | 24500 | 0.0038 |
| 3.1211 | 25000 | 0.0038 |
| 3.1835 | 25500 | 0.0038 |
| 3.2459 | 26000 | 0.0038 |
| 3.3084 | 26500 | 0.0038 |
| 3.3708 | 27000 | 0.0037 |
| 3.4332 | 27500 | 0.0037 |
| 3.4956 | 28000 | 0.0037 |
| 3.5581 | 28500 | 0.0038 |
| 3.6205 | 29000 | 0.0037 |
| 3.6829 | 29500 | 0.0037 |
| 3.7453 | 30000 | 0.0038 |
| 3.8077 | 30500 | 0.0037 |
| 3.8702 | 31000 | 0.0037 |
| 3.9326 | 31500 | 0.0036 |
| 3.9950 | 32000 | 0.0036 |
| 4.0 | 32040 | - |
| 4.0574 | 32500 | 0.0036 |
| 4.1199 | 33000 | 0.0035 |
| 4.1823 | 33500 | 0.0036 |
| 4.2447 | 34000 | 0.0035 |
| 4.3071 | 34500 | 0.0036 |
| 4.3695 | 35000 | 0.0036 |
| 4.4320 | 35500 | 0.0035 |
| 4.4944 | 36000 | 0.0036 |
| 4.5568 | 36500 | 0.0035 |
| 4.6192 | 37000 | 0.0035 |
| 4.6816 | 37500 | 0.0035 |
| 4.7441 | 38000 | 0.0035 |
| 4.8065 | 38500 | 0.0035 |
| 4.8689 | 39000 | 0.0035 |
| 4.9313 | 39500 | 0.0035 |
| 4.9938 | 40000 | 0.0035 |
| 5.0 | 40050 | - |
| 5.0562 | 40500 | 0.0034 |
| 5.1186 | 41000 | 0.0034 |
| 5.1810 | 41500 | 0.0034 |
| 5.2434 | 42000 | 0.0034 |
| 5.3059 | 42500 | 0.0035 |
| 5.3683 | 43000 | 0.0034 |
| 5.4307 | 43500 | 0.0034 |
| 5.4931 | 44000 | 0.0034 |
| 5.5556 | 44500 | 0.0034 |
| 5.6180 | 45000 | 0.0034 |
| 5.6804 | 45500 | 0.0033 |
| 5.7428 | 46000 | 0.0033 |
| 5.8052 | 46500 | 0.0034 |
| 5.8677 | 47000 | 0.0033 |
| 5.9301 | 47500 | 0.0034 |
| 5.9925 | 48000 | 0.0033 |
| 6.0 | 48060 | - |
| 6.0549 | 48500 | 0.0033 |
| 6.1174 | 49000 | 0.0033 |
| 6.1798 | 49500 | 0.0033 |
| 6.2422 | 50000 | 0.0033 |
| 6.3046 | 50500 | 0.0033 |
| 6.3670 | 51000 | 0.0033 |
| 6.4295 | 51500 | 0.0033 |
| 6.4919 | 52000 | 0.0033 |
| 6.5543 | 52500 | 0.0032 |
| 6.6167 | 53000 | 0.0032 |
| 6.6792 | 53500 | 0.0032 |
| 6.7416 | 54000 | 0.0032 |
| 6.8040 | 54500 | 0.0033 |
| 6.8664 | 55000 | 0.0033 |
| 6.9288 | 55500 | 0.0033 |
| 6.9913 | 56000 | 0.0032 |
| 7.0 | 56070 | - |
| 7.0537 | 56500 | 0.0033 |
| 7.1161 | 57000 | 0.0033 |
| 7.1785 | 57500 | 0.0032 |
| 7.2409 | 58000 | 0.0032 |
| 7.3034 | 58500 | 0.0032 |
| 7.3658 | 59000 | 0.0031 |
| 7.4282 | 59500 | 0.0032 |
| 7.4906 | 60000 | 0.0032 |
| 7.5531 | 60500 | 0.0032 |
| 7.6155 | 61000 | 0.0032 |
| 7.6779 | 61500 | 0.0032 |
| 7.7403 | 62000 | 0.0032 |
| 7.8027 | 62500 | 0.0032 |
| 7.8652 | 63000 | 0.0032 |
| 7.9276 | 63500 | 0.0032 |
| 7.9900 | 64000 | 0.0031 |
| 8.0 | 64080 | - |
1@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}