sorryhyun commited on
Commit
5c63d1d
โ€ข
1 Parent(s): 0700f5c

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +28 -1
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