yano0 commited on
Commit
0a05607
1 Parent(s): f9c4a7f

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +5 -7
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
- # Run inference
 
66
  sentences = [
67
- 'The weather is lovely today.',
68
- "It's so sunny outside!",
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 = model.similarity(embeddings, embeddings)
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
  <!--