Sahajtomar
commited on
Commit
•
450c48c
1
Parent(s):
f991aed
Update README.md
Browse files
README.md
CHANGED
@@ -1 +1,38 @@
|
|
1 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
language: French
|
3 |
+
tags:
|
4 |
+
- sts
|
5 |
+
- pytorch
|
6 |
+
- semantic
|
7 |
+
- sentence transformer
|
8 |
+
- fr
|
9 |
+
datasets:
|
10 |
+
- sts
|
11 |
+
pipeline_tag: Semantic Similarity
|
12 |
+
---
|
13 |
+
# French STS
|
14 |
+
## STS dev (french)
|
15 |
+
87.4%
|
16 |
+
## STS test (french)
|
17 |
+
85.8%
|
18 |
+
#### STS pipeline
|
19 |
+
```python
|
20 |
+
!pip install -U sentence-transformers
|
21 |
+
from sentence_transformers import SentenceTransformer
|
22 |
+
model = SentenceTransformer('..model_path..')
|
23 |
+
sentences1 = ["J'aime mon téléphone",
|
24 |
+
"Mon téléphone n'est pas bon.",
|
25 |
+
"Votre téléphone portable est superbe."]
|
26 |
+
|
27 |
+
sentences2 = ["Est-ce qu'il neige demain?",
|
28 |
+
"Récemment, de nombreux ouragans ont frappé les États-Unis",
|
29 |
+
"Le réchauffement climatique est réel",]
|
30 |
+
embeddings1 = model.encode(sentences1, convert_to_tensor=True)
|
31 |
+
embeddings2 = model.encode(sentences2, convert_to_tensor=True)
|
32 |
+
cosine_scores = util.pytorch_cos_sim(embeddings1, embeddings2)
|
33 |
+
for i in range(len(sentences1)):
|
34 |
+
for j in range(len(sentences2)):
|
35 |
+
print(cosine_scores[i][j]))
|
36 |
+
"""
|
37 |
+
"""
|
38 |
+
```
|