Views
No views yet
SentenceTransformer(
(0): StaticEmbedding({})
)pip install -U sentence-transformers1from sentence_transformers import SentenceTransformer
2
3# Download from the 🤗 Hub
4model = SentenceTransformer("LocalWisdom/PurpleStatic")
5# Run inference
6sentences = [
7 'How do you write a song?',
8 'How do I write a song?',
9 'How did Portugal become an independent country from Spain?',
10]
11embeddings = model.encode(sentences)
12print(embeddings.shape)
13# [3, 1024]
14
15# Get the similarity scores for the embeddings
16similarities = model.similarity(embeddings, embeddings)
17print(similarities)
18# tensor([[1.0000, 0.8566, 0.1409],
19# [0.8566, 1.0000, 0.1259],
20# [0.1409, 0.1259, 1.0000]])anchor and positive| anchor | positive | |
|---|---|---|
| type | string | string |
| modality | text | text |
| details |
|
|
| anchor | positive |
|---|---|
Of our total net revenue of $10.8 billion in the fiscal year ended October 31, 2000, we generated 44.2% in the United States and 55.8% internationally. | In the fiscal year concluding October 31, 2000, the company produced 44.2% of its $10.8 billion total net revenue within the United States and 55.8% from international markets. |
Our sales strategy is to sell to and service our largest accounts (hospital and corporate business) directly while employing third-party distributors and manufacturer's representatives for smaller or more geographically dispersed countries. | We utilize a sales approach where we directly manage and sell to our major hospital and corporate clients, while relying on external distributors and manufacturer agents to reach smaller markets or those in remote locations. |
In August 2000, we announced a restructuring of our healthcare solutions business. | The company declared a reorganization of its healthcare solutions division in August 2000. |
MatryoshkaLoss with these parameters:
1{
2 "loss": "MultipleNegativesRankingLoss",
3 "matryoshka_dims": [
4 1024,
5 768,
6 512,
7 256,
8 128,
9 64,
10 32
11 ],
12 "matryoshka_weights": [
13 1,
14 1,
15 1,
16 1,
17 1,
18 1,
19 1
20 ],
21 "n_dims_per_step": -1
22}anchor and positive| anchor | positive | |
|---|---|---|
| type | string | string |
| modality | text | text |
| details |
|
|
| anchor | positive |
|---|---|
Astrology: I am a Capricorn Sun Cap moon and cap rising...what does that say about me? | I'm a triple Capricorn (Sun, Moon and ascendant in Capricorn) What does this say about me? |
How can I be a good geologist? | What should I do to be a great geologist? |
How do I read and find my YouTube comments? | How can I see all my Youtube comments? |
MatryoshkaLoss with these parameters:
1{
2 "loss": "MultipleNegativesRankingLoss",
3 "matryoshka_dims": [
4 1024,
5 768,
6 512,
7 256,
8 128,
9 64,
10 32
11 ],
12 "matryoshka_weights": [
13 1,
14 1,
15 1,
16 1,
17 1,
18 1,
19 1
20 ],
21 "n_dims_per_step": -1
22}anchor and positive| anchor | positive | |
|---|---|---|
| type | string | string |
| modality | text | text |
| details |
|
|
| anchor | positive |
|---|---|
name current finance minister of pakistan | identify the present finance minister of pakistan |
name current finance minister of pakistan | who is pakistan's finance minister right now |
name current finance minister of pakistan | state the name of the current pakistani minister of finance |
MatryoshkaLoss with these parameters:
1{
2 "loss": "MultipleNegativesRankingLoss",
3 "matryoshka_dims": [
4 1024,
5 768,
6 512,
7 256,
8 128,
9 64,
10 32
11 ],
12 "matryoshka_weights": [
13 1,
14 1,
15 1,
16 1,
17 1,
18 1,
19 1
20 ],
21 "n_dims_per_step": -1
22}anchor and positives| anchor | positives | |
|---|---|---|
| type | string | string |
| modality | text | text |
| details |
|
|
| anchor | positives |
|---|---|
The arrangement of halftone dots or grid that encodes tonal values in a halftone image. | The halftone dot grid encodes tonal levels. |
A formal subset of managers designated to handle day-to-day operations and implement board decisions. | The executive team meets monthly to review progress and adjust plans. |
niche market segment | submarket |
MatryoshkaLoss with these parameters:
1{
2 "loss": "MultipleNegativesRankingLoss",
3 "matryoshka_dims": [
4 1024,
5 768,
6 512,
7 256,
8 128,
9 64,
10 32
11 ],
12 "matryoshka_weights": [
13 1,
14 1,
15 1,
16 1,
17 1,
18 1,
19 1
20 ],
21 "n_dims_per_step": -1
22}anchor, positives, negatives_1, and negatives_2| anchor | positives | negatives_1 | negatives_2 | |
|---|---|---|---|---|
| type | string | string | string | string |
| modality | text | text | text | text |
| details |
|
|
|
|
| anchor | positives | negatives_1 | negatives_2 |
|---|---|---|---|
Field interviews revealed a stony demeanor even when pressed for clarification. | Field interviews revealed a stoic demeanor even when pressed for clarification. | Field interviews revealed a warm demeanor even when pressed for clarification. | Field interviews revealed an empathetic demeanor even when pressed for clarification. |
The board followed formal protocol during the review. | The board followed official protocol during the review. | The board followed casual protocol during the review. | The board followed informal protocol during the review. |
The athlete carefully inspected the luge before the final run. | The athlete carefully inspected the toboggan before the final run. | The athlete carefully inspected the sled before the final run. | The athlete carefully inspected the bobsled before the final run. |
MatryoshkaLoss with these parameters:
1{
2 "loss": "MultipleNegativesRankingLoss",
3 "matryoshka_dims": [
4 1024,
5 768,
6 512,
7 256,
8 128,
9 64,
10 32
11 ],
12 "matryoshka_weights": [
13 1,
14 1,
15 1,
16 1,
17 1,
18 1,
19 1
20 ],
21 "n_dims_per_step": -1
22}per_device_train_batch_size: 4096num_train_epochs: 20learning_rate: 0.0001warmup_steps: 0.1bf16: Truebatch_sampler: no_duplicatesper_device_train_batch_size: 4096num_train_epochs: 20max_steps: -1learning_rate: 0.0001lr_scheduler_type: linearlr_scheduler_kwargs: Nonewarmup_steps: 0.1optim: adamw_torch_fusedoptim_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: Truefp16: 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: Falseignore_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: no_duplicatesmulti_dataset_batch_sampler: proportionalrouter_mapping: {}learning_rate_mapping: {}| Epoch | Step | Training Loss |
|---|---|---|
| 0.0009 | 1 | 61.4605 |
| 0.9346 | 1000 | 45.8318 |
| 0.0009 | 1 | 60.6387 |
| 0.9346 | 1000 | 45.0978 |
| 1.8692 | 2000 | 44.8278 |
| 2.8037 | 3000 | 43.0278 |
| 3.7383 | 4000 | 41.6984 |
| 0.0009 | 1 | 55.3998 |
| 4.6729 | 5000 | 40.7913 |
| 5.6075 | 6000 | 40.1543 |
| 6.5421 | 7000 | 38.1761 |
| 7.4766 | 8000 | 38.8003 |
| 8.4112 | 9000 | 38.2068 |
| 9.3458 | 10000 | 37.4088 |
| 10.2804 | 11000 | 36.5805 |
| 11.2150 | 12000 | 37.1526 |
| 12.1495 | 13000 | 36.0028 |
| 13.0841 | 14000 | 35.2225 |
| 14.0187 | 15000 | 36.2388 |
| 14.9533 | 16000 | 35.1998 |
| 15.8879 | 17000 | 35.2619 |
| 16.8224 | 18000 | 35.1943 |
| 17.7570 | 19000 | 36.0396 |
| 18.6916 | 20000 | 34.2574 |
| 19.6262 | 21000 | 35.1139 |
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}1@misc{kusupati2024matryoshka,
2 title={Matryoshka Representation Learning},
3 author={Aditya Kusupati and Gantavya Bhatt and Aniket Rege and Matthew Wallingford and Aditya Sinha and Vivek Ramanujan and William Howard-Snyder and Kaifeng Chen and Sham Kakade and Prateek Jain and Ali Farhadi},
4 year={2024},
5 eprint={2205.13147},
6 archivePrefix={arXiv},
7 primaryClass={cs.LG}
8}1@misc{oord2019representationlearningcontrastivepredictive,
2 title={Representation Learning with Contrastive Predictive Coding},
3 author={Aaron van den Oord and Yazhe Li and Oriol Vinyals},
4 year={2019},
5 eprint={1807.03748},
6 archivePrefix={arXiv},
7 primaryClass={cs.LG},
8 url={https://arxiv.org/abs/1807.03748},
9}