Views
No views yet
SentenceTransformer(
(0): Transformer({'max_seq_length': 512, 'do_lower_case': False, 'architecture': 'Qwen3Model'})
(1): Pooling({'word_embedding_dimension': 2560, 'pooling_mode_cls_token': False, 'pooling_mode_mean_tokens': False, 'pooling_mode_max_tokens': False, 'pooling_mode_mean_sqrt_len_tokens': False, 'pooling_mode_weightedmean_tokens': False, 'pooling_mode_lasttoken': True, 'include_prompt': True})
(2): Normalize()
)pip install -U sentence-transformers1from sentence_transformers import SentenceTransformer
2
3# Download from the 🤗 Hub
4model = SentenceTransformer("Chandan683/qwen3-embedding-4b-narrative-similarity-lora")
5# Run inference
6sentences = [
7 "A brilliant but reckless scientist working for a major pharmaceutical corporation accidentally exposes herself to an experimental serum during a late-night laboratory incident. Initially experiencing severe illness, she gradually discovers that the serum has granted her the ability to heal others through physical contact, though using her powers causes her significant physical pain. When her former employer attempts to weaponize her abilities and capture her for further experimentation, she is forced to go into hiding. With the help of a sympathetic journalist, she begins secretly treating terminally ill patients in underground clinics throughout the city. As corporate mercenaries close in on her location, she must decide whether to flee permanently or make a stand to protect the people who depend on her healing abilities. The film culminates in a confrontation at a children's hospital, where she fully embraces her role as a protector despite the personal cost. In the final scene, she adopts a new identity and continues her work from the shadows, having accepted her destiny as an unlikely healer-vigilante.",
8 'A gifted but impulsive researcher employed by a leading biotech conglomerate accidentally contaminates herself with a prototype compound during a midnight lab accident. After initially suffering from debilitating symptoms, she slowly realizes the compound has given her the power to cure diseases through direct skin contact, although each use inflicts excruciating agony upon her. When her previous company seeks to militarize her capabilities and abduct her for additional testing, she must retreat into the underground. Aided by a compassionate documentary filmmaker, she begins covertly healing dying patients in makeshift medical facilities across the metropolis. As corporate assassins track her movements, she faces a choice between permanent exile or standing her ground to safeguard those who rely on her curative touch. The story reaches its climax during a showdown at a pediatric medical center, where she fully accepts her mission as a guardian regardless of the personal sacrifice. The narrative concludes with her assuming a false identity while continuing her clandestine work, having embraced her fate as an unconventional healer-protector.',
9 "A former military medic turned food truck owner begins experiencing vivid prophetic dreams after moving to a small desert town plagued by unexplained equipment failures at its solar energy facility. When her dreams accurately predict a series of minor accidents, the facility's security chief recruits her to help prevent a catastrophic system meltdown she has foreseen. As they investigate the failing infrastructure, they discover that a disgruntled former engineer has been systematically sabotaging the plant to expose its safety violations to federal regulators. The medic realizes her final vision shows not the disaster itself, but the moment she must choose between exposing the truth about the plant's dangers or allowing the engineer's plan to proceed and potentially harm innocent workers. She ultimately decides to evacuate the facility and alert authorities to both the sabotage and the underlying safety issues, preventing casualties while ensuring the plant's problems are properly addressed. The film ends with her testifying before a congressional committee, having found purpose in using her unusual gift to serve the greater good rather than hiding from it.",
10]
11embeddings = model.encode(sentences)
12print(embeddings.shape)
13# [3, 2560]
14
15# Get the similarity scores for the embeddings
16similarities = model.similarity(embeddings, embeddings)
17print(similarities)
18# tensor([[1.0000, 0.8708, 0.6102],
19# [0.8708, 1.0000, 0.6047],
20# [0.6102, 0.6047, 1.0000]])anchor, positive, and negative| anchor | positive | negative | |
|---|---|---|---|
| type | string | string | string |
| details |
|
|
|
| anchor | positive | negative |
|---|---|---|
A mysterious individual, known only by their alias "The Wanderer", arrives in the small, rural town of Willow Creek, sparking curiosity and intrigue among its residents. The Wanderer, a woman with no discernible past or motivations, settles into a local boarding house and begins to integrate into the community. As the townspeople grow accustomed to her presence, they start to notice a series of subtle yet significant changes: abandoned buildings are repaired, neglected gardens are tended, and long-forgotten traditions are revived. The Wanderer's actions are met with a mix of gratitude and suspicion, with some viewing her as a benevolent force and others as a potential threat. As the weeks pass, the townspeople begin to uncover fragments of The Wanderer's past, hinting at a complex and troubled history. Tensions rise as the truth about her identity and intentions becomes increasingly unclear, leading to a confrontation that will determine the fate of Willow Creek and its enigmatic stran... | In the secluded hamlet of Ravenshire, a mysterious individual known as "The Traveler" emerges, captivating the attention of its residents. The Traveler, a woman shrouded in mystery, takes up residence in a local inn and gradually becomes an integral part of the community. As the townsfolk become accustomed to her presence, they notice a series of incremental improvements: long-deteriorated structures are restored, overgrown orchards are revitalized, and dormant customs are revived. The Traveler's actions elicit a range of reactions, with some perceiving her as a guardian angel and others as a potential danger. As the weeks unfold, the townspeople begin to uncover hints of The Traveler's past, suggesting a multifaceted and troubled history. As tensions escalate, the truth about her identity and intentions becomes increasingly ambiguous, culminating in a climactic confrontation that will decide the fate of Ravenshire and its enigmatic stranger. Ultimately, The Traveler's true purpose and... | In the coastal city of Tidal Cove, a reclusive figure known as "The Architect" emerges, captivating the attention of its residents. The Architect, a man with a talent for urban planning, begins to renovate abandoned waterfront properties and transform neglected public spaces, earning the gratitude of locals and tourists alike. However, as The Architect's projects gain momentum, he faces opposition from a group of powerful developers who seek to exploit the city's resources for their own gain. As tensions rise, The Architect's true identity and motivations are called into question, leading to a dramatic confrontation that exposes a decades-old conspiracy involving corruption, environmental degradation, and hidden agendas. The Architect's actions ultimately prompt the city to reevaluate its relationship with development and the environment, paving the way for a more sustainable future. Despite his successes, The Architect disappears as suddenly as he appeared, leaving behind a legacy and... |
A mysterious drifter arrives in the lawless frontier town of Red Hollow, where tensions between a ruthless land baron and struggling settlers have reached a boiling point. After witnessing the baron's enforcers intimidate locals, the drifter reluctantly intervenes, revealing exceptional gunslinging skills. The townsfolk rally around the drifter, who agrees to help them defend their land in exchange for information about a missing person tied to his past. As the baron escalates his tactics, the drifter trains the settlers in self-defense while uncovering secrets about the baron's rise to power. The conflict culminates in a dramatic shootout, during which the drifter confronts the baron and learns that his missing person was a victim of the baron's greed. With the baron defeated, the drifter declines the townsfolk's pleas to stay, riding off into the horizon to continue his search for redemption. | A lone wanderer arrives in the turbulent mining settlement of Iron Creek, where a greedy tycoon’s stranglehold on resources has left the struggling workers on the brink of revolt. After observing the tycoon’s hired thugs terrorize the community, the wanderer steps in reluctantly, displaying remarkable combat skills. Inspired, the miners plead for the wanderer’s help in resisting the tycoon, and he agrees in exchange for clues about a loved one lost years ago. As the tycoon tightens his grip, the wanderer trains the miners to defend themselves and uncovers the dark history behind the tycoon’s corrupt empire. The tension builds to a climactic confrontation, during which the wanderer faces the tycoon and discovers that his lost loved one fell victim to the tycoon’s ruthless ambition. With the tycoon defeated, the miners beg the wanderer to stay and lead them, but he declines, riding off alone to continue his journey toward closure. | In a sprawling, rain-soaked city, a quiet mechanic named Lena stumbles upon a coded message hidden in the engine of a luxury car belonging to a powerful corporate magnate. The message hints at a secret plan to displace hundreds of residents from a crumbling district in order to construct a high-tech headquarters. Haunted by memories of her own family's eviction years ago, Lena reluctantly teams up with a small group of activists who are desperate to stop the project. Using her engineering expertise, she sabotages construction equipment and leaks incriminating documents to the press. As the magnate retaliates with legal threats and hired enforcers, Lena uncovers evidence that the project’s funding is tied to a shadowy network exploiting vulnerable workers. In a final act of defiance, Lena orchestrates a citywide blackout, crippling the magnate's operations. The activists celebrate their small victory, but Lena quietly walks away, leaving behind the tools she once used to fix machines, n... |
A team of paranormal investigators, led by seasoned medium Claire, is summoned to an abandoned asylum rumored to be haunted by the spirits of its former patients. Upon their arrival, the group sets up equipment to capture evidence of supernatural activity. As night falls, they experience a series of unsettling phenomena, including disembodied whispers and unexplained shadows. Tensions rise when one team member, Mark, becomes possessed by a malevolent spirit, causing chaos among the group. Claire must confront her own traumatic past to save Mark and uncover the asylum's dark history. As they delve deeper, they discover a hidden chamber containing remnants of unethical experiments conducted on the patients. In a climactic confrontation, Claire faces the spirit responsible for the torment, ultimately freeing the trapped souls and restoring peace to the asylum. The film concludes with the team leaving the site, forever changed by their harrowing experience. | A group of spectral researchers, led by experienced clairvoyant Lydia, is called to an abandoned hospital believed to be haunted by the souls of its former inhabitants. Upon their arrival, the team sets up devices to document any supernatural occurrences. As darkness envelops the building, they encounter a series of eerie events, including distant voices and mysterious apparitions. Tensions escalate when one member, Jacob, becomes overtaken by a vengeful entity, creating turmoil within the group. Lydia is compelled to confront her own haunted history to rescue Jacob and unveil the hospital's sinister past. As they investigate further, they uncover a concealed room filled with evidence of inhumane experiments performed on the residents. In a gripping showdown, Lydia confronts the entity behind the suffering, ultimately liberating the anguished spirits and bringing solace to the hospital. The story concludes with the team departing from the site, forever altered by their chilling ordeal. | In a bustling modern city, a group of amateur urban explorers, led by the charismatic Leo, stumbles upon a long-forgotten subway station rumored to hold secrets from a bygone era. As they venture deeper into the dark tunnels, they encounter strange graffiti and remnants of old advertisements, igniting their curiosity. However, the thrill quickly turns to terror when one member, Mia, discovers a series of hidden rooms that seem to echo with whispers of the past. As the group struggles to navigate the labyrinthine passages, tensions mount when Leo, driven by his obsession, becomes increasingly reckless, nearly leading them into danger. To save their friend and escape the underground nightmare, Mia must rely on her knowledge of urban legends and her connection to the city's history. In a final act of courage, she confronts Leo's reckless spirit, grounding him in reality and allowing them to retrace their steps. The explorers emerge into the light, forever bonded by their adventure, having... |
MultipleNegativesRankingLoss with these parameters:
1{
2 "scale": 20.0,
3 "similarity_fct": "cos_sim",
4 "gather_across_devices": false
5}per_device_train_batch_size: 4gradient_accumulation_steps: 4learning_rate: 2e-05num_train_epochs: 1lr_scheduler_type: cosinewarmup_ratio: 0.1bf16: Truebatch_sampler: no_duplicatesoverwrite_output_dir: Falsedo_predict: Falseeval_strategy: noprediction_loss_only: Trueper_device_train_batch_size: 4per_device_eval_batch_size: 8per_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: 1max_steps: -1lr_scheduler_type: cosinelr_scheduler_kwargs: {}warmup_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: Falseuse_ipex: Falsebf16: Truefp16: 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: 0dataloader_prefetch_factor: Nonepast_index: -1disable_tqdm: Falseremove_unused_columns: Truelabel_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: lengthddp_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: Falseneftune_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: Falseprompts: Nonebatch_sampler: no_duplicatesmulti_dataset_batch_sampler: proportionalrouter_mapping: {}learning_rate_mapping: {}| Epoch | Step | Training Loss |
|---|---|---|
| 0.0842 | 10 | 0.0223 |
| 0.1684 | 20 | 0.018 |
| 0.2526 | 30 | 0.0213 |
| 0.3368 | 40 | 0.0308 |
| 0.4211 | 50 | 0.0299 |
| 0.5053 | 60 | 0.0189 |
| 0.5895 | 70 | 0.0175 |
| 0.6737 | 80 | 0.0185 |
| 0.7579 | 90 | 0.0166 |
| 0.8421 | 100 | 0.0196 |
| 0.9263 | 110 | 0.0209 |
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}