Update README.md
Browse files
README.md
CHANGED
@@ -62,20 +62,18 @@ from sentence_transformers import SentenceTransformer
|
|
62 |
|
63 |
# Download from the 🤗 Hub
|
64 |
model = SentenceTransformer("pkshatech/RoSEtta-base")
|
65 |
-
|
|
|
66 |
sentences = [
|
67 |
-
'
|
68 |
-
|
69 |
-
'He drove to the stadium.',
|
70 |
]
|
71 |
embeddings = model.encode(sentences)
|
72 |
print(embeddings.shape)
|
73 |
# [3, 768]
|
74 |
|
75 |
# Get the similarity scores for the embeddings
|
76 |
-
similarities =
|
77 |
-
print(similarities.shape)
|
78 |
-
# [3, 3]
|
79 |
```
|
80 |
|
81 |
<!--
|
|
|
62 |
|
63 |
# Download from the 🤗 Hub
|
64 |
model = SentenceTransformer("pkshatech/RoSEtta-base")
|
65 |
+
|
66 |
+
# Don't forget to add the prefix "query: " for query-side or "passage: " for passage-side texts.
|
67 |
sentences = [
|
68 |
+
'query: PKSHAはどんな会社ですか?'
|
69 |
+
'passage: 研究開発したアルゴリズムを、多くの企業のソフトウエア・オペレーションに導入しています。'
|
|
|
70 |
]
|
71 |
embeddings = model.encode(sentences)
|
72 |
print(embeddings.shape)
|
73 |
# [3, 768]
|
74 |
|
75 |
# Get the similarity scores for the embeddings
|
76 |
+
similarities = F.cosine_similarity(embeddings.unsqueeze(0), embeddings.unsqueeze(1), dim=2)
|
|
|
|
|
77 |
```
|
78 |
|
79 |
<!--
|