通用语句编码

2024-05-15 22:38:16 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在研究语义相似性问题。我使用通用的句子编码算法和余弦相似性来生成相似性分数。我试图理解一个特定查询的响应

这是一个问题

query = "To identify the adulteration of wine origin information in the Bordeaux region of France by conducting principal component analysis and establishing prediction model through partial least square method. Methods. The wine samples were centrifuged directly. Liquid chromatography-quadrupole-time of flight tandem mass spectrometry (LC-Q-TOF-MS) with C<sub>18 </sub>analytical column was used to determine the components of wine in the positive ion mode, and combined with statistical methods to filter features of compounds, then conducted principal component analysis."

第二个结果完全偏离主题,但仍然得到了0.93分,这是关于儿童零食的。我怎样才能确保我不会以高分获得如此负面的结果

[{'score': 0.9637876749038696,
  'matched_text': 'objective to identify the adulteration of wine origin information in the bordeaux region of france by conducting principal component analysis and establishing prediction model through partial least square method methods the wine samples were centrifuged directly liquid chromatography quadrupole time of flight tandem mass spectrometry lc q tof ms with c18 analytical column was used to determine the components of wine in the positive ion mode and combined with statistical methods to filter features of compounds then conducted principal component analysis prediction model was established by the partial least square method it mainly investigated the feasibility of the roots of origin and attempted to identify the adulteration of counterfeiting results mass spectrometry acquisition information had a total of compounds after compounds extracted and there were compounds through filtering there were main components after conducting principal component analysis and the cumulative contribution rate was prediction model has good recognition properties for the identification of habitats and adulteration identification conclusion it has application value in wine regions reaction based on lc q tof ms which can analyze principal component of the detected material it is feasible to trace the origin of wine using lc q tof ms establishing prediction model provides a new idea for identification of wine information'},

 {'score': 0.9302994608879089,
  'matched_text': 'despite agreement that snacks contribute significant energy to children s diets evidence of the effects of snacks on health especially in children is weak some of the lack of consistent evidence may be due to a non standardized definition of snacks understanding how caregivers of preschool aged children conceptualize and define child snacks could provide valuable insights on epidemiological findings targets for anticipatory guidance and prevention efforts participants were ethnically diverse white hispanic and african american low income urban caregivers of children age years each caregiver completed a min semi structured in depth interview to elicit their definitions of child snacks data were coded by two trained coders using theoretically guided emergent coding techniques to derive key dimensions of caregivers child snack definitions five interrelated dimensions of a child snack definition were identified types of food portion size time location and purpose based on these dimensions an empirically derived definition of caregivers perceptions of child snacks is offered a small portion of food that is given in between meals frequently with an intention of reducing or preventing hunger until the next mealtime these findings suggest interrelated dimensions that capture the types of foods and eating episodes that are defined as snacks child nutrition studies and interventions that include a focus on child snacks should consider using an a priori multi dimensional definition of child snacks all rights reserved elsevier'},

 {'score': 0.9189165830612183,
  'matched_text': 'a fast and simple method for white wine differentiation based on fingerprinting by means of matrix assisted laser desorption ionization mass spectrometry maldi combined with linear time of flight tof mass spectrometry ms and statistical interpretation of the obtained data using principal component as well as cluster analysis is presented a systematic development was performed to allow a direct comparison and classification of croatian white wines based on maldi linear tof mass spectra assuming protein peptide fingerprints in the positive ion mode cyano 4 hydroxycinnamic acid as a maldi matrix in solution mixed with the unmodified without any dilution or preconcentration or purification isolation white wine sample in a volume ratio was applied at ambient conditions and this volume sample preparation technique provided the highest mass spectral information content and optimal reproducibility several maldi matrices solvents and preparation techniques were evaluated with the selection of the above mentioned as the optimum prior to large scale investigations data obtained by statistical analysis of the aligned mass spectrometric data are shown to provide an efficient way to differentiate white wines of croatian origin all rights reserved elsevier'},

 {'score': 0.9099736213684082,
  'matched_text': 'a method was developed with ultra high performance liquid chromatography tandem mass spectrometry for the qualitative and semi quantitative analysis of anthocyanins and anthocyanin derived adducts in red wine the method utilized in source collision induced dissociation in conjunction with multiple reaction monitoring to achieve group specific detection of the targeted compound groups the method detected quantification marker ions instead of intact molecules and as a result 2d chromatographic fingerprints were produced altogether we could detect groups of wine polyphenols including up to individual monomeric pigments together with fingerprints of three different types oligomeric proanthocyanidin malvidin adducts importantly the method was able to separate small medium sized and large oligomeric adducts the quantitative and qualitative function of the method was tested with model wines ultimately we were able to obtain a comprehensive picture of the main pigment composition of any model wine with only a single uplc ms ms analysis all rights reserved elsevier'},

 {'score': 0.9079132080078125,
  'matched_text': 'two analytical separation methods size exclusion chromatography and asymmetrical flow field flow fractionation were implemented to evaluate the integrity of the colloidal composition of chardonnay white wine and the impact of pressing and fermentations on the final macromolecular composition wine chromophoric colloidal matter representing uv visible absorbing wine macromolecules was evaluated by optical and structural measurements combined with the description of elution profiles obtained by both separative techniques the objective of this study was to apply these two types of fractionation on a typical chardonnay white wine produced in burgundy and to evaluate how each of them impacted the determination of the macromolecular chromophoric content of wine uv visible and fluorescence measurements of collected fractions were successfully applied an additional proteomic study revealed that grape and microorganism proteins largely impacted the composition of chromophoric colloidal matter of chardonnay wines asymmetrical flow field flow fractionation appeared to be more reliable and less invasive with respect to the native chemical environment of chromophoric wine macromolecules and hence is recommended as a tool to fractionate chromophoric colloidal matter in white wines springer verlag berlin heidelberg'}]

这是余弦相似函数

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)

Tags: andofthetoinbyonwith