File size: 6,997 Bytes
e204a58 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 | # Financial Text Simplifier (๊ธ์ต ํ
์คํธ ๊ฐ์ํ ๋ชจ๋ธ)
## Model Description
[](https://colab.research.google.com/drive/19Q7kUWtHX2shLx6iGGoT66wEidOrvLCf?usp=sharing)
**fin_simplifier**๋ ๋ณต์กํ ๊ธ์ต ์ฉ์ด์ ๋ฌธ์ฅ์ ์ผ๋ฐ์ธ์ด ์ดํดํ๊ธฐ ์ฌ์ด ํ๊ตญ์ด๋ก ๋ณํํ๋ Encoder-Decoder ๋ชจ๋ธ์
๋๋ค.
### Architecture
- **Encoder**: KR-FinBert-SC (๊ธ์ต ๋๋ฉ์ธ ํนํ BERT)
- **Decoder**: SKT KoGPT2-base-v2 (ํ๊ตญ์ด ์์ฑ ๋ชจ๋ธ)
- **Model Type**: Seq2Seq (Encoder-Decoder)
- **Parameters**: 255M
### Key Features
- ๊ธ์ต ์ ๋ฌธ ์ฉ์ด๋ฅผ ์ฌ์ด ์ผ์์ด๋ก ๋ณํ
- ํ๊ตญ์ด ๊ธ์ต ๋ฌธ์์ ์ต์ ํ
- PER, ROE, ํ์์ํ ๋ฑ ๋ณต์กํ ๊ฐ๋
๊ฐ์ํ
- ์ํ ์๋ด ๋ฐ ๊ธ์ต ๊ต์ก ํ์ฉ ๊ฐ๋ฅ
## Intended Use
### Primary Use Cases
1. **๊ธ์ต ์๋ด ์ง์**: ์ํ ์๋ด ์ ๊ณ ๊ฐ ์ดํด๋ ํฅ์
2. **๊ธ์ต ๊ต์ก**: ๋ณต์กํ ๊ธ์ต ๊ฐ๋
์ ์ฝ๊ฒ ์ค๋ช
3. **๋ฌธ์ ๊ฐ์ํ**: ์ฝ๊ด, ์ํ ์ค๋ช
์ ๋ฑ์ ์ดํดํ๊ธฐ ์ฝ๊ฒ ๋ณํ
4. **์ ๊ทผ์ฑ ๊ฐ์ **: ๊ธ์ต ์์ธ๊ณ์ธต์ ๊ธ์ต ์๋น์ค ์ ๊ทผ์ฑ ํฅ์
### Out-of-Scope Use
- ๋ฒ์ ๊ตฌ์๋ ฅ์ด ์๋ ๋ฌธ์ ์์ฑ
- ํฌ์ ์กฐ์ธ ๋๋ ๊ธ์ต ์๋ด ๋์ฒด
- ์ ํํ ์์น๋ ๊ณ์ฐ์ด ํ์ํ ๊ฒฝ์ฐ
## How to Use
### Installation
```python
from transformers import EncoderDecoderModel, AutoTokenizer
import torch
# Model loading
model = EncoderDecoderModel.from_pretrained("combe4259/fin_simplifier")
encoder_tokenizer = AutoTokenizer.from_pretrained("snunlp/KR-FinBert-SC")
decoder_tokenizer = AutoTokenizer.from_pretrained("skt/kogpt2-base-v2")
# Set special tokens
if decoder_tokenizer.pad_token is None:
decoder_tokenizer.pad_token = decoder_tokenizer.eos_token
```
### Inference Example
```python
def simplify_text(text, model, encoder_tokenizer, decoder_tokenizer):
# Tokenize input
inputs = encoder_tokenizer(
text,
return_tensors="pt",
max_length=128,
padding="max_length",
truncation=True
)
# Generate simplified text
with torch.no_grad():
generated = model.generate(
input_ids=inputs["input_ids"],
attention_mask=inputs["attention_mask"],
max_length=128,
num_beams=6,
repetition_penalty=1.2,
length_penalty=0.8,
early_stopping=True,
do_sample=True,
top_k=50,
top_p=0.95,
temperature=0.7
)
# Decode output
simplified = decoder_tokenizer.decode(generated[0], skip_special_tokens=True)
return simplified
# Example usage
complex_text = "์ฃผ๊ฐ์์ต๋น์จ(PER)์ ์ฃผ๊ฐ๋ฅผ ์ฃผ๋น์์ด์ต์ผ๋ก ๋๋ ์งํ์
๋๋ค."
simple_text = simplify_text(complex_text, model, encoder_tokenizer, decoder_tokenizer)
print(f"์๋ฌธ: {complex_text}")
print(f"๊ฐ์ํ: {simple_text}")
# Output: "๊ฐ์ํ: PER์ ์ฃผ์ ๊ฐ๊ฒฉ์ด ํ์ฌ ์ด์ต ๋๋น ๋น์ผ์ง ์ผ์ง ๋ณด๋ ์ซ์์
๋๋ค."
```
## Training Details
### Training Data
- **Size**: ์ฝ 100๊ฐ์ ๊ธ์ต ์ฉ์ด ์ (๋ณต์กํ ์ค๋ช
โ ์ฌ์ด ์ค๋ช
)
- **Domain**: ํ๊ตญ ๊ธ์ต ์ฉ์ด ๋ฐ ๊ฐ๋
- **Categories**:
- ๊ธฐ๋ณธ ๊ธ์ต ์งํ (PER, ROE, ROA ๋ฑ)
- ํฌ์ ์ํ (ETF, ELS, ํ์์ํ ๋ฑ)
- ๋์ถ/์๊ธ ์ฉ์ด
- ๋ฆฌ์คํฌ ๊ด๋ฆฌ ์ฉ์ด
- ์ธ๊ธ ๊ด๋ จ ์ฉ์ด
### Training Procedure
- **Epochs**: 10
- **Batch Size**: 4 (with gradient accumulation steps: 2)
- **Learning Rate**: 3e-5
- **Optimizer**: AdamW with warmup
- **Label Smoothing**: 0.1
- **Dropout**: 0.2 (encoder and decoder)
### Hyperparameters for Generation
- **Beam Search**: 6 beams
- **Repetition Penalty**: 1.2
- **Length Penalty**: 0.8
- **Temperature**: 0.7
- **Top-k**: 50
- **Top-p**: 0.95
## Evaluation
### Example Outputs
| ์๋ฌธ (Complex) | ๋ณํ ๊ฒฐ๊ณผ (Simplified) |
|---------------|---------------------|
| ์๊ฐ์ด์ก์ ๋ฐํ์ฃผ์์์ ์ฃผ๊ฐ๋ฅผ ๊ณฑํ ๊ฐ์ผ๋ก ๊ธฐ์
์ ์์ฅ๊ฐ์น๋ฅผ ๋ํ๋
๋๋ค. | ์๊ฐ์ด์ก์ ํ์ฌ์ ๋ชจ๋ ์ฃผ์์ ํฉ์น ๊ฐ๊ฒฉ์
๋๋ค. |
| ํ์๊ฒฐํฉ์ฆ๊ถ์ ๊ธฐ์ด์์ฐ์ ๊ฐ๊ฒฉ๋ณ๋์ ์ฐ๊ณํ์ฌ ์์ต์ด ๊ฒฐ์ ๋๋ ์ฆ๊ถ์
๋๋ค. | ํ์๊ฒฐํฉ์ฆ๊ถ์ ๋ค๋ฅธ ์ํ ๊ฐ๊ฒฉ์ ๋ฐ๋ผ ์์ต์ด ๋ฐ๋๋ ํฌ์ ์ํ์
๋๋ค. |
| ํ๋งค์กฐ๊ฑด๋ถ์ฑ๊ถ(RP)์ ์ผ์ ๊ธฐ๊ฐ ํ ๋ค์ ๋งค์
ํ๋ ์กฐ๊ฑด์ผ๋ก ๋งค๋ํ๋ ์ฑ๊ถ์
๋๋ค. | RP๋ ๋์ค์ ๋ค์ ์ฌ๊ฒ ๋ค๊ณ ์ฝ์ํ๊ณ ์ผ๋จ ํ๋ ์ฑ๊ถ์
๋๋ค. |
| ์ ๋์ฑ์ํ์ ์์ฐ์ ์ ์ ๊ฐ๊ฒฉ์ ํ๊ธํํ์ง ๋ชปํ ์ํ์
๋๋ค. | ์ ๋์ฑ์ํ์ ๊ธํ๊ฒ ํ ๋ ์ ๊ฐ์ ๋ชป ๋ฐ์ ์ํ์
๋๋ค. |
| ์๋ฆฌ๊ธ๊ท ๋ฑ์ํ์ ๋งค์ ๋์ผํ ๊ธ์ก์ผ๋ก ์๊ธ๊ณผ ์ด์๋ฅผ ์ํํ๋ ๋ฐฉ์์
๋๋ค. | ์๋ฆฌ๊ธ๊ท ๋ฑ์ํ์ ๋งค๋ฌ ๊ฐ์ ๊ธ์ก์ ๊ฐ๋ ๋ฐฉ์์
๋๋ค. |
## Limitations and Biases
### Limitations
1. **ํ์ต ๋ฐ์ดํฐ ๊ท๋ชจ**: ์ฝ 100๊ฐ์ ์์๋ก ํ์ต๋์ด ์ผ๋ฐํ ๋ฅ๋ ฅ์ด ์ ํ์
2. **๋๋ฉ์ธ ํนํ**: ๊ธ์ต ๋ถ์ผ ์ธ ๋ค๋ฅธ ์ ๋ฌธ ์ฉ์ด์๋ ์ฑ๋ฅ์ด ๋จ์ด์ง ์ ์์
3. **๋ฌธ๋งฅ ์ดํด**: ๊ธด ๋ฌธ์ฅ์ด๋ ๋ณต์กํ ๋ฌธ๋งฅ์์๋ ์ ํ๋๊ฐ ๋ฎ์ ์ ์์
4. **์์น ์ ๋ณด**: ์ ํํ ์์น๋ ๊ณ์ฐ์ ๋ณํ์๋ ์ ํฉํ์ง ์์
### Potential Biases
- ํ์ต ๋ฐ์ดํฐ๊ฐ ํ๊ตญ ๊ธ์ต ์์ฅ ์ค์ฌ์ผ๋ก ๊ตฌ์ฑ
- ์ผ๋ฐ ์๋น์ ๊ด์ ์ ๊ฐ์ํ๋ก ์ ๋ฌธ๊ฐ ์์ค์ ์ ํ์ฑ์ ๋ณด์ฅ๋์ง ์์
## Ethical Considerations
### Responsible Use
- โ
๊ธ์ต ๊ต์ก ๋ฐ ์ดํด๋ ํฅ์ ๋ชฉ์ ์ผ๋ก ์ฌ์ฉ
- โ
๋ณด์กฐ ๋๊ตฌ๋ก์ ์ธ๊ฐ ์ ๋ฌธ๊ฐ์ ํจ๊ป ์ฌ์ฉ
- โ ๋ฒ์ ํจ๋ ฅ์ด ์๋ ๋ฌธ์ ์์ฑ์ ์ฌ์ฉ ๊ธ์ง
- โ ํฌ์ ๊ฒฐ์ ์ ์ ์ผํ ๊ทผ๊ฑฐ๋ก ์ฌ์ฉ ๊ธ์ง
### Privacy
- ๋ชจ๋ธ์ ๊ฐ์ธ ์ ๋ณด๋ฅผ ํฌํจํ์ง ์์
- ์
๋ ฅ๋ ํ
์คํธ๋ ์ ์ฅ๋์ง ์์
## Citation
```bibtex
@misc{fin_simplifier2024,
title={Financial Text Simplifier: Korean Financial Terms Simplification Model},
author={combe4259},
year={2024},
publisher={HuggingFace},
url={https://huggingface.co/combe4259/fin_simplifier}
}
```
## Acknowledgments
- **KR-FinBert-SC**: ๊ธ์ต ๋๋ฉ์ธ ํนํ ์ธ์ฝ๋ ์ ๊ณต
- **SKT KoGPT2**: ํ๊ตญ์ด ์์ฑ ๋ชจ๋ธ ์ ๊ณต
- **NH Bank Text-Gaze-Tracker Project**: ์ค์ ํ์ฉ ์ฌ๋ก ๋ฐ ํผ๋๋ฐฑ
## Contact
- **HuggingFace**: [combe4259](https://huggingface.co/combe4259)
- **Model Card**: ๋ฌธ์์ฌํญ์ HuggingFace ํ ๋ก ํญ์ ์ด์ฉํด์ฃผ์ธ์
## License
์ด ๋ชจ๋ธ์ ์ฐ๊ตฌ ๋ฐ ๊ต์ก ๋ชฉ์ ์ผ๋ก ์ ๊ณต๋ฉ๋๋ค. ์์
์ ์ฌ์ฉ ์ ๋ณ๋ ๋ฌธ์๊ฐ ํ์ํฉ๋๋ค.
## Updates
- **2024.01**: ์ด๊ธฐ ๋ฒ์ ๋ฆด๋ฆฌ์ฆ (v1.0)
- ๊ธ์ต ์ฉ์ด 100๊ฐ ํ์ต
- KR-FinBert + KoGPT2 ์ํคํ
์ฒ
---
**Note**: ์ด ๋ชจ๋ธ์ ๊ธ์ต ์ ๋ณด์ ์ ๊ทผ์ฑ์ ๋์ด๊ธฐ ์ํ ์ฐ๊ตฌ ํ๋ก์ ํธ์ ์ผํ์ผ๋ก ๊ฐ๋ฐ๋์์ต๋๋ค. ์ค์ ๊ธ์ต ์๋ด์ด๋ ํฌ์ ๊ฒฐ์ ์๋ ๋ฐ๋์ ์ ๋ฌธ๊ฐ์ ์กฐ์ธ์ ๊ตฌํ์๊ธฐ ๋ฐ๋๋๋ค. |