File size: 670 Bytes
8102290 66c81d9 8102290 66c81d9 8102290 66c81d9 8102290 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
---
pipeline_tag: sentence-similarity
tags:
- sentence-transformers
- feature-extraction
- sentence-similarity
- transformers
---
ํ๊ตญ์ด์ ์์ด์ nli, sts๋ฐ์ดํฐ๋ฅผ klue/roberta-base์ ํ์ต์ํจ ๋ชจ๋ธ์
๋๋ค.
```python
from sentence_transformers import SentenceTransformer
from sklearn.metrics.pairwise import cosine_similarity
query = ['๊ทธ๋ ๊ทธ๋
๋ฅผ ์ข์ํ๋ค.']
sentences = ["he love her", "he hate her", '๊ทธ๋
๋ ๊ทธ๋ฅผ ์ซ์ดํ๋ค.','attention is all you need']
emb1 = model.encode(query)
emb2 = model.encode(sentences)
print(cosine_similarity(emb1,emb2))
-> array([[0.62751913, 0.23996451, 0.30788696, 0.08123618]], dtype=float32)
```
|