Create README.md
Browse files
README.md
ADDED
@@ -0,0 +1,70 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# π KoChatBART
|
2 |
+
[**BART**](https://arxiv.org/pdf/1910.13461.pdf)(**B**idirectional and **A**uto-**R**egressive **T**ransformers)λ μ
λ ₯ ν
μ€νΈ μΌλΆμ λ
Έμ΄μ¦λ₯Ό μΆκ°νμ¬ μ΄λ₯Ό λ€μ μλ¬ΈμΌλ‘ 볡ꡬνλ `autoencoder`μ ννλ‘ νμ΅μ΄ λ©λλ€. νκ΅μ΄ μ±ν
BART(μ΄ν **KoChatBART**) λ λ
Όλ¬Έμμ μ¬μ©λ `Text Infilling` λ
Έμ΄μ¦ ν¨μλ₯Ό μ¬μ©νμ¬ μ½ **10GB** μ΄μμ νκ΅μ΄ λν ν
μ€νΈμ λν΄μ νμ΅ν νκ΅μ΄ `encoder-decoder` μΈμ΄ λͺ¨λΈμ
λλ€. μ΄λ₯Ό ν΅ν΄ λμΆλ λν μμ±μ κ°κ±΄ν `KoChatBART-base`λ₯Ό λ°°ν¬ν©λλ€.
|
3 |
+
|
4 |
+
<img src=https://user-images.githubusercontent.com/55969260/205434343-b72641e9-d0f9-4b88-a334-9f904e0a35c5.png>
|
5 |
+
|
6 |
+
## Quick tour
|
7 |
+
```python
|
8 |
+
from transformers import AutoTokenizer, BartForConditionalGeneration
|
9 |
+
|
10 |
+
tokenizer = AutoTokenizer.from_pretrained("BM-K/KoChatBART")
|
11 |
+
model = BartForConditionalGeneration.from_pretrained("BM-K/KoChatBART")
|
12 |
+
|
13 |
+
inputs = tokenizer("μλ
μΈμμ!", return_tensors="pt")
|
14 |
+
outputs = model(**inputs)
|
15 |
+
```
|
16 |
+
|
17 |
+
## μ¬μ νμ΅ λ°μ΄ν° μ μ²λ¦¬
|
18 |
+
μ¬μ©ν λ°μ΄ν°μ
|
19 |
+
- [μ£Όμ λ³ ν
μ€νΈ μΌμ λν λ°μ΄ν°](https://aihub.or.kr/aihubdata/data/view.do?currMenu=115&topMenu=100&aihubDataSe=realm&dataSetSn=543)
|
20 |
+
- [μμκ³΅μΈ κ³ κ° μ£Όλ¬Έ μ§μ-μλ΅ ν
μ€νΈ](https://aihub.or.kr/aihubdata/data/view.do?currMenu=115&topMenu=100&aihubDataSe=realm&dataSetSn=102)
|
21 |
+
- [νκ΅μ΄ SNS](https://aihub.or.kr/aihubdata/data/view.do?currMenu=115&topMenu=100&aihubDataSe=realm&dataSetSn=114)
|
22 |
+
- [λ―Όμ μ
무 μλν μΈκ³΅μ§λ₯ μΈμ΄ λ°μ΄ν°](https://aihub.or.kr/aihubdata/data/view.do?currMenu=115&topMenu=100&aihubDataSe=realm&dataSetSn=619)
|
23 |
+
|
24 |
+
KoChatBARTλ₯Ό νμ΅μν€κΈ° μνμ¬ νκ΅μ΄ λν λ°μ΄ν°μ
λ€μ μ μ²λ¦¬ ν ν©μ³ λλμ νκ΅μ΄ λν λ§λμΉλ₯Ό λ§λ€μμ΅λλ€.
|
25 |
+
1. λ°μ΄ν°μ μ€λ³΅μ μ€μ΄κΈ° μν΄ 'γ
γ
γ
γ
γ
γ
'μ κ°μ μ€λ³΅λ ννμ΄ 2λ² μ΄μ λ°λ³΅λ λλ 'γ
γ
'μ κ°μ΄ 2λ²μΌλ‘ λ°κΏ¨μ΅λλ€.
|
26 |
+
2. λ무 짧μ λ°μ΄ν°λ νμ΅μ λ°©ν΄κ° λ μ μκΈ° λλ¬Έμ KoBART ν ν¬λμ΄μ κΈ°μ€ μ 체 ν ν° κΈΈμ΄κ° 3μ λλ λ°μ΄ν°λ§μ μ λ³νμ΅λλ€.
|
27 |
+
3. κ°λͺ
μ²λ¦¬λ λ°μ΄ν°λ μ κ±°νμμ΅λλ€.
|
28 |
+
|
29 |
+
## Model
|
30 |
+
|
31 |
+
| Model | # of params | vocab size | Type | # of layers | # of heads | ffn_dim | hidden_dims |
|
32 |
+
| ------------- | :---------: | :-----: | :----------: | ---------: | ------: | ----------: | ----------: |
|
33 |
+
| `KoChatBART` | 139M | 50265 | Encoder | 6 | 16 | 3072 | 768 |
|
34 |
+
| | | | Decoder | 6 | 16 | 3072 | 768 |
|
35 |
+
|
36 |
+
## λν μμ± μ±λ₯ μΈ‘μ
|
37 |
+
λ€μ μ½λ[(Dialogue Generator)](https://github.com/2unju/KoBART_Dialogue_Generator)λ₯Ό κΈ°λ°μΌλ‘ κ° λͺ¨λΈμ fine-tuning νμμ΅λλ€. λν μμ± μ±λ₯ μΈ‘μ μ μν΄ μΆλ‘ μ ν ν¬λμ΄μ§λμ΄ μμ±λ μλ΅μ 볡μν ν, BPE tokenizerλ₯Ό μ¬μ©νμ¬ μ€μ μλ΅κ³Ό μμ±λ μλ΅ μ¬μ΄μ overlap λ° distinctλ₯Ό μΈ‘μ νμμ΅λλ€.
|
38 |
+
> **Warning** <br>
|
39 |
+
> μΌλ°μ μΌλ‘ 짧μ λν λ°μ΄ν°λ‘ λͺ¨λΈμ μ¬μ νμ΅νμκΈ° λλ¬Έμ κΈ΄ λ¬Έμ₯ μ²λ¦¬κ° μꡬλλ νμ€ν¬(μμ½) λ±μ λν΄μλ μ½ν λͺ¨μ΅μ 보μ
λλ€.
|
40 |
+
|
41 |
+
### μ€ν κ²°κ³Ό
|
42 |
+
- [κ°μ± λν λ°μ΄ν°](https://github.com/songys/Chatbot_data)
|
43 |
+
|
44 |
+
|Training|Validation|Test|
|
45 |
+
|:----:|:----:|:----:|
|
46 |
+
|9,458|1,182|1,183|
|
47 |
+
|
48 |
+
| Model | Param | BLEU-3 | BLEU-4 | Dist-1 | Dist-2 |
|
49 |
+
|------------------------|:----:|:----:|:----:|:----:|:----:|
|
50 |
+
| KoBART | 124M | 8.73 | 7.12 | 16.85 | 34.89 |
|
51 |
+
| KoChatBART | 139M | **12.97** | **11.23** | **19.64** | **44.53** |
|
52 |
+
|
53 |
+
- [μμκ³΅μΈ λν λ°μ΄ν°](https://github.com/2unju/AIHub_Chitchat_dataset_parser)
|
54 |
+
|
55 |
+
|Training|Validation|Test|
|
56 |
+
|:----:|:----:|:----:|
|
57 |
+
|29,093|1,616|1,616|
|
58 |
+
|
59 |
+
| Model | Param | BLEU-3 | BLEU-4 | Dist-1 | Dist-2 |
|
60 |
+
|------------------------|:----:|:----:|:----:|:----:|:----:|
|
61 |
+
| KoBART | 124M | 10.04 | 7.24 | 13.76| 42.09 |
|
62 |
+
| KoChatBART | 139M | **10.11** | **7.26** | **15.12** | **46.08** |
|
63 |
+
|
64 |
+
## Contributors
|
65 |
+
<a href="https://github.com/BM-K/KoChatBART/graphs/contributors">
|
66 |
+
<img src="https://contrib.rocks/image?repo=BM-K/KoChatBART" />
|
67 |
+
</a>
|
68 |
+
|
69 |
+
## Reference
|
70 |
+
- [KoBART](https://github.com/SKT-AI/KoBART)
|