Downloads · 30 days
71
0% of all-time downloads
Sahajtomar/french_semantic
french_semantic is a sentence similarity model from Sahajtomar. Use it when you need a score for how close two texts are. It is set up for sentence-transformers.
Downloads · 30 days
71
0% of all-time downloads
All-time downloads
22.4K
Public
Repo size
2.7 GB
Likes
17
Public
Click a slice to open those files.
.bin1.3 GB · 100%
From the Hugging Face model README
87.4%
85.8%
!pip install -U sentence-transformers
from sentence_transformers import SentenceTransformer
model = SentenceTransformer('..model_path..')
sentences1 = ["J'aime mon téléphone",
"Mon téléphone n'est pas bon.",
"Votre téléphone portable est superbe."]
sentences2 = ["Est-ce qu'il neige demain?",
"Récemment, de nombreux ouragans ont frappé les États-Unis",
"Le réchauffement climatique est réel",]
embeddings1 = model.encode(sentences1, convert_to_tensor=True)
embeddings2 = model.encode(sentences2, convert_to_tensor=True)
cosine_scores = util.pytorch_cos_sim(embeddings1, embeddings2)
for i in range(len(sentences1)):
for j in range(len(sentences2)):
print(cosine_scores[i][j]))
"""
"""