Update README.md
Browse files
README.md
CHANGED
@@ -13,7 +13,34 @@ language:
|
|
13 |
- ko
|
14 |
---
|
15 |
|
16 |
-
๋ณธ ๋ชจ๋ธ์ multi-task loss (MultipleNegativeLoss -> AnglELoss)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
17 |
|
18 |
## Usage (HuggingFace Transformers)
|
19 |
|
|
|
13 |
- ko
|
14 |
---
|
15 |
|
16 |
+
๋ณธ ๋ชจ๋ธ์ multi-task loss (MultipleNegativeLoss -> AnglELoss) ๋ก, KlueNLI ๋ฐ KlueSTS ๋ฐ์ดํฐ๋ก ํ์ต๋์์ต๋๋ค.
|
17 |
+
|
18 |
+
## Usage (Huggingface inference API)
|
19 |
+
|
20 |
+
```python
|
21 |
+
import requests
|
22 |
+
|
23 |
+
API_URL = "https://api-inference.huggingface.co/models/sorryhyun/sentence-embedding-klue-large"
|
24 |
+
headers = {"Authorization": "your_HF_token"}
|
25 |
+
|
26 |
+
def query(payload):
|
27 |
+
response = requests.post(API_URL, headers=headers, json=payload)
|
28 |
+
return response.json()
|
29 |
+
|
30 |
+
|
31 |
+
output = query({
|
32 |
+
"inputs": {
|
33 |
+
"source_sentence": "์ข์์, ์ถ์ฒ, ์๋ฆผ์ค์ ๊น์ง",
|
34 |
+
"sentences": [
|
35 |
+
"์ข์์ ๋๋ฌ์ฃผ์ธ์!!",
|
36 |
+
"์ข์์, ์ถ์ฒ ๋ฑ ์ ํฌ๋ฒ๋ค์ด ์ข์ํด์",
|
37 |
+
"์๋ฆผ์ค์ ์ ๋๋ฌ์ฃผ์๋ฉด ๊ฐ์ฌ๋๋ฆฌ๊ฒ ์ต๋๋ค."
|
38 |
+
]
|
39 |
+
},
|
40 |
+
})
|
41 |
+
if __name__ == '__main__':
|
42 |
+
print(output)
|
43 |
+
```
|
44 |
|
45 |
## Usage (HuggingFace Transformers)
|
46 |
|