Filtering
Collection
12 items • Updated
How to use dgwon/e5-small-v2.nfcorpus.meta-llama-Llama-3.1-8B-Instruct with sentence-transformers:
from sentence_transformers import SentenceTransformer
model = SentenceTransformer("dgwon/e5-small-v2.nfcorpus.meta-llama-Llama-3.1-8B-Instruct")
sentences = [
"query: Does Fish Oil Help Heart Health?",
"passsage: Exercise is a fundamental component of good health. The American College of Sports Medicine and \"Exercise is Medicine\" recommend treating exercise as a vital sign, and assessing and prescribing physical activity at every medical visit. Meeting the recommended goals of physical activity results in a significant reduction in all-cause mortality. Physicians can improve health by prescribing exercise. Copyright © 2013 Elsevier Inc. All rights reserved.",
"passsage: Water-soluble polysaccharides were separated from maca (Lepidium meyenii) aqueous extract (MAE). The crude polysaccharides were deproteinized by Sevag method. During the preparation process of maca polysaccharides, amylase and glucoamylase effectively removed starch in maca polysaccharides. Four Lepidium meyenii polysaccharides (LMPs) were obtained by changing the concentration of ethanol in the process of polysaccharide precipitation. All of the LMPs were composed of rhamnose, arabinose, glucose and galactose. Antioxidant activity tests revealed that LMP-60 showed good capability of scavenging hydroxyl free radical and superoxide radical at 2.0mg/mL, the scavenging rate was 52.9% and 85.8%, respectively. Therefore, the results showed that maca polysaccharides had a high antioxidant activity and could be explored as the source of bioactive compounds. Copyright © 2014 Elsevier Ltd. All rights reserved.",
"passsage: CONTEXT: Considerable controversy exists regarding the association of omega-3 polyunsaturated fatty acids (PUFAs) and major cardiovascular end points. OBJECTIVE: To assess the role of omega-3 supplementation on major cardiovascular outcomes. DATA SOURCES: MEDLINE, EMBASE, and the Cochrane Central Register of Controlled Trials through August 2012. STUDY SELECTION: Randomized clinical trials evaluating the effect of omega-3 on all-cause mortality, cardiac death, sudden death, myocardial infarction, and stroke. DATA EXTRACTION: Descriptive and quantitative information was extracted; absolute and relative risk (RR) estimates were synthesized under a random-effects model. Heterogeneity was assessed using the Q statistic and I2. Subgroup analyses were performed for the presence of blinding, the prevention settings, and patients with implantable cardioverter-defibrillators, and meta-regression analyses were performed for the omega-3 dose. A statistical significance threshold of .0063 was assumed after adjustment for multiple comparisons. DATA SYNTHESIS: Of the 3635 citations retrieved, 20 studies of 68,680 patients were included, reporting 7044 deaths, 3993 cardiac deaths, 1150 sudden deaths, 1837 myocardial infarctions, and 1490 strokes. No statistically significant association was observed with all-cause mortality (RR, 0.96; 95% CI, 0.91 to 1.02; risk reduction [RD] -0.004, 95% CI, -0.01 to 0.02), cardiac death (RR, 0.91; 95% CI, 0.85 to 0.98; RD, -0.01; 95% CI, -0.02 to 0.00), sudden death (RR, 0.87; 95% CI, 0.75 to 1.01; RD, -0.003; 95% CI, -0.012 to 0.006), myocardial infarction (RR, 0.89; 95% CI, 0.76 to 1.04; RD, -0.002; 95% CI, -0.007 to 0.002), and stroke (RR, 1.05; 95% CI, 0.93 to 1.18; RD, 0.001; 95% CI, -0.002 to 0.004) when all supplement studies were considered. CONCLUSION: Overall, omega-3 PUFA supplementation was not associated with a lower risk of all-cause mortality, cardiac death, sudden death, myocardial infarction, or stroke based on relative and absolute measures of association."
]
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: What Concentration of IP6 Blocks Blood Vessel Growth?',
'passsage: A significant anticancer activity of the naturally occurring carbohydrate inositol hexaphosphate (IP(6)) has been reported against numerous cancer models. Since tumors require angiogenesis for growth and metastasis, we hypothesize that IP(6) reduces tumor growth by inhibiting angiogenesis. Because angiogenesis depends on the interaction between endothelial and tumor cells, we investigated the effect of IP(6) on both. IP(6) inhibited the proliferation and induced the differentiation of endothelial cells in vitro; the growth of bovine aortic endothelial cells (BAECs) evaluated by MTT proliferation assay was inhibited in a dose-dependent manner (IC(50) = 0.74 mM). The combination of IP(6) and vasostatin, a calreticulin fragment with anti-angiogenic activity, was synergistically superior in growth inhibition than either compound. IP(6) inhibited human umbilical vein endothelial cell (HUVEC) tube formation (in vitro capillary differentiation) on a reconstituted extracellular matrix, Matrigel, and disrupted pre-formed tubes. IP(6) significantly reduced basic fibroblast growth factor (bFGF)-induced vessel formation (P < 0.01) in vivo in Matrigel plug assay. Exposure of HepG2, a human hepatoma cell line, to IP(6) for 8 h, resulted in a dose-dependent decrease in the mRNA levels of vascular endothelial growth factor (VEGF), as assessed by RT-PCR. IP(6) treatment of HepG2 cells for 24 h also significantly reduced the VEGF protein levels in conditioned medium, in a concentration-dependent manner (P = 0.012). Thus, IP(6) has an inhibitory effect on induced angiogenesis.',
'passsage: Twenty three adults ingested 203Pb as lead acetate on the 12th hour of a 19 h fast. Retention measured 7 days later in a whole-body counter was 61% and whole-body turnover rates suggested that initial uptake had been considerably greater. Balanced meals eaten with 203Pb reduced lead uptake to 4% and the influence of the food lasted for up to 3 h. The effects of phytate, ethylene-diaminetetra acetate (EDTA), caffeine, alcohol, glucose, a liquid meal and a light snack were tested separately with intermediate results. The effect of a meal was probably largely due to its content of calcium and phosphate salts but lead uptake was probably further reduced by phytate which is plentiful in whole cereals and it was probably increased by a factor in milk. Uptake with skimmed milk was the same as with whole milk and we suggested that the factor was not fat. Comestibles with low mineral and phytate contents reduced lead uptake by intermediate amounts, possibly by stimulation of digestive secretions. The avid uptake of lead during a fast, the large reduction of lead uptake with meals and the likelihood of variations in gastric-emptying rates and dietary habits may be major causes of variation in body burdens of lead in the population.',
]
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.6574, -0.0130],
# [ 0.6574, 1.0000, -0.1338],
# [-0.0130, -0.1338, 1.0000]])
anchor and positive| anchor | positive | |
|---|---|---|
| type | string | string |
| details |
|
|
| anchor | positive |
|---|---|
query: What Are the Common Causes of Dry Eyes? |
passsage: The report of the Epidemiology Subcommittee of the 2007 Dry Eye WorkShop summarizes current knowledge on the epidemiology of dry eye disease, providing prevalence and incidence data from various populations. It stresses the need to expand epidemiological studies to additional geographic regions, to incorporate multiple races and ethnicities in future studies, and to build a consensus on dry eye diagnostic criteria for epidemiological studies. Recommendations are made regarding several characteristics of dry eye questionnaires that might be suitable for use in epidemiological studies and randomized controlled clinical trials. Risk factors for dry eye and morbidity of the disease are identified, and the impact of dry eye disease on quality of life and visual function are outlined. Suggestions are made for further prospective research that would lead to improvement of both eye and general public health. |
query: Do Community Gardens Improve Eating Habits? |
passsage: Objectives. We considered the relationship between an urban adult population's fruit and vegetable consumption and several selected social and psychological processes, beneficial aesthetic experiences, and garden participation. Methods. We conducted a population-based survey representing 436 residents across 58 block groups in Denver, Colorado, from 2006 to 2007. We used multilevel statistical models to evaluate the survey data. Results. Neighborhood aesthetics, social involvement, and community garden participation were significantly associated with fruit and vegetable intake. Community gardeners consumed fruits and vegetables 5.7 times per day, compared with home gardeners (4.6 times per day) and nongardeners (3.9 times per day). Moreover, 56% of community gardeners met national recommendations to consume fruits and vegetables at least 5 times per day, compared with 37% of home gardeners and 25% of nongardeners. Conclusions. Our study results shed light on neighborhood proc... |
query: Does Eating Tomatoes Help Prevent Heart Attacks? |
passsage: Cardiovascular disease (CVD) is the leading cause of death worldwide. Healthy eating is among its safeguards, especially the daily intake of fruits and vegetables. In this context it has been shown that tomato (Solanum lycopersicum) presents antiplatelet activity. In the present study, we evaluated in vitro antiplatelet activity of fresh hybrid tomato process (nine hybrids: Apt 410, H 9888, Bos 8066, Sun 6366, AB3, HMX 7883, H 9665, H 7709, and H 9997), paste and its by-product of industrial processes (pomace). We assessed antiplatelet activity ex vivo and bleeding time in rats that ingested 0.1 and 1.0 g/kg of pomace each day. In studies in vitro, no significant differences in antiplatelet activity was observed in fresh tomato hybrids. Furthermore, the agro-industrial process did not affect the antiplatelet activity of paste and pomace. Likewise, pomace intake of 1.0 g/kg per day prolonged bleeding time and reduced ex vivo platelet aggregation in rats. The data obtained indi... |
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: What's the Best Way to Clean a Head of Lettuce? |
passsage: Much effort has been focused on sanitation of fresh produce at the commercial level; however, few options are available to the consumer. The purpose of this study was to determine the efficacy of different cleaning methods in reducing bacterial contamination on fresh produce in a home setting. Lettuce, broccoli, apples, and tomatoes were inoculated with Listeria innocua and then subjected to combinations of the following cleaning procedures: (i) soak for 2 min in tap water, Veggie Wash solution, 5% vinegar solution, or 13% lemon solution and (ii) rinse under running tap water, rinse and rub under running tap water, brush under running tap water, or wipe with wet/dry paper towel. Presoaking in water before rinsing significantly reduced bacteria in apples, tomatoes, and lettuce, but not in broccoli. Wiping apples and tomatoes with wet or dry paper towel showed lower bacterial reductions compared with soaking and rinsing procedures. Blossom ends of apples were more contaminated ... |
query: Does Eating Carbs Improve Premenstrual Depression? |
passsage: We examined the occurrence and coincidence of depressed mood and excessive carbohydrate intake in 19 patients who claimed to suffer from severe premenstrual syndrome and in nine control subjects, all as inpatients, during the early follicular and late luteal phases of their menstrual cycles. Mood was assessed with the Hamilton Depression Scale and an addendum that evaluated fatigue, sociability, appetite, and carbohydrate craving. Calorie and nutrient intakes were measured directly. The subjects with premenstrual syndrome significantly increased calorie intake during the late luteal phase (from 1892 +/- 104 to 2395 +/- 93 kcal, mean +/- SEM); carbohydrate intake increased by 24% from meals and by 43% from snacks. Protein intake failed to change, whereas intake of fat, a fixed constituent of all of the test foods, rose in proportion to calorie intake. The Hamilton Depression Scale and addendum scores rose from 2.0 +/- 0.5 to 21.2 +/- 0.8 (Hamilton Scale) and from 0.5 +/- 0.5 t... |
query: Is Bacon Linked to Bladder Cancer? |
passsage: BACKGROUND: Nitrosamines, which are known bladder carcinogens, or their precursors are found in certain meat items, and concentrations of these compounds are especially high in bacon. Only 3 cohort studies, all with <100 case subjects, have examined the relation between meat intake and bladder cancer, and few studies have examined the relation of different meat types with bladder cancer. OBJECTIVE: The aim was to examine the association between specific meat items and bladder cancer in 2 large prospective studies. DESIGN: We analyzed data from 2 cohorts with up to 22 y of follow-up and 808 incident bladder cancer cases. Detailed data on meat were obtained from multiple food-frequency questionnaires administered over time. Multivariate relative risks (RRs) and 95% CIs were estimated by using Cox proportional hazards models with control for potential confounders, including detailed smoking history. RESULTS: Men and women with a high intake of bacon (>/=5 servings/wk) had an ele... |
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 | 205 | 1.5499 | 0.0180 |
| 2.0 | 410 | 0.2469 | 0.0116 |
| 3.0 | 615 | 0.1838 | 0.0087 |
| 4.0 | 820 | 0.1409 | 0.0083 |
| 5.0 | 1025 | 0.1183 | 0.0074 |
| 6.0 | 1230 | 0.0996 | 0.0069 |
| 7.0 | 1435 | 0.085 | 0.0064 |
| 8.0 | 1640 | 0.0768 | 0.0066 |
| 9.0 | 1845 | 0.0722 | 0.0062 |
| 10.0 | 2050 | 0.0695 | 0.0062 |
| 11.0 | 2255 | 0.0628 | 0.0061 |
| 12.0 | 2460 | 0.0593 | 0.0069 |
| 13.0 | 2665 | 0.0562 | 0.0060 |
| 14.0 | 2870 | 0.0541 | 0.0063 |
| 15.0 | 3075 | 0.0539 | 0.0061 |
| 16.0 | 3280 | 0.0513 | 0.0058 |
| 17.0 | 3485 | 0.0479 | 0.0062 |
| 18.0 | 3690 | 0.0493 | 0.0068 |
| 19.0 | 3895 | 0.0464 | 0.0066 |
@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