bongsoo commited on
Commit
d5aef9e
โ€ข
1 Parent(s): 4859fb0

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +38 -36
README.md CHANGED
@@ -7,7 +7,7 @@ tags:
7
  - transformers
8
  ---
9
 
10
- # {MODEL_NAME}
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('{MODEL_NAME}')
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('{MODEL_NAME}')
54
- model = AutoModel.from_pretrained('{MODEL_NAME}')
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
- <!--- Describe how your model was evaluated -->
 
 
 
 
 
 
 
 
 
 
 
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
- The model was trained with the parameters:
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
- **Loss**:
90
-
91
- `sentence_transformers.losses.CosineSimilarityLoss.CosineSimilarityLoss`
92
 
93
- Parameters of the fit()-Method:
94
- ```
95
- {
96
- "epochs": 10,
97
- "evaluation_steps": 2605,
98
- "evaluator": "sentence_transformers.evaluation.EmbeddingSimilarityEvaluator.EmbeddingSimilarityEvaluator",
99
- "max_grad_norm": 1,
100
- "optimizer_class": "<class 'transformers.optimization.AdamW'>",
101
- "optimizer_params": {
102
- "eps": 1e-06,
103
- "lr": 0.0001
104
- },
105
- "scheduler": "WarmupLinear",
106
- "steps_per_epoch": null,
107
- "warmup_steps": 1303,
108
- "weight_decay": 0.01
109
- }
110
- ```
111
 
112
 
113
  ## Full Model Architecture
114
  ```
115
  SentenceTransformer(
116
- (0): Transformer({'max_seq_length': 72, 'do_lower_case': True}) with Transformer model: AlbertModel
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
- <!--- Describe where people can find more information -->
 
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