SKT-AI/KoBART
About
Korean BART
AI & Machine LearningMeasured star growth
- in 24h
- 0
- in 7 days
- 0
- in 15 days
- 0
- in 1 month
- Collecting history
Net star changes over overlapping periods, not daily totals. Missing measurements are left blank. Stars measure attention, not software quality.
README.md
Original๐คฃ KoBART
BART(Bidirectional and Auto-Regressive Transformers)๋ ์
๋ ฅ ํ
์คํธ ์ผ๋ถ์ ๋
ธ์ด์ฆ๋ฅผ ์ถ๊ฐํ์ฌ ์ด๋ฅผ ๋ค์ ์๋ฌธ์ผ๋ก ๋ณต๊ตฌํ๋ autoencoder์ ํํ๋ก ํ์ต์ด ๋ฉ๋๋ค. ํ๊ตญ์ด BART(์ดํ KoBART) ๋ ๋
ผ๋ฌธ์์ ์ฌ์ฉ๋ Text Infilling ๋
ธ์ด์ฆ ํจ์๋ฅผ ์ฌ์ฉํ์ฌ 40GB ์ด์์ ํ๊ตญ์ด ํ
์คํธ์ ๋ํด์ ํ์ตํ ํ๊ตญ์ด encoder-decoder ์ธ์ด ๋ชจ๋ธ์
๋๋ค. ์ด๋ฅผ ํตํด ๋์ถ๋ KoBART-base๋ฅผ ๋ฐฐํฌํฉ๋๋ค.

How to install
pip install git+https://github.com/SKT-AI/KoBART#egg=kobart
You can also download the model directly from the Hugging Face Hub.
Data
| Data | # of Sentences |
|---|---|
| Korean Wiki | 5M |
| Other corpus | 0.27B |
ํ๊ตญ์ด ์ํค ๋ฐฑ๊ณผ ์ด์ธ, ๋ด์ค, ์ฑ , ๋ชจ๋์ ๋ง๋ญ์น v1.0(๋ํ, ๋ด์ค, ...) ๋ฑ์ ๋ค์ํ ๋ฐ์ดํฐ๊ฐ ๋ชจ๋ธ ํ์ต์ ์ฌ์ฉ๋์์ต๋๋ค.
Tokenizer
tokenizers ํจํค์ง์ Character BPE tokenizer๋ก ํ์ต๋์์ต๋๋ค.
vocab ์ฌ์ด์ฆ๋ 30,000 ์ด๋ฉฐ ๋ํ์ ์์ฃผ ์ฐ์ด๋ ์๋์ ๊ฐ์ ์ด๋ชจํฐ์ฝ, ์ด๋ชจ์ง ๋ฑ์ ์ถ๊ฐํ์ฌ ํด๋น ํ ํฐ์ ์ธ์ ๋ฅ๋ ฅ์ ์ฌ๋ ธ์ต๋๋ค.
๐, ๐, ๐, ๐ , ๐คฃ, .. ,
:-),:),-),(-:...
๋ํ <unused0> ~ <unused99>๋ฑ์ ๋ฏธ์ฌ์ฉ ํ ํฐ์ ์ ์ํด, ํ์ํ subtasks์ ๋ฐ๋ผ ์์ ๋กญ๊ฒ ์ ์ํด ์ฌ์ฉํ ์ ์๊ฒ ํ์ต๋๋ค.
>>> from kobart import get_kobart_tokenizer
>>> kobart_tokenizer = get_kobart_tokenizer()
>>> kobart_tokenizer.tokenize("์๋
ํ์ธ์. ํ๊ตญ์ด BART ์
๋๋ค.๐คฃ:)l^o")
['โ์๋
ํ', '์ธ์.', 'โํ๊ตญ์ด', 'โB', 'A', 'R', 'T', 'โ์
', '๋๋ค.', '๐คฃ', ':)', 'l^o']
Model
| Model | # of params | Type | # of layers | # of heads | ffn_dim | hidden_dims |
|---|---|---|---|---|---|---|
KoBART-base |
124M | Encoder | 6 | 16 | 3072 | 768 |
| Decoder | 6 | 16 | 3072 | 768 |
>>> from transformers import BartModel
>>> from kobart import get_pytorch_kobart_model, get_kobart_tokenizer
>>> kobart_tokenizer = get_kobart_tokenizer()
>>> model = BartModel.from_pretrained(get_pytorch_kobart_model())
>>> inputs = kobart_tokenizer(['์๋
ํ์ธ์.'], return_tensors='pt')
>>> model(inputs['input_ids'])
Seq2SeqModelOutput(last_hidden_state=tensor([[[-0.4418, -4.3673, 3.2404, ..., 5.8832, 4.0629, 3.5540],
[-0.1316, -4.6446, 2.5955, ..., 6.0093, 2.7467, 3.0007]]],
grad_fn=<NativeLayerNormBackward>), past_key_values=((tensor([[[[-9.7980e-02, -6.6584e-01, -1.8089e+00, ..., 9.6023e-01, -1.8818e-01, -1.3252e+00],
Performances
Classification or Regression
| NSMC(acc) | KorSTS(spearman) | Question Pair(acc) | |
|---|---|---|---|
| ----------------------------------- | |||
| KoBART-base | 90.24 | 81.66 | 94.34 |
Demos

์ ์์๋ ZDNET ๊ธฐ์ฌ๋ฅผ ์์ฝํ ๊ฒฐ๊ณผ์
Examples
- NSMC Classification
- KoBART ChitChatBot
- KoBART Summarization
- KoBART Translation
- LegalQA using SentenceKoBART
- KoBART Question Generation
KoBART๋ฅผ ์ฌ์ฉํ ํฅ๋ฏธ๋ก์ด ์์ ๊ฐ ์๋ค๋ฉด PR์ฃผ์ธ์!
Release
- v0.5.2
- download large files from
huggingface hub
- download large files from
- v0.5.1
- guide default 'import statements'
- v0.5
- download large files from
aws s3
- download large files from
- v0.4
- Update model binary
- v0.3
- ํ ํฌ๋์ด์ ๋ฒ๊ทธ๋ก ์ธํด
<unk>ํ ํฐ์ด ์ฌ๋ผ์ง๋ ์ด์ ํด๊ฒฐ
- ํ ํฌ๋์ด์ ๋ฒ๊ทธ๋ก ์ธํด
- v0.2
KoBART๋ชจ๋ธ ์ ๋ฐ์ดํธ(์๋ธํ ์คํธ sample efficient๊ฐ ์ข์์ง)๋ชจ๋์ ๋ง๋ญ์น์ฌ์ฉ ๋ฒ์ ๋ช ์- downloder ๋ฒ๊ทธ ์์
pip์ค์น ์ง์
Contacts
KoBART ๊ด๋ จ ์ด์๋ ์ด๊ณณ์ ์ฌ๋ ค์ฃผ์ธ์.
License
KoBART๋ MIT ๋ผ์ด์ ์ค๋ฅผ ๋ฐ๋ฆ
๋๋ค.
Explore related projects
Loadingโฆ