Views
No views yet
SentenceTransformer(
(0): Transformer({'max_seq_length': 512, 'do_lower_case': False, 'architecture': 'PeftModelForFeatureExtraction'})
(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})
(2): Dense({'in_features': 768, 'out_features': 3072, 'bias': False, 'activation_function': 'torch.nn.modules.linear.Identity'})
(3): Dense({'in_features': 3072, 'out_features': 768, 'bias': False, 'activation_function': 'torch.nn.modules.linear.Identity'})
(4): Normalize()
)pip install -U sentence-transformers1from sentence_transformers import SentenceTransformer
2
3# Download from the 🤗 Hub
4model = SentenceTransformer("sentence_transformers_model_id")
5# Run inference
6sentences = [
7 "TITLE: Essentialism: The Disciplined Pursuit of Less\nGENRES: business, fiction, nonfiction, philosophy, self-help\nAUTHORS: Greg McKeown\nDESCRIPTION: Have you ever found yourself stretched too thin? Do you simultaneously feel overworked and underutilized? Are you often busy but not productive? Do you feel like your time is constantly being hijacked by other people's agendas? If you answered yes to any of these, the way out is the Way of the Essentialist. The Way of the Essentialist isn't about getting more done in less time. It's about getting only the right thingsdone. It is not a time management strategy, or a productivity technique. It is a systematic disciplinefor discerning what is absolutely essential, then eliminating everything that is not, so we can make the highest possible contribution towards the things that really matter. By forcing us to apply a more selective criteria for what is Essential, the disciplined pursuit of less empowers us to reclaim control of our own choices about where to spend our precious time and energy - instead of giving others the implicit permission to choose for us. Essentialism is not one more thing - it's a whole new way of doing everything. A must-read for any leader, manager, or individual who wants to learn who to do less, but better, in every area of their lives, Essentialism is a movement whose time has come.",
8 'TITLE: The One Thing: The Surprisingly Simple Truth Behind Extraordinary Results\nGENRES: business, fiction, nonfiction, philosophy, self-help\nAUTHORS: Gary Keller, Jay Papasan\nDESCRIPTION: The One Thingexplains the success habit to overcome the six lies that block our success, beat the seven thieves that steal time, and leverage the laws of purpose, priority, and productivity.',
9 'TITLE: Smarter than Squirrels\nGENRES: adventure, children, fantasy, fiction, middle grade, young adult\nAUTHORS: Lucy Nolan, Mike Reed\nDESCRIPTION: THE HILARIOUS ADVENTURES OF TWO CONFUSED CANINES Down Girl and Sit are two dogs who are "smarter than squirrels." They know how to protect their masters from all the things that can go wrong in the neighborhood: they bark at paperboys and guard the garbage cans, and keep mischievous squirrels at bay. But when Here Kitty Kitty moves in next door, their daily routines are turned topsy-turvy. Filled with humor and adventure, this illustrated chapter book takes a look at life in the backyard from the well-intentioned but misguided viewpoint of man\'s best friend.',
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)
18# tensor([[1.0010, 0.8911, 0.1610],
19# [0.8911, 1.0010, 0.2207],
20# [0.1610, 0.2207, 1.0000]], dtype=torch.float16)anchor_text and positive_text| anchor_text | positive_text | |
|---|---|---|
| type | string | string |
| details |
|
|
| anchor_text | positive_text |
|---|---|
TITLE: The View from the Cheap Seats: Selected Nonfiction[object Object]GENRES: biography, contemporary, fantasy, fiction, horror, memoir, nonfiction, philosophy, science, science fiction[object Object]AUTHORS: Neil Gaiman[object Object]DESCRIPTION: An enthralling collection of nonfiction essays on myriad topics--from art and artists to dreams, myths, and memories--observed in Neil Gaiman's probing, amusing, and distinctive style. An inquisitive observer, thoughtful commentator, and assiduous craftsman, Neil Gaiman has long been celebrated for the sharp intellect and startling imagination that informs his bestselling fiction. Now, The View from the Cheap Seats brings together for the first time ever more than sixty pieces of his outstanding nonfiction. Analytical yet playful, erudite yet accessible, this cornucopia explores a broad range of interests and topics, including (but not limited to): authors past and present; music; storytelling; comics; bookshops; travel; fairy tales; America; inspiration; libraries; ghosts; and the... | TITLE: The Art of Asking; or, How I Learned to Stop Worrying and Let People Help[object Object]GENRES: biography, business, contemporary, fiction, memoir, nonfiction, philosophy, self-help[object Object]AUTHORS: Amanda Palmer[object Object]DESCRIPTION: Rock star, crowdfunding pioneer, and TED speaker Amanda Palmer knows all about asking. Performing as a living statue in a wedding dress, she wordlessly asked thousands of passersby for their dollars. When she became a singer, songwriter, and musician, she was not afraid to ask her audience to support her as she surfed the crowd (and slept on their couches while touring). And when she left her record label to strike out on her own, she asked her fans to support her in making an album, leading to the world's most successful music Kickstarter. Even while Amanda is both celebrated and attacked for her fearlessness in asking for help, she finds that there are important things she cannot ask for-as a musician, as a friend, and as a wife. She learns that she isn't alone in this, that s... |
TITLE: Styxx (Dark-Hunter, #22)[object Object]GENRES: adventure, contemporary, fantasy, fiction, horror, paranormal, romance, science, science fiction, urban fantasy[object Object]AUTHORS: Sherrilyn Kenyon[object Object]DESCRIPTION: Just when you thought doomsday was over... Centuries ago Acheron saved the human race by imprisoning an ancient evil bent on absolute destruction. Now that evil has been unleashed and it is out for revenge. As the twin to Acheron, Styxx hasn't always been on his brother's side. They've spent more centuries going at each other's throats than protecting their backs. Now Styxx has a chance to prove his loyalty to his brother, but only if he's willing to trade his life and future for Acheron's. The Atlantean goddess of Wrath and Misery, Bethany was born to right wrongs. But it was never a task she relished. Until now. She owes Acheron a debt that she vows to repay, no matter what it takes. He will join their fellow gods in hell and nothing is going to stop her. But things are never what they seem, and ... | TITLE: Dark Skye (Immortals After Dark, #15)[object Object]GENRES: adventure, contemporary, fantasy, fiction, paranormal, romance, urban fantasy[object Object]AUTHORS: Kresley Cole[object Object]DESCRIPTION: In this highly anticipated fifteenth novel in the Immortals After Darkseries, #1 New York Timesbestselling author Kresley Cole spins a sultry tale of a mighty warrior scarred inside and out and the beguiling sorceress with the power to heal him--or vanquish him forever. ETERNAL OBSESSION As a boy, Thronos, prince of Skye Hall, loved Lanthe, a mischievous Sorceri girl who made him question everything about his Vrekener clan. But when the two got caught in the middle of their families' war, tragedy struck, leaving Thronos and Lanthe bitter enemies. Though centuries have passed, nothing can cool his seething need for the beautiful enchantress who scarred his body--and left an even deeper impression on his soul. ENDLESS YEARNING Lanthe, a once-formidable sorceress struggling to reclaim her gifts, searches for love and acceptan... |
TITLE: Marked (Dark Protectors, #7)[object Object]GENRES: contemporary, fantasy, fiction, paranormal, romance, science fiction, urban fantasy[object Object]AUTHORS: Rebecca Zanetti[object Object]DESCRIPTION: Janie Kayrs has known Zane almost her whole life. He was her friend in the dream world. She trusted him. But that was before he kidnapped her, spiriting her away to an isolated cabin to learn what her dreams never told her. Like how dangerous he looks. How he got on the wrong side of the negotiating table. And how much sexier he is in real life... Zane is a battle-hardened warrior, used to command and solitude. But Janie has drawn him from the minute they met. His need for her could destroy everything he's worked for, but the risk is too sweet not to take it. They call her the Chosen One. But when it comes down to the questions of peace or war, life or death, safety or passion, it will be Janie who makes the choice... | TITLE: Dark Skye (Immortals After Dark, #15)[object Object]GENRES: adventure, contemporary, fantasy, fiction, paranormal, romance, urban fantasy[object Object]AUTHORS: Kresley Cole[object Object]DESCRIPTION: In this highly anticipated fifteenth novel in the Immortals After Darkseries, #1 New York Timesbestselling author Kresley Cole spins a sultry tale of a mighty warrior scarred inside and out and the beguiling sorceress with the power to heal him--or vanquish him forever. ETERNAL OBSESSION As a boy, Thronos, prince of Skye Hall, loved Lanthe, a mischievous Sorceri girl who made him question everything about his Vrekener clan. But when the two got caught in the middle of their families' war, tragedy struck, leaving Thronos and Lanthe bitter enemies. Though centuries have passed, nothing can cool his seething need for the beautiful enchantress who scarred his body--and left an even deeper impression on his soul. ENDLESS YEARNING Lanthe, a once-formidable sorceress struggling to reclaim her gifts, searches for love and acceptan... |
MultipleNegativesRankingLoss with these parameters:
1{
2 "scale": 20.0,
3 "similarity_fct": "cos_sim",
4 "gather_across_devices": false
5}anchor_text and positive_text| anchor_text | positive_text | |
|---|---|---|
| type | string | string |
| details |
|
|
| anchor_text | positive_text |
|---|---|
TITLE: White Pine[object Object]GENRES: children, fiction, historical fiction, history, middle grade, young adult[object Object]AUTHORS: Caroline Akervik[object Object]DESCRIPTION: White Pine is an historical fiction set in the nineteenth century. After Sevy Anderson's father breaks his leg in a sawmill accident, the fourteen-year-old must take his place with the rough and tumble lumberjacks and river rats who harvest the white pine forests of Wisconsin. The men of the Northwoods live hard and on the edge, and Sevy must prove his courage and his worth in the company of legends. Will he become the man he so longs to be? Will the other men ever accept him? And will he even survive his first winter in the Northwoods? | TITLE: Pia the Penguin Fairy (Rainbow Magic: Ocean Fairies, #3)[object Object]GENRES: children, fantasy, fiction, middle grade[object Object]AUTHORS: Daisy Meadows, Georgie Ripper[object Object]DESCRIPTION: The Ocean Fairies keep all the sea creatures safe and happy -- until their magic goes missing! This is our eleventh group of Rainbow Magic fairies. The Ocean Fairies keep all the sea creatures safe and happy! But when the goblins shatter their enchanted conch shell, seven magical sea creatures leave to search for the pieces. The Ocean Fairies must find the shells . . . and their animal friends! Rachel and Kirsty are off to the South Pole! Pia the Penguin Fairy's penguin, Scamp, is somewhere in the chilly waters --- but where? Find the missing creature in each book and help save the ocean magic! |
TITLE: Skin Game (The Dresden Files, #15)[object Object]GENRES: adventure, contemporary, crime, fantasy, fiction, horror, mystery, paranormal, romance, science, science fiction, thriller, urban fantasy[object Object]AUTHORS: Jim Butcher[object Object]DESCRIPTION: Harry Dresden, Chicago's only professional wizard, is about to have a very bad day.... Because as Winter Knight to the Queen of Air and Darkness, Harry never knows what the scheming Mab might want him to do. Usually, it's something awful. He doesn't know the half of it.... Mab has just traded Harry's skills to pay off one of her debts. And now he must help a group of supernatural villains--led by one of Harry's most dreaded and despised enemies, Nicodemus Archleone--to break into the highest-security vault in town so that they can then access the highest-security vault in the Nevernever. It's a smash-and-grab job to recover the literal Holy Grail from the vaults of the greatest treasure hoard in the supernatural world--which belongs to the one and only Hades, Lord of ... | TITLE: Hunted (The Iron Druid Chronicles, #6)[object Object]GENRES: adventure, contemporary, fantasy, fiction, mystery, paranormal, romance, science, science fiction, thriller, urban fantasy, young adult[object Object]AUTHORS: Kevin Hearne[object Object]DESCRIPTION: For a two-thousand-year-old Druid, Atticus O'Sullivan is a pretty fast runner. Good thing, because he's being chased by not one but two goddesses of the hunt--Artemis and Diana--for messing with one of their own. Dodging their slings and arrows, Atticus, Granuaile, and his wolfhound Oberon are making a mad dash across modern-day Europe to seek help from a friend of the Tuatha De Danann. His usual magical option of shifting planes is blocked, so instead of playing hide-and-seek, the game plan is . . . run like hell. Crashing the pantheon marathon is the Norse god Loki. Killing Atticus is the only loose end he needs to tie up before unleashing Ragnarok--AKA the Apocalypse. Atticus and Granuaile have to outfox the Olympians and contain the god of mischief if they want... |
TITLE: Slow Curve on the Coquihalla (A Hunter Rayne Highway Mystery, #1)[object Object]GENRES: crime, fiction, mystery, thriller[object Object]AUTHORS: R.E. Donald[object Object]DESCRIPTION: When a well respected truck driver, the owner of a family trucking business, is found dead in his truck down a steep embankment along the Coquihalla highway that winds through the mountains in British Columbia, his distraught daughter wants to know how and why he died. Not long afterwards, while driving the same highway, her husband's brakes are tampered with, almost creating another fatal accident on a treacherous incline, This compels Hunter Rayne, a fellow trucker and retired RCMP detective, to help her find answers. As he uncovers signs of illegal cross border activity originating in a Seattle warehouse, Hunter recruits an old friend, an outlaw biker, to infiltrate what appears to be an international smuggling ring. But while Hunter follows up clues and waits for critical information from his old friend, the wily biker starts to play h... | TITLE: The Rock Star[object Object]GENRES: crime, fiction, horror, mystery, romance, thriller[object Object]AUTHORS: Rick Soper[object Object]DESCRIPTION: Jake Martin saves rock star Jimi Christian from drowning on a California beach, and triggers a wave of unintended consequences... Injured FBI Special Agent Jon Stevens is back on the job, with a broken skull, a broken spirit and a ritualistic murder case only his talents can solve... And a vigilante begins targeting celebrities he deems worthy of his own savage brand of justice. What ties them all together? A revenge served so cold and so calculating that it uses everyone from opportunistic Russians, corrupt businessmen, an agoraphobic hacker--to a rock super star--to reach its goal. [object Object] is the first thrilling book in the [object Object] trilogy. |
MultipleNegativesRankingLoss with these parameters:
1{
2 "scale": 20.0,
3 "similarity_fct": "cos_sim",
4 "gather_across_devices": false
5}eval_strategy: stepsper_device_train_batch_size: 64per_device_eval_batch_size: 256gradient_accumulation_steps: 4learning_rate: 2e-05warmup_ratio: 0.1dataloader_num_workers: 2remove_unused_columns: Falseprompts: {'anchor_text': '', 'positive_text': ''}batch_sampler: no_duplicatesoverwrite_output_dir: Falsedo_predict: Falseeval_strategy: stepsprediction_loss_only: Trueper_device_train_batch_size: 64per_device_eval_batch_size: 256per_gpu_train_batch_size: Noneper_gpu_eval_batch_size: Nonegradient_accumulation_steps: 4eval_accumulation_steps: Nonetorch_empty_cache_steps: Nonelearning_rate: 2e-05weight_decay: 0.0adam_beta1: 0.9adam_beta2: 0.999adam_epsilon: 1e-08max_grad_norm: 1.0num_train_epochs: 3.0max_steps: -1lr_scheduler_type: linearlr_scheduler_kwargs: Nonewarmup_ratio: 0.1warmup_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: 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: 2dataloader_prefetch_factor: Nonepast_index: -1disable_tqdm: Falseremove_unused_columns: Falselabel_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}parallelism_config: Nonedeepspeed: Nonelabel_smoothing_factor: 0.0optim: adamw_torch_fusedoptim_args: Noneadafactor: Falsegroup_by_length: Falselength_column_name: lengthproject: huggingfacetrackio_space_id: trackioddp_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: Nonehub_always_push: Falsehub_revision: Nonegradient_checkpointing: Falsegradient_checkpointing_kwargs: Noneinclude_inputs_for_metrics: Falseinclude_for_metrics: []eval_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: Noneinclude_tokens_per_second: Falseinclude_num_input_tokens_seen: noneftune_noise_alpha: Noneoptim_target_modules: Nonebatch_eval_metrics: Falseeval_on_start: Falseuse_liger_kernel: Falseliger_kernel_config: Noneeval_use_gather_object: Falseaverage_tokens_across_devices: Trueprompts: {'anchor_text': '', 'positive_text': ''}batch_sampler: no_duplicatesmulti_dataset_batch_sampler: proportionalrouter_mapping: {}learning_rate_mapping: {}| Epoch | Step | Training Loss |
|---|---|---|
| 0.1282 | 10 | 2.9737 |
| 0.2564 | 20 | 2.6733 |
| 0.3846 | 30 | 2.3228 |
| 0.5128 | 40 | 2.1395 |
| 0.6410 | 50 | 2.0539 |
| 0.7692 | 60 | 1.9516 |
| 0.8974 | 70 | 1.917 |
| 1.0256 | 80 | 1.9625 |
| 1.1538 | 90 | 1.8804 |
| 1.2821 | 100 | 1.8654 |
| 1.4103 | 110 | 1.8209 |
| 1.5385 | 120 | 1.8294 |
| 1.6667 | 130 | 1.8817 |
| 1.7949 | 140 | 1.9176 |
| 1.9231 | 150 | 1.9241 |
| 2.0513 | 160 | 1.9469 |
| 2.1795 | 170 | 1.8467 |
| 2.3077 | 180 | 1.8364 |
| 2.4359 | 190 | 1.8705 |
| 2.5641 | 200 | 1.8142 |
| 2.6923 | 210 | 1.8757 |
| 2.8205 | 220 | 1.8214 |
| 2.9487 | 230 | 1.8332 |
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{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}