Korean BERT pre-trained cased (KoBERT)
predefined_args = {
'attention_cell': 'multi_head',
'num_layers': 12,
'units': 768,
'hidden_size': 3072,
'max_length': 512,
'num_heads': 12,
'scaled': True,
'dropout': 0.1,
'use_residual': True,
'embed_size': 768,
'embed_dropout': 0.1,
'token_type_vocab_size': 2,
'word_embed': None,
}| 데이터 | 문장 | 단어 |
|---|---|---|
| 한국어 위키 | 5M | 54M |
학습 환경
사전(Vocabulary)
Install KoBERT as a python package
pip install git+https://[email protected]/SKTBrain/KoBERT.git@masterIf you want to modify source codes, please clone this repository
git clone https://github.com/SKTBrain/KoBERT.git
cd KoBERT
pip install -r requirements.txtHuggingface transformers API가 편하신 분은 여기를 참고하세요.
…model은 디폴트로 eval()모드로 리턴됨, 따라서 학습 용도로 사용시 model.train()명령을 통해 학습 모드로 변경할 필요가 있다.
…ONNX 컨버팅은 soeque1께서 도움을 주셨습니다.
…>>> from gluonnlp.data import SentencepieceTokenizer
>>> from kobert import get_tokenizer_path
>>> tok_path = get_tokenizer_path()
>>> sp = SentencepieceTokenizer(tok_path)
>>> sp('한국어 모델을 공유합니다.')
['▁한국', '어', '▁모델', '을', '▁공유', '합니다', '.']| Model | Accuracy |
|---|---|
| BERT base multilingual cased | 0.875 |
| KoBERT | 0.901 |
| KoGPT2 | 0.899 |
…| Model | Cosine Pearson | Cosine Spearman | Euclidean Pearson | Euclidean Spearman | Manhattan Pearson | Manhattan Spearman | Dot Pearson | Dot Spearman |
|---|---|---|---|---|---|---|---|---|
| NLl | 65.05 | 68.48 | 68.81 | 68.18 | 68.90 | 68.20 | 65.22 | 66.81 |
| STS | 80.42 | 79.64 | 77.93 | 77.43 | 77.92 | 77.44 | 76.56 | 75.83 |
| STS + NLI | 78.81 | 78.47 | 77.68 | 77.78 | 77.71 | 77.83 | 75.75 | 75.22 |
onnx 1.8.0 지원No module named 'kobert.utils'aws s3에서 받도록 변경KoBERT 관련 이슈는 이곳에 등록해 주시기 바랍니다.
KoBERT는 Apache-2.0 라이선스 하에 공개되어 있습니다. 모델 및 코드를 사용할 경우 라이선스 내용을 준수해주세요. 라이선스 전문은 LICENSE 파일에서 확인하실 수 있습니다.
No open issues yet, or sync has not completed.