sentence-transformers How to use zacCMU/miniLM2-ENG3 with sentence-transformers:
from sentence_transformers import SentenceTransformer
model = SentenceTransformer("zacCMU/miniLM2-ENG3")
sentences = [
"We are the data controller in respect of your personal data and will handle your data in accordance with \nour obligations under the Privacy Laws. We will use this information solely in connection with \nadministering the Championship and exploiting the rights granted to us pursuant to any separate \nagreement entered into with your team or otherwise. We are entitled to do so on the basis of our \nlegitimate interests, namely to enable us to operate the Championship and promote and exploit your \nparticipation in the same.",
"The aerodynamic design of the new F1 car's rear wing has been optimized to reduce drag and improve downforce, allowing drivers to reach higher speeds on the straights.",
"As the data controller, we will manage your personal information in accordance with privacy laws, using it solely to administer the Formula 1 Championship and promote your participation.",
"The engine's ability to produce power is directly related to the pressure of the fuel-air mixture it receives. As the pressure increases, so does the potential for power output, with atmospheric pressure serving as the maximum threshold for normally aspirated engines."
]
embeddings = model.encode(sentences)
similarities = model.similarity(embeddings, embeddings)
print(similarities.shape)
# [4, 4]