我已经建立了一个基于LSI(Gensim)的语义相似性引擎。当输入文本为垃圾文本时,我收到的相似度得分高为.55到.50。如何解释这个分数。
我对从LSI获得的向量使用了余弦相似度。
def cosine_similarity(v1, v2):
mag1 = np.linalg.norm(v1)
mag2 = np.linalg.norm(v2)
if (not mag1) or (not mag2):
return 0
return np.dot(v1, v2) / (mag1 * mag2)
结果
{
"result": [
{
"journal_title": "Animal Production Science",
"matched_text": "The objective was to compare the behavioural and productive response of cows to either abrupt or two-step weaning with nose flaps. Calves were fitted with nose flaps during the 14 days before separation from their dams (NF group),then were abruptly and permanently separated (AW group), or remained as non-weaned controls (NW group). The behaviour of the cows was recorded before and after nose-flap insertion and permanent separation. Milk yield and composition were determined. After permanent separation, milk yield of NW cows was greater than that of NF and AW cows. AW cows paced and vocalised more than NF and NW cows, and NF cows more times than NW cows. The two-step weaning method with nose flaps was positive for the wellbeing of cows, as it reduced the main behavioural changes that indicate distress and decreased the bodyweight loss. Weaning, either in one or two steps, decreased milk yield 1 week after permanent separation.",
"score": 0.5508012771606445
},
{
"journal_title": "Journal of the Academy of Nutrition and Dietetics",
"matched_text": "Introduction. Health at Every Size (HAES) is a weight-neutral approach focused on promoting healthy behaviors in people with different body sizes and on enhancing pleasure derived from consuming food to achieve sustainable healthy eating outcomes. However, to the best of our knowledge, there are no studies in the literature assessing the effects of the HAES approach on perceptions of eating pleasure. Objective. We qualitatively investigated the perceptions of obese women about eating pleasure before and after a new interdisciplinary, nonprescriptive intervention based on the HAES approach. Design. The intervention was a randomized controlled clinical trial, designated as Health and Wellness in Obesity, conducted over 7 months at University of Sao Paulo (Brazil). We used a qualitative approach to data construction and analysis of perceptions about eating pleasure. Participants were randomized to either the intervention (I-HAES) group or the control (CTRL) group. The I-HAES group featured individual nutritional counseling, group practice of enjoyable physical activity, and philosophical workshops. The CTRL group was a traditional HAES intervention group (lecture-based model). Focus group discussions eliciting perceptions of pleasure around eating were conducted at baseline and post-study. Focus group transcripts were analyzed by exploratory content analysis. Participants. Forty-three women aged 25 to 50 years with body mass index (measured in kilograms per square meter) between 30 and 39. 9 completed the intervention and the focus groups, with 32 in the I-HAES group and 11 in the CTRL group. Results. Lack of guilt about experiencing pleasure while eating and increased reflection on their own desires increased in participants of both groups after the study. The I-HAES group also displayed a greater sense of autonomy related to eating, increased pleasure in commensality, familiarity with the practice of cooking, and decreased automatic eating. Conclusion HAES-based intervention featuring nutritional counseling, appreciation for physical activity, and philosophical engagement was shown to stimulate pleasure around eating without leading to indiscriminate eating. All rights reserved, Elsevier.",
"score": 0.5286298990249634
},
{
"journal_title": "International Journal of Eating Disorders",
"matched_text": "Objective. Studies have demonstrated that negative affect increases prior to food intake in individuals diagnosed with an eating disorder. Mindfulness has been supported empirically to treat experiential avoidance stemming from anxiety. Thus, the current objective in this study is to empirically compare mindfulness vs. thought suppression invention during a food exposure in both clinical and nonclinical samples. Method. In a 2 (Group: clinical vs. nonclinical) × 2 (Intervention: mindfulness vs. distraction) counterbalanced within treatment design, the current investigation sought to determine the differential effectiveness of a brief mindfulness intervention vs. a brief distraction intervention in women diagnosed with AN and BN in a clinical and nonclinical sample during a food exposure. Results. Results indicated that the eating disorder group reported a significant increase in negative affect after the mindfulness intervention as compared to the distraction intervention, whereas the nonclinical group reported a significant decrease in negative affect after the mindfulness intervention as compared to the distraction intervention. Discussion. Preliminary findings suggest that clinicians may want to proceed cautiously when using mindful eating in those with severe eating disorders during the early stages of food exposure. Limitations and future directions are discussed. © 2013 Wiley Periodicals, Inc. (Int J Eat Disord 2013; 46:582-585).",
"score": 0.5221812725067139
},
{
"journal_title": "Food and Nutrition in China",
"matched_text": "Objective. To investigate the effect of long-term milk-drinking on reproductive functioning of generation male rats. Method. Totally 4w Spraque-Dawley rats (20 male and 20 female) were randomly divided into milk group and control group according to their body mass and were fed with milk and normal diet for 2 generation, respectively. Indexes including body weight,number of pups, blood hormone level, reproduction organ, anogenital distance, preputial separation (PPS) and sperm parameters were examined. Result. The E2 of milk group in P and PRL in F1 were significantly higher than control. Besides, the number of F2 b in milk group was significantly lower than control. There was no significant differences on the other indexes such as weight of organs, number and quality of sperm, anogenital distance and PPS between milk group and control group. Conclusion. Long-term milk-drinking did not show significant influence on the reproductive functioning in the two-generation reproduction study. Further study was needed to determine the effects of hormone and number of pups.",
"score": 0.5116945505142212
},
{
"journal_title": "Arquivo Brasileiro de Medicina Veterinaria e Zootecnia",
"matched_text": "The aim of the study was to determine the effect of <i>Saccharomyces cerevisiae</i>, multienzyme composition supplementation on milk yield, quality, blood biochemical parameters of Lithuanian-Black-and-White cows. For this reason 28 cows were divided into four groups (three experimental and one control) each with seven cows fed balanced ration (control group) and following experimental groups: addition of 40g supplement of live yeast with organic selenium (group A); 40g supplement of live yeast with aromatic additives (group B); and 0.2g supplement of multienzyme composition (group C) during a 90 days period. The study showed that milk yield was 2.64%, 1.75%, 1.4% higher in groups A, B, C respectively, comparing with the control group. The milk SCC in experimental groups were lower comparing to the control group. The percentage of milk fat was significantly higher in group A - 0.33%, B - 0.31% and C - 0.16% comparing with the control group. All used additives ensure positive dynamics of investigated biochemical parameters in cattle blood. The results indicated that probiotic additives and multienzyme composition supplementation to dairy cows increased cows productivity and milk fat as well. Probiotic additives supplementation decreased SCC values in milk.",
"score": 0.5060627460479736
},
{
"journal_title": "Asian-Australasian Journal of Animal Sciences",
"matched_text": "Objective. This study was conducted to investigate the effect of transport stress on physiological and hematological responses and milk performance in lactating dairy cows. Methods. Ten lactating dairy cows were randomly divided into 2 groups. The treatment group (TG) was transported 200 km for 4 h by truck, and the control group (NTG) was restrained by stanchion for 4 h in Konkuk University farm. Blood and milk samples were collected at 24 h pre-transport; 1, 2, and 4 h during transport; and 2, 24, and 48 h post-transport. Milk yields were measured at 24 h pre-transport, 0 h during transport, and 24, 48, and 72 h post-transport. Results. Leukocyte, neutrophil, and monocyte numbers in the TG were significantly higher than those of the NTG at each experimental time point. Lymphocyte numbers in the TG were significantly (p<0.05) higher than those of the NTG at 48 h post-transport. Additionally, the neutrophil:lymphocyte ratio of the TG was 45% and 46% higher than that of the NTG at 4 h during transport and 2 h post-transport, respectively. There were no significant differences in erythrocyte numbers, hemoglobin concentrations, platelet numbers, and hematocrit percentages between two groups. Cortisol levels in the TG were significantly (p<0.05) higher than those in the NTG. Milk yields in the TG were lower than those in the NTG. The somatic cell count (SCC) of the TG was significantly (p<0.05) higher than that of the NTG at 1 and 2 h during transport; that of the TG increased dramatically at 1 h during transport and gradually decreased subsequently. Conclusion. Transport stress increased blood parameters including leucocyte, neutrophil, and monocyte numbers by increased cortisol levels, but did not affect erythrocytes, hemoglobin and hematocrit levels. Additionally, transport resulted in a decrease in milk yield and reduced milk quality owing to an increase in milk SCC.",
"score": 0.504709005355835
},
{
"journal_title": "Appetite",
"matched_text": "This randomized-controlled trial aims to test the efficacy of a group intervention (Kg-Free) for women with overweight or obesity based on mindfulness, ACT and compassion approaches. The intervention aimed to reduce weight self-stigma and unhealthy eating patterns and increase quality-of-life (QoL). Seventy-three women, aged between 18 and 55 years old, with BMI \u00e2\u2030\u00a525 without binge-eating seeking weight loss treatment were randomly assigned to intervention or control groups. Kg-Free comprises 10 weekly group sessions plus 2 booster fortnightly sessions, of 2h30 h each. The control group maintained Treatment as Usual (TAU). Data was collected at baseline and at the end of the Kg-Free intervention. Overall, participants enrolled in Kg-Free found the intervention to be very important and helpful when dealing with their weight-related unwanted internal experiences. Moreover, when compared with TAU, the Kg-Free group revealed a significant increased health-related QoL and physical exercise and a reduction of weight self-stigma, unhealthy eating behaviors, BMI, self-criticism, weight-related experiential avoidance and psychopathological symptoms at post-treatment. Results for self-compassion showed a trend towards significance, whereas no significant between-groups differences were found for mindfulness. Taken together, evidence was found for Kg-Free efficacy in reducing weight-related negative experiences and promoting healthy behaviors, psychological functioning, and QoL. All rights reserved, Elsevier.",
"score": 0.5014874935150146
}
],
"text": "zxvcbnzcn nbzcx bZcxb bZxbvbvbv sgfauy ert we"
}
在一个句子中仅出现“我们”一词。其他输入文本标记是垃圾。
语义相似度函数
def get_semantic_similarity(
query_vec,
data,
vectors,
df):
"""
Run the query against each document in corpus
RETURN
--------
the top N documents found
"""
results = []
for idx, d in enumerate(data):
doc_vec = vectors[idx].ravel()
similarity = cosine_similarity(query_vec, doc_vec)
results.append((similarity, d[:200], idx))