1from sentence_transformers import SentenceTransformer
2
3# Download from the 🤗 Hub
4model = SentenceTransformer("sentence_transformers_model_id")
5# Run inference
6sentences = [
7 'Procedure for the detection of organic UV filters. Title: Procedure for the detection of organic UV filters\n\nAbstract: \n\nBusiness Description: The invention concerns an optimized analytical procedure for the detection and quantification of organic UV filters, emerging contaminants with potential harmful effects on aquatic ecosystems. The aim is to develop a simple, rapid, portable, and cost-effective voltammetric method, as an alternative to traditional chromatographic techniques, for environmental water monitoring and the characterization of sunscreen products.\n\nTech Features: The technology is based on an innovative method to detect and quantify UV filters such as octocrylene, oxybenzone, and octinoxate, applicable to aqueous matrices and sunscreen products. After a simple sample treatment (concentration for water samples or extraction for creams), the analysis is performed using an electrochemical sensor that measures specific electrical signals: each substance produces a characteristic “peak,” allowing it to be identified and quantified simultaneously. Compared to traditional laboratory methods, such as liquid chromatography or gas chromatography, the proposed solution is more cost-effective, portable, rapid, uses fewer solvents, and enables on-site analysis while maintaining high sensitivity and repeatability.\n\nApplications: Environmental monitoring of marine, lake, and river waters; Control of wastewater and treatment plants; Rapid on-site analysis of emerging contaminants; Characterization of sunscreens and oils; Quality control in the cosmetic sector.\n\nAdvantages: Portable method suitable for field analysis; Lower costs compared to chromatographic techniques; Reduced use of organic solvents; Fast and simple analyses; Simultaneous quantification of multiple UV filters; Good correlation with conventional analytical methods.',
8 'Procedure for the detection of organic UV filters. Title: Procedure for the detection of organic UV filters\n\nAbstract: \n\nBusiness Description: The invention concerns an optimized analytical procedure for the detection and quantification of organic UV filters, emerging contaminants with potential harmful effects on aquatic ecosystems. The aim is to develop a simple, rapid, portable, and cost-effective voltammetric method, as an alternative to traditional chromatographic techniques, for environmental water monitoring and the characterization of sunscreen products.\n\nTech Features: The technology is based on an innovative method to detect and quantify UV filters such as octocrylene, oxybenzone, and octinoxate, applicable to aqueous matrices and sunscreen products. After a simple sample treatment (concentration for water samples or extraction for creams), the analysis is performed using an electrochemical sensor that measures specific electrical signals: each substance produces a characteristic “peak,” allowing it to be identified and quantified simultaneously. Compared to traditional laboratory methods, such as liquid chromatography or gas chromatography, the proposed solution is more cost-effective, portable, rapid, uses fewer solvents, and enables on-site analysis while maintaining high sensitivity and repeatability.\n\nApplications: Environmental monitoring of marine, lake, and river waters; Control of wastewater and treatment plants; Rapid on-site analysis of emerging contaminants; Characterization of sunscreens and oils; Quality control in the cosmetic sector.\n\nAdvantages: Portable method suitable for field analysis; Lower costs compared to chromatographic techniques; Reduced use of organic solvents; Fast and simple analyses; Simultaneous quantification of multiple UV filters; Good correlation with conventional analytical methods.',
9 'PRODUCTION OF HIGH ORGANOLEPTIC AND NUTRITIONAL VALUE OLIVE OIL. Title: PRODUCTION OF HIGH ORGANOLEPTIC AND NUTRITIONAL VALUE OLIVE OIL\n\nAbstract: \n\nBusiness Description: The procedure involves the use of a non-toxic and organoleptically inert cryogen in the process of extracting oil from olives. In addition to high yields, it guarantees the production of olive oils, especially extra virgin, enriched in cellular compounds extracted from the fruit and, in particular, in components with aromatic and antioxidant activity, with a consequent significant increase in their organoleptic and nutritional quality. The unmistakable characteristics of the oils most recognizable by the consumer are closely linked to the raw material, the type of olives processed and their production area.\n\nTech Features: The proposed procedure provides the use of "carbonic snow", the carbon dioxide (CO 2 ) in a solid state for the extraction of olive oil. The solid CO 2 causes the formation of ice crystals in the freezing fruit, which in turn determines the collapse of the cellular structure of the pulp. This facilitates the release of substances and their transfer into the oil, which results rich in cellular metabolites with high biological value. The gaseous CO 2 , being heavier than air, tends to remain above the olive paste, creating a gaseous layer able to avoid direct contact with the air oxygen and to preserve the cellular constituents from oxidative degradation. The method makes economically sustainable early harvesting of the olives: the olives less mature will be richer in water and bioactive components (polyphenols, tocopherols); then, the early harvesting limits the damage caused by attacks of Bactrocera oleae (the olive fly), one of the most feared adversities by producers of the sector, able to significantly affect both the yield and the quality of the oil produced.\n\nApplications: Use in mills.\n\nAdvantages: Higher yield, on average 9% more (17.4 kg of product instead of 16 kg per quintal of olives); Better nutritional quality (e.g. 6% more vitamin E); Greater resistance to oxidative processes; Production of oil richer in antioxidants and aromatic components; Longer shelf life than that of oil obtained using conventional technologies.',
10]
11embeddings = model.encode(sentences)
12print(embeddings.shape)
13# [3, 768]
14
15# Get the similarity scores for the embeddings
16similarities = model.similarity(embeddings, embeddings)
17print(similarities)
18# tensor([[1.0000, 1.0000, 0.2489],
19# [1.0000, 1.0000, 0.2489],
20# [0.2489, 0.2489, 1.0000]])