Update README.md
Browse files
README.md
CHANGED
@@ -29,6 +29,7 @@ pip install -U sentence-transformers
|
|
29 |
Then you can use the model like this:
|
30 |
|
31 |
```python
|
|
|
32 |
from sentence_transformers import SentenceTransformer, util
|
33 |
|
34 |
model = SentenceTransformer("Huffon/sentence-klue-roberta-base")
|
@@ -52,11 +53,11 @@ cos_scores = util.pytorch_cos_sim(query_embedding, document_embeddings)[0]
|
|
52 |
top_results = torch.topk(cos_scores, k=top_k)
|
53 |
|
54 |
print(f"입력 문장: {query}")
|
55 |
-
print(f"
|
56 |
-
<입력 문장과 유사한 {top_k} 개의
|
57 |
")
|
58 |
|
59 |
for i, (score, idx) in enumerate(zip(top_results[0], top_results[1])):
|
60 |
-
print(f"{i+1}: {docs[idx]} {'(유사도: {:.4f})'.format(score)}
|
61 |
")
|
62 |
```
|
|
|
29 |
Then you can use the model like this:
|
30 |
|
31 |
```python
|
32 |
+
import torch
|
33 |
from sentence_transformers import SentenceTransformer, util
|
34 |
|
35 |
model = SentenceTransformer("Huffon/sentence-klue-roberta-base")
|
|
|
53 |
top_results = torch.topk(cos_scores, k=top_k)
|
54 |
|
55 |
print(f"입력 문장: {query}")
|
56 |
+
print(f"\\
|
57 |
+
<입력 문장과 유사한 {top_k} 개의 문장>\\
|
58 |
")
|
59 |
|
60 |
for i, (score, idx) in enumerate(zip(top_results[0], top_results[1])):
|
61 |
+
print(f"{i+1}: {docs[idx]} {'(유사도: {:.4f})'.format(score)}\\
|
62 |
")
|
63 |
```
|