yano0 commited on
Commit
f8cd687
·
verified ·
1 Parent(s): 3cad581

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +6 -8
README.md CHANGED
@@ -77,20 +77,18 @@ from sentence_transformers import SentenceTransformer
77
 
78
  # Download from the 🤗 Hub
79
  model = SentenceTransformer("pkshatech/GLuCoSE-base-ja-v2")
80
- # Run inference
 
81
  sentences = [
82
- 'The weather is lovely today.',
83
- "It's so sunny outside!",
84
- 'He drove to the stadium.',
85
  ]
86
  embeddings = model.encode(sentences)
87
  print(embeddings.shape)
88
- # [3, 768]
89
 
90
  # Get the similarity scores for the embeddings
91
- similarities = model.similarity(embeddings, embeddings)
92
- print(similarities.shape)
93
- # [3, 3]
94
  ```
95
 
96
  <!--
 
77
 
78
  # Download from the 🤗 Hub
79
  model = SentenceTransformer("pkshatech/GLuCoSE-base-ja-v2")
80
+
81
+ # Don't forget to add the prefix "query: " for query-side or "passage: " for passage-side texts.
82
  sentences = [
83
+ 'query: PKSHAはどんな会社ですか?'
84
+ 'passage: 研究開発したアルゴリズムを、多くの企業のソフトウエア・オペレーションに導入しています。'
 
85
  ]
86
  embeddings = model.encode(sentences)
87
  print(embeddings.shape)
88
+ # [2, 768]
89
 
90
  # Get the similarity scores for the embeddings
91
+ similarities = F.cosine_similarity(embeddings.unsqueeze(0), embeddings.unsqueeze(1), dim=2)
 
 
92
  ```
93
 
94
  <!--