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-k1-fixed-euclidean")
5# Run inference
6sentences = [
7 'I’ve purchased and used this filter several times and have never had any issues-until recently. This last one I received has been horrible! I installed and made sure it was locked into place. Ran about a gallon of water through and the water smells! and tastes like dirt/chemical! The water however is crystal clear but just horrible. I’m so disappointed considering I drink water constantly and was relying on what I thought was a quality product that had been consistent until now.',
8 'I ordered two of these. One came broken. It was packaged okay, so I believe it was broken due to the mail carrier tossing it onto my porch. The one that did not break, I love. It looks nice on my counter and serves its purpose. Updated review: Ok so the salt cellar that did not break during shipping pretty much shattered at the lightest touch after 3 weeks on my counter. I can no longer recommend this item, clearly they are not very durable at all.',
9 'Seems to protect well, feels nice, just wish it would stick a bit better. The first one would not stay applied. Kept peeling from the top no matter what I did. I figured it could be my error, so I removed and cleaned the screen very well with additional alcohol wipes. The second one has been on a few days, but is starting to peel from a different spot. I love the feel of the protector otherwise.',
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.9991, 0.9986],
19# [0.9991, 1.0000, 0.9976],
20# [0.9986, 0.9976, 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 two of these. One came broken. It was packaged okay, so I believe it was broken due to the mail carrier tossing it onto my porch. The one that did not break, I love. It looks nice on my counter and serves its purpose. Updated review: Ok so the salt cellar that did not break during shipping pretty much shattered at the lightest touch after 3 weeks on my counter. I can no longer recommend this item, clearly they are not very durable at all. | [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. | Seems to protect well, feels nice, just wish it would stick a bit better. The first one would not stay applied. Kept peeling from the top no matter what I did. I figured it could be my error, so I removed and cleaned the screen very well with additional alcohol wipes. The second one has been on a few days, but is starting to peel from a different spot. I love the feel of the protector otherwise. | [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. | For the price these are ok. They look nice. The fact is though after working a 9 hour day, I'm in pain. I'm not sure why, but the fit seems fine. Maybe it's the material? Feels like I wore a sandpaper strap around my ribcage. My husband opened the package and took all the tags off, so it isn't worth trying to return. :-( | [0.0, 0.5] |
[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.5118 | 500 | 0.6163 |
| 1.0 | 977 | - |
| 1.0235 | 1000 | 0.1562 |
| 1.5353 | 1500 | 0.1447 |
| 2.0 | 1954 | - |
| 2.0471 | 2000 | 0.1396 |
| 2.5589 | 2500 | 0.1360 |
| 3.0 | 2931 | - |
| 3.0706 | 3000 | 0.1336 |
| 3.5824 | 3500 | 0.1318 |
| 4.0 | 3908 | - |
| 4.0942 | 4000 | 0.1301 |
| 4.6059 | 4500 | 0.1291 |
| 5.0 | 4885 | - |
| 5.1177 | 5000 | 0.1282 |
| 5.6295 | 5500 | 0.1271 |
| 6.0 | 5862 | - |
| 6.1412 | 6000 | 0.1267 |
| 6.6530 | 6500 | 0.1261 |
| 7.0 | 6839 | - |
| 7.1648 | 7000 | 0.1256 |
| 7.6766 | 7500 | 0.1251 |
| 8.0 | 7816 | - |
| 8.1883 | 8000 | 0.1247 |
| 8.7001 | 8500 | 0.1243 |
| 9.0 | 8793 | - |
| 9.2119 | 9000 | 0.1242 |
| 9.7236 | 9500 | 0.1241 |
| 10.0 | 9770 | - |
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}