SpirinEgor commited on
Commit
85b3e3a
1 Parent(s): 7452992

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +5 -4
README.md CHANGED
@@ -91,11 +91,12 @@ with torch.no_grad():
91
  # Perform pooling. In this case, cls pooling.
92
  sentence_embeddings = model_output[0][:, 0]
93
 
94
-
95
  # normalize embeddings
96
- sentence_embeddings = torch.nn.functional.normalize(sentence_embeddings, p=2, dim=1) print("Sentence embeddings:", sentence_embeddings)
97
- # [[0.5566 0.3013]
98
- # [0.1703 0.7124]]
 
 
99
  ```
100
 
101
  Also, you can use native [FlagEmbedding](https://github.com/FlagOpen/FlagEmbedding) library for evaluation. Usage is described in [`bge-m3` model card](https://huggingface.co/BAAI/bge-m3).
 
91
  # Perform pooling. In this case, cls pooling.
92
  sentence_embeddings = model_output[0][:, 0]
93
 
 
94
  # normalize embeddings
95
+ sentence_embeddings = torch.nn.functional.normalize(sentence_embeddings, p=2, dim=1)
96
+
97
+ # [[0.5567, 0.3014],
98
+ # [0.1701, 0.7122]]
99
+ scores = (sentence_embeddings[:2] @ sentence_embeddings[2:].T)
100
  ```
101
 
102
  Also, you can use native [FlagEmbedding](https://github.com/FlagOpen/FlagEmbedding) library for evaluation. Usage is described in [`bge-m3` model card](https://huggingface.co/BAAI/bge-m3).