Filtering
Collection
12 items • Updated
How to use dgwon/e5-small-v2.nfcorpus.meta-llama-Llama-3.2-3B-Instruct.top10pct with sentence-transformers:
from sentence_transformers import SentenceTransformer
model = SentenceTransformer("dgwon/e5-small-v2.nfcorpus.meta-llama-Llama-3.2-3B-Instruct.top10pct")
sentences = [
"query: What's the Difference Between Wagyu and Kangaroo Meat?",
"passage: A low-grade inflammatory response ('metaflammation') has been found to be associated with certain chronic diseases. Proposed inducers of this have been aspects of the modern lifestyle, including newly introduced foods. Plasma TAG, and the inflammatory cytokines C-reactive protein (CRP), TNF-alpha and IL-6 were compared in a randomised, cross-over trial using ten healthy subjects before and after eating 100 g of kangaroo, or a 'new' form of hybridised beef (wagyu) separated by about 1 week. Postprandial levels for 1 and 2 h of TAG, IL-6 and TNF-alpha were significantly higher after eating wagyu compared with kangaroo (P = 0.002 for TAG at 1 h, P < 0.001 at 2 h; P < 0.001 for IL-6 and TNF-alpha at 1 and 2 h). CRP was significantly higher 1 h postprandially after wagyu (P = 0.011) and non-significantly higher 2 h postprandially (P = 0.090). We conclude that the metaflammatory reaction to ingestion of a 'new' form of hybridised beef (wagyu) is indicative of a low-grade, systemic, immune reaction when compared with lean game meat (kangaroo). Further studies using isoenergetic intake and isolating fatty acid components of meats are proposed.",
"passage: Rates of lung cancer in American men have greatly exceeded those in Japanese men for several decades despite the higher smoking prevalence in Japanese men. It is not known whether the relative risk of lung cancer associated with cigarette smoking is lower in Japanese men than American men and whether these risks vary by the amount and duration of smoking. To estimate smoking-specific relative risks for lung cancer in men, a multicentric case-control study was carried out in New York City, Washington, DC, and Nagoya, Japan from 1992 to 1998. A total of 371 cases and 373 age-matched controls were interviewed in United States hospitals and 410 cases and 252 hospital controls in Japanese hospitals; 411 Japanese age-matched healthy controls were also randomly selected from electoral rolls. The odds ratio (OR) for lung cancer in current United States smokers relative to nonsmokers was 40.4 [95% confidence interval (CI) = 21.8-79.6], which was >10 times higher than the OR of 3.5 for current smokers in Japanese relative to hospital controls (95% CI = 1.6-7.5) and six times higher than in Japanese relative to community controls (OR = 6.3; 95% CI = 3.7-10.9). There were no substantial differences in the mean number of years of smoking or average daily number of cigarettes smoked between United States and Japanese cases or between United States and Japanese controls, but American cases began smoking on average 2.5 years earlier than Japanese cases. The risk of lung cancer associated with cigarette smoking was substantially higher in United States than in Japanese males, consistent with population-based statistics on smoking prevalence and lung cancer incidence. Possible explanations for this difference in risk include a more toxic cigarette formulation of American manufactured cigarettes as evidenced by higher concentrations of tobacco-specific nitrosamines in both tobacco and mainstream smoke, the much wider use of activated charcoal in the filters of Japanese than in American cigarettes, as well as documented differences in genetic susceptibility and lifestyle factors other than smoking.",
"passage: PURPOSE: Pancreatic cancer is almost always lethal, and the only U.S. Food and Drug Administration-approved therapies for it, gemcitabine and erlotinib, produce objective responses in <10% of patients. We evaluated the clinical biological effects of curcumin (diferuloylmethane), a plant-derived dietary ingredient with potent nuclear factor-kappaB (NF-kappaB) and tumor inhibitory properties, against advanced pancreatic cancer. EXPERIMENTAL DESIGN: Patients received 8 g curcumin by mouth daily until disease progression, with restaging every 2 months. Serum cytokine levels for interleukin (IL)-6, IL-8, IL-10, and IL-1 receptor antagonists and peripheral blood mononuclear cell expression of NF-kappaB and cyclooxygenase-2 were monitored. RESULTS: Twenty-five patients were enrolled, with 21 evaluable for response. Circulating curcumin was detectable as drug in glucuronide and sulfate conjugate forms, albeit at low steady-state levels, suggesting poor oral bioavailability. Two patients showed clinical biological activity. One had ongoing stable disease for >18 months; interestingly, one additional patient had a brief, but marked, tumor regression (73%) accompanied by significant increases (4- to 35-fold) in serum cytokine levels (IL-6, IL-8, IL-10, and IL-1 receptor antagonists). No toxicities were observed. Curcumin down-regulated expression of NF-kappaB, cyclooxygenase-2, and phosphorylated signal transducer and activator of transcription 3 in peripheral blood mononuclear cells from patients (most of whom had baseline levels considerably higher than those found in healthy volunteers). Whereas there was considerable interpatient variation in plasma curcumin levels, drug levels peaked at 22 to 41 ng/mL and remained relatively constant over the first 4 weeks. CONCLUSIONS: Oral curcumin is well tolerated and, despite its limited absorption, has biological activity in some patients with pancreatic cancer."
]
embeddings = model.encode(sentences)
similarities = model.similarity(embeddings, embeddings)
print(similarities.shape)
# [4, 4]This is a sentence-transformers model finetuned from intfloat/e5-small-v2. It maps sentences & paragraphs to a 384-dimensional dense vector space and can be used for semantic textual similarity, semantic search, paraphrase mining, text classification, clustering, and more.
SentenceTransformer(
(0): Transformer({'max_seq_length': 512, 'do_lower_case': False, 'architecture': 'BertModel'})
(1): Pooling({'word_embedding_dimension': 384, '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})
)
First install the Sentence Transformers library:
pip install -U sentence-transformers
Then you can load this model and run inference.
from sentence_transformers import SentenceTransformer
# Download from the 🤗 Hub
model = SentenceTransformer("sentence_transformers_model_id")
# Run inference
sentences = [
'query: Do Peppermint Teas Affect Male Fertility?',
'passage: OBJECTIVES: To justify the effects of Mentha piperita labiatae and Mentha spicata labiatae herbal teas on plasma total testosterone, luteinizing hormone, and follicle-stimulating hormone levels and testicular histologic features. We performed this study because of major complaints in our area from men about the adverse effects of these herbs on male reproductive function. METHODS: The experimental study included 48 male Wistar albino rats (body weight 200 to 250 g). The rats were randomized into four groups of 12 rats each. The control group was given commercial drinking water, and the experimental groups were given 20 g/L M. piperita tea, 20 g/L M. spicata tea, or 40 g/L M. spicata tea. RESULTS: The follicle-stimulating hormone and luteinizing hormone levels had increased and total testosterone levels had decreased in the experimental groups compared with the control group; the differences were statistically significant. Also, the Johnsen testicular biopsy scores were significantly different statistically between the experimental groups and the control group. Although the mean seminiferous tubular diameter of the experimental groups was relatively greater than in the control group, the difference was not statistically significant. The only effects of M. piperita on testicular tissue was segmental maturation arrest in the seminiferous tubules; however, the effects of M. spicata extended from maturation arrest to diffuse germ cell aplasia in relation to the dose. CONCLUSIONS: Despite the beneficial effects of M. piperita and M. spicata in digestion, we should also be aware of the toxic effects when the herbs are not used in the recommended fashion or at the recommended dose.',
'passage: We report a series of cases of thyroid dysfunction in adults associated with ingestion of a brand of soy milk manufactured with kombu (seaweed), and a case of hypothyroidism in a neonate whose mother had been drinking this milk. We also report two cases of neonatal hypothyroidism linked to maternal ingestion of seaweed made into soup. These products were found to contain high levels of iodine. Despite increasing awareness of iodine deficiency, the potential for iodine toxicity, particularly from sources such as seaweed, is less well recognised.',
]
embeddings = model.encode(sentences)
print(embeddings.shape)
# [3, 384]
# Get the similarity scores for the embeddings
similarities = model.similarity(embeddings, embeddings)
print(similarities)
# tensor([[1.0000, 0.5889, 0.0846],
# [0.5889, 1.0000, 0.1250],
# [0.0846, 0.1250, 1.0000]])
anchor and positive| anchor | positive | |
|---|---|---|
| type | string | string |
| details |
|
|
| anchor | positive |
|---|---|
query: Is a Chest CT Scan Worth the Radiation Risk? |
passage: In the past 3 decades, the total number of CT scans performed has grown exponentially. In 2007, > 70 million CT scans were performed in the United States. CT scan studies of the chest comprise a large portion of the CT scans performed today because the technology has transformed the management of common chest diseases, including pulmonary embolism and coronary artery disease. As the number of studies performed yearly increases, a growing fraction of the population is exposed to low-dose ionizing radiation from CT scan. Data extrapolated from atomic bomb survivors and other populations exposed to low-dose ionizing radiation suggest that CT scan-associated radiation may increase an individual's lifetime risk of developing cancer. This finding, however, is not incontrovertible. Because this topic has recently attracted the attention of both the scientific community and the general public, it has become increasingly important for physicians to understand the cancer risk associated... |
query: Does Lowering Cholesterol Improve Blood Flow? |
passage: Current National Cholesterol Education Program guidelines consider desirable total and low-density lipoprotein cholesterol levels to be < 200 and < 160 mg/dl, respectively, for healthy individuals without multiple coronary risk factors. To determine the extent to which these levels affect vascular function, we assessed flow-mediated (endothelium-dependent) brachial artery vasoactivity noninvasively before, during, and after cholesterol lowering (simvastatin 10 mg/day) in 7 healthy middle-aged men with cholesterol levels meeting current recommendations. Flow-mediated brachial artery vasoactivity was measured using 7.5 MHz ultrasound and expressed as percent diameter change from baseline to hyperemic conditions (1 minute following 5 minutes of blood pressure cuff arterial occlusion). Flow-mediated vasoactivity rose from 5.0 +/- 3.6% at baseline to 10.5 +/- 5.6%, 13.3 +/- 4.3%, and 15.7 +/- 4.9% (all p < 0.05) as cholesterol fell from 200 +/- 12 to 161 +/- 18, 169 +/- 16, and 153... |
query: Is Gemcitabine Plus Erlotinib a Good Treatment for Pancreatic Cancer? |
passage: Background This study aims to comprehensively summarize the currently available evidences on the efficacy and safety of gemcitabine plus erlotinib for treating advanced pancreatic cancer. Methodology/Principal Findings PubMed, EMBASE, The Cochrane Library and abstracts of recent major conferences were systematically searched to identify relevant publications. Studies that were conducted in advanced pancreatic cancer patients treated with gemcitabine plus erlotinib (with or without comparison with gemcitabine alone) and reporting objective response rate, disease control rate, progression-free survival, time-to-progression, overall survival, 1-year survival rate and/or adverse events were included. Data on objective response rate, disease control rate, 1-year survival rate and adverse events rate, respectively, were combined mainly by using Meta-Analyst software with a random-effects model. Data on progression-free survival, time-to-progression and overall survival were summariz... |
CachedMultipleNegativesRankingLoss with these parameters:{
"scale": 20.0,
"similarity_fct": "cos_sim",
"mini_batch_size": 16,
"gather_across_devices": false
}
anchor and positive| anchor | positive | |
|---|---|---|
| type | string | string |
| details |
|
|
| anchor | positive |
|---|---|
query: How Do Intervertebral Discs Age? |
passage: STUDY DESIGN: A histologic study on age-related changes of the human lumbar intervertebral disc was conducted. OBJECTIVES: To investigate comprehensively age-related temporospatial histologic changes in human lumbar intervertebral disc, and to develop a practicable and reliable classification system for age-related histologic disc alteration. SUMMARY OF THE BACKGROUND DATA: No comprehensive microscopic analysis of age-related disc changes is available. There is no conceptual morphologic framework for classifying age-related disc changes as a reference basis for more sophisticated molecular biologic analyses of the causative factors of disc aging or premature aging (degeneration). METHODS: A total of 180 complete sagittal lumbar motion segment slices obtained from 44 deceased individuals (fetal to 88 years of age) were analyzed with regard to 11 histologic variables for the intervertebral disc and endplate, respectively. In addition, 30 surgical specimens (3 regions each) were ... |
query: How to Get Kids to Eat Veggies |
passage: Using a repeated measures design, in a nursery setting, a modelling and rewards intervention targeted preschool children's consumption of 8 fruit and 8 vegetables (presented as 4 different food sets, each comprising 2 fruit and 2 vegetables). During the 16-day Baseline 1, and subsequent baselines, the children received a different food set daily, first at snacktime and again at lunchtime; consumption of these foods was not rewarded. In the 32-day fruit intervention phase, Food Set 2 and Food Set 3 were presented on alternate days; rewards were presented only at snacktime, and only for consumption of the fruit components. Following Baseline 2 and Baseline 3, the intervention targeted snack consumption of the vegetable components of Food Sets 1 and 4. Finally, Baseline 4, and 6-month Follow up were conducted. The interventions produced large and significant increases in target fruit and vegetable consumption with smaller, but significant, increases for the paired, opposite categ... |
query: Is Moderate Drinking Good For Breast Cancer Survivors? |
passage: Background: Alcohol intake has consistently been associated with increased breast cancer incidence in epidemiological studies. However, the relation between alcohol and survival after breast cancer diagnosis is less clear. Methods: We investigated whether alcohol intake was associated with survival among 3146 women diagnosed with invasive breast cancer in the Swedish Mammography Cohort. Alcohol consumption was estimated using a food frequency questionnaire. Cox proportional hazard models were used to calculate hazard ratios (HRs) and 95% confidence intervals (95% CIs). Results: From 1987 to 2008 there were 385 breast cancer-specific deaths and 860 total deaths. No significant association was observed between alcohol intake and breast cancer-specific survival. Women who consumed 10 g per day (corresponding to approximately 0.75 to 1 drinks) or more of alcohol had an adjusted HR (95% CI) of breast cancer-specific death of 1.36 (0.82–2.26;ptrend=0.47) compared with non-drinkers. ... |
CachedMultipleNegativesRankingLoss with these parameters:{
"scale": 20.0,
"similarity_fct": "cos_sim",
"mini_batch_size": 16,
"gather_across_devices": false
}
eval_strategy: epochper_device_train_batch_size: 128learning_rate: 2e-05num_train_epochs: 30warmup_ratio: 0.1fp16: Trueload_best_model_at_end: Truebatch_sampler: no_duplicatesoverwrite_output_dir: Falsedo_predict: Falseeval_strategy: epochprediction_loss_only: Trueper_device_train_batch_size: 128per_device_eval_batch_size: 8per_gpu_train_batch_size: Noneper_gpu_eval_batch_size: Nonegradient_accumulation_steps: 1eval_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: 30max_steps: -1lr_scheduler_type: linearlr_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: Falsebf16: Falsefp16: Truefp16_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: Trueignore_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: Nonebatch_sampler: no_duplicatesmulti_dataset_batch_sampler: proportionalrouter_mapping: {}learning_rate_mapping: {}| Epoch | Step | Training Loss | Validation Loss |
|---|---|---|---|
| 1.0 | 26 | 2.9167 | 0.2371 |
| 2.0 | 52 | 0.9199 | 0.0179 |
| 3.0 | 78 | 0.1965 | 0.0069 |
| 4.0 | 104 | 0.1304 | 0.0051 |
| 5.0 | 130 | 0.1139 | 0.0049 |
| 6.0 | 156 | 0.089 | 0.0045 |
| 7.0 | 182 | 0.0756 | 0.0046 |
| 8.0 | 208 | 0.0698 | 0.0042 |
| 9.0 | 234 | 0.07 | 0.0047 |
| 10.0 | 260 | 0.0618 | 0.0045 |
| 11.0 | 286 | 0.0606 | 0.0048 |
@inproceedings{reimers-2019-sentence-bert,
title = "Sentence-BERT: Sentence Embeddings using Siamese BERT-Networks",
author = "Reimers, Nils and Gurevych, Iryna",
booktitle = "Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing",
month = "11",
year = "2019",
publisher = "Association for Computational Linguistics",
url = "https://arxiv.org/abs/1908.10084",
}
@misc{gao2021scaling,
title={Scaling Deep Contrastive Learning Batch Size under Memory Limited Setup},
author={Luyu Gao and Yunyi Zhang and Jiawei Han and Jamie Callan},
year={2021},
eprint={2101.06983},
archivePrefix={arXiv},
primaryClass={cs.LG}
}
Base model
intfloat/e5-small-v2