Update README.md
Browse files
README.md
CHANGED
@@ -7,7 +7,7 @@ tags:
|
|
7 |
- transformers
|
8 |
---
|
9 |
|
10 |
-
#
|
11 |
|
12 |
This is a [sentence-transformers](https://www.SBERT.net) model: It maps sentences & paragraphs to a 768 dimensional dense vector space and can be used for tasks like clustering or semantic search.
|
13 |
|
@@ -27,7 +27,7 @@ Then you can use the model like this:
|
|
27 |
from sentence_transformers import SentenceTransformer
|
28 |
sentences = ["This is an example sentence", "Each sentence is converted"]
|
29 |
|
30 |
-
model = SentenceTransformer('
|
31 |
embeddings = model.encode(sentences)
|
32 |
print(embeddings)
|
33 |
```
|
@@ -50,8 +50,8 @@ def cls_pooling(model_output, attention_mask):
|
|
50 |
sentences = ['This is an example sentence', 'Each sentence is converted']
|
51 |
|
52 |
# Load model from HuggingFace Hub
|
53 |
-
tokenizer = AutoTokenizer.from_pretrained('
|
54 |
-
model = AutoModel.from_pretrained('
|
55 |
|
56 |
# Tokenize sentences
|
57 |
encoded_input = tokenizer(sentences, padding=True, truncation=True, return_tensors='pt')
|
@@ -71,53 +71,55 @@ print(sentence_embeddings)
|
|
71 |
|
72 |
## Evaluation Results
|
73 |
|
74 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
75 |
|
76 |
For an automated evaluation of this model, see the *Sentence Embeddings Benchmark*: [https://seb.sbert.net](https://seb.sbert.net?model_name={MODEL_NAME})
|
77 |
|
78 |
|
79 |
## Training
|
80 |
-
|
81 |
-
|
82 |
-
**DataLoader**:
|
83 |
-
|
84 |
-
`torch.utils.data.dataloader.DataLoader` of length 1303 with parameters:
|
85 |
-
```
|
86 |
-
{'batch_size': 32, 'sampler': 'torch.utils.data.sampler.RandomSampler', 'batch_sampler': 'torch.utils.data.sampler.BatchSampler'}
|
87 |
-
```
|
88 |
|
89 |
-
|
90 |
-
|
91 |
-
`sentence_transformers.losses.CosineSimilarityLoss.CosineSimilarityLoss`
|
92 |
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
|
112 |
|
113 |
## Full Model Architecture
|
114 |
```
|
115 |
SentenceTransformer(
|
116 |
-
(0): Transformer({'max_seq_length':
|
117 |
(1): Pooling({'word_embedding_dimension': 768, 'pooling_mode_cls_token': True, 'pooling_mode_mean_tokens': False, 'pooling_mode_max_tokens': False, 'pooling_mode_mean_sqrt_len_tokens': False})
|
118 |
)
|
119 |
```
|
120 |
|
121 |
## Citing & Authors
|
122 |
|
123 |
-
|
|
|
7 |
- transformers
|
8 |
---
|
9 |
|
10 |
+
# albert-small-kor-sbert-v1
|
11 |
|
12 |
This is a [sentence-transformers](https://www.SBERT.net) model: It maps sentences & paragraphs to a 768 dimensional dense vector space and can be used for tasks like clustering or semantic search.
|
13 |
|
|
|
27 |
from sentence_transformers import SentenceTransformer
|
28 |
sentences = ["This is an example sentence", "Each sentence is converted"]
|
29 |
|
30 |
+
model = SentenceTransformer('bongsoo/albert-small-kor-sbert-v1')
|
31 |
embeddings = model.encode(sentences)
|
32 |
print(embeddings)
|
33 |
```
|
|
|
50 |
sentences = ['This is an example sentence', 'Each sentence is converted']
|
51 |
|
52 |
# Load model from HuggingFace Hub
|
53 |
+
tokenizer = AutoTokenizer.from_pretrained('bongsoo/albert-small-kor-sbert-v1')
|
54 |
+
model = AutoModel.from_pretrained('bongsoo/albert-small-kor-sbert-v1')
|
55 |
|
56 |
# Tokenize sentences
|
57 |
encoded_input = tokenizer(sentences, padding=True, truncation=True, return_tensors='pt')
|
|
|
71 |
|
72 |
## Evaluation Results
|
73 |
|
74 |
+
- ์ฑ๋ฅ ์ธก์ ์ ์ํ ๋ง๋ญ์น๋, ์๋ ํ๊ตญ์ด (kor), ์์ด(en) ํ๊ฐ ๋ง๋ญ์น๋ฅผ ์ด์ฉํจ
|
75 |
+
<br> ํ๊ตญ์ด : **korsts(1,379์๋ฌธ์ฅ)** ์ **klue-sts(519์๋ฌธ์ฅ)**
|
76 |
+
<br> ์์ด : [stsb_multi_mt](https://huggingface.co/datasets/stsb_multi_mt)(1,376์๋ฌธ์ฅ) ์ [glue:stsb](https://huggingface.co/datasets/glue/viewer/stsb/validation) (1,500์๋ฌธ์ฅ)
|
77 |
+
- ์ฑ๋ฅ ์งํ๋ **cosin.spearman**
|
78 |
+
- ํ๊ฐ ์ธก์ ์ฝ๋๋ [์ฌ๊ธฐ](https://github.com/kobongsoo/BERT/blob/master/sbert/sbert-test3.ipynb) ์ฐธ์กฐ
|
79 |
+
-
|
80 |
+
|๋ชจ๋ธ |korsts|klue-sts|glue(stsb)|stsb_multi_mt(en)|
|
81 |
+
|:--------|------:|--------:|--------------:|------------:|
|
82 |
+
|distiluse-base-multilingual-cased-v2 |0.7475 |0.7855 |0.8193 |0.8075|
|
83 |
+
|paraphrase-multilingual-mpnet-base-v2 |0.8201 |0.7993 |0.8907 |0.8682|
|
84 |
+
|bongsoo/moco-sentencedistilbertV2.1 |0.8390 |0.8767 |0.8805 |0.8548|
|
85 |
+
|bongsoo/albert-small-kor-sbert-v1 |0.8305 |0.8588 |0.8419 |0.7965|
|
86 |
|
87 |
For an automated evaluation of this model, see the *Sentence Embeddings Benchmark*: [https://seb.sbert.net](https://seb.sbert.net?model_name={MODEL_NAME})
|
88 |
|
89 |
|
90 |
## Training
|
91 |
+
- sts(10)-distil(10)-nli(3)-sts(10)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
92 |
|
93 |
+
The model was trained with the parameters:
|
|
|
|
|
94 |
|
95 |
+
**๊ณตํต**
|
96 |
+
- **do_lower_case=1, correct_bios=0, polling_mode=cls**
|
97 |
+
|
98 |
+
**1.STS**
|
99 |
+
- ๋ง๋ญ์น : korsts(5,749) + kluestsV1.1(11,668) + stsb_multi_mt(5,749) + mteb/sickr-sts(9,927) + glue stsb(5,749) (์ด:38,842)
|
100 |
+
- Param : **lr: 1e-4, eps: 1e-6, warm_step=10%, epochs: 10, train_batch: 32, eval_batch: 64, max_token_len: 72**
|
101 |
+
- ํ๋ จ์ฝ๋ [์ฌ๊ธฐ](https://github.com/kobongsoo/BERT/blob/master/sbert/sentece-bert-sts.ipynb) ์ฐธ์กฐ
|
102 |
+
|
103 |
+
**2.distilation**
|
104 |
+
- ๊ต์ฌ ๋ชจ๋ธ : paraphrase-multilingual-mpnet-base-v2(max_token_len:128)
|
105 |
+
- ๋ง๋ญ์น : news_talk_en_ko_train.tsv (์์ด-ํ๊ตญ์ด ๋ํ-๋ด์ค ๋ณ๋ ฌ ๋ง๋ญ์น : 1.38M)
|
106 |
+
- Param : **lr: 5e-5, epochs: 10, train_batch: 128, eval/test_batch: 64, max_token_len: 128(๊ต์ฌ๋ชจ๋ธ์ด 128์ด๋ฏ๋ก ๋ง์ถฐ์ค)**
|
107 |
+
- ํ๋ จ์ฝ๋ [์ฌ๊ธฐ](https://github.com/kobongsoo/BERT/blob/master/sbert/sbert-distillaton.ipynb) ์ฐธ์กฐ
|
108 |
+
|
109 |
+
**3.NLI**
|
110 |
+
- ๋ง๋ญ์น : ํ๋ จ(967,852) : kornli(550,152), kluenli(24,998), glue-mnli(392,702) / ํ๊ฐ(3,519) : korsts(1,500), kluests(519), gluests(1,500) ()
|
111 |
+
- HyperParameter : **lr: 3e-5, eps: 1e-8, warm_step=10%, epochs: 3, train/eval_batch: 64, max_token_len: 128**
|
112 |
+
- ํ๋ จ์ฝ๋ [์ฌ๊ธฐ](https://github.com/kobongsoo/BERT/blob/master/sbert/sentence-bert-nli.ipynb) ์ฐธ์กฐ
|
113 |
|
114 |
|
115 |
## Full Model Architecture
|
116 |
```
|
117 |
SentenceTransformer(
|
118 |
+
(0): Transformer({'max_seq_length': 256, 'do_lower_case': True}) with Transformer model: AlbertModel
|
119 |
(1): Pooling({'word_embedding_dimension': 768, 'pooling_mode_cls_token': True, 'pooling_mode_mean_tokens': False, 'pooling_mode_max_tokens': False, 'pooling_mode_mean_sqrt_len_tokens': False})
|
120 |
)
|
121 |
```
|
122 |
|
123 |
## Citing & Authors
|
124 |
|
125 |
+
bongsoo
|