๊ธ์ต ํ ์คํธ ๊ฐ์ํ ๋ชจ๋ธ (Financial Text Simplifier)
๋ชจ๋ธ ์ค๋ช
fin_simplifier๋ ๋ณต์กํ ๊ธ์ต ์ฉ์ด์ ๋ฌธ์ฅ์ ์ผ๋ฐ์ธ์ด ์ดํดํ๊ธฐ ์ฌ์ด ํ๊ตญ์ด๋ก ๋ณํํ๋ ์ธ์ฝ๋-๋์ฝ๋ ๋ชจ๋ธ์ ๋๋ค.
๋ชจ๋ธ ๊ตฌ์กฐ (config.json ๊ธฐ๋ฐ)
- ๋ชจ๋ธ ํ์ : EncoderDecoderModel
- ์ธ์ฝ๋: snunlp/KR-FinBert-SC (์๋ ์ฐจ์: 768)
- ๋์ฝ๋: skt/kogpt2-base-v2 (์ดํ ํฌ๊ธฐ: 51,201)
- ํ๋ผ๋ฏธํฐ ์: ์ฝ 255M
- ํ์ผ ํฌ๊ธฐ: 1.02GB (safetensors ํ์)
์ฃผ์ ํน์ง
- ๊ธ์ต ์ ๋ฌธ ์ฉ์ด๋ฅผ ์ฌ์ด ์ผ์์ด๋ก ๋ณํ
- ํ๊ตญ์ด ๊ธ์ต ๋ฌธ์์ ์ต์ ํ
- ๋ณต์กํ ๊ธ์ต ๊ฐ๋ ๊ฐ์ํ (PER, ROE, ํ์์ํ ๋ฑ)
- ์ํ ์๋ด ๋ฐ ๊ธ์ต ๊ต์ก ํ์ฉ ๊ฐ๋ฅ
์ฌ์ฉ ๋ชฉ์
์ฃผ์ ํ์ฉ ์ฌ๋ก
- ๊ธ์ต ์๋ด ์ง์: ์ํ ์๋ด ์ ๊ณ ๊ฐ ์ดํด๋ ํฅ์
- ๊ธ์ต ๊ต์ก: ๋ณต์กํ ๊ธ์ต ๊ฐ๋ ์ ์ฝ๊ฒ ์ค๋ช
- ๋ฌธ์ ๊ฐ์ํ: ์ฝ๊ด, ์ํ ์ค๋ช ์ ๋ฑ์ ์ดํดํ๊ธฐ ์ฝ๊ฒ ๋ณํ
- ์ ๊ทผ์ฑ ๊ฐ์ : ๊ธ์ต ์์ธ๊ณ์ธต์ ๊ธ์ต ์๋น์ค ์ ๊ทผ์ฑ ํฅ์
์ฌ์ฉ ์ ํ ์ฌํญ
- ๋ฒ์ ๊ตฌ์๋ ฅ์ด ์๋ ๋ฌธ์ ์์ฑ
- ํฌ์ ์กฐ์ธ ๋๋ ๊ธ์ต ์๋ด ๋์ฒด
- ์ ํํ ์์น๋ ๊ณ์ฐ์ด ํ์ํ ๊ฒฝ์ฐ
์ฌ์ฉ ๋ฐฉ๋ฒ
์ค์น
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
์ถ๋ก ์์
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}")
# ์ถ๋ ฅ ์์: ๋ชจ๋ธ์ด ์์ฑํ๋ ๊ฐ์ํ๋ ํ
์คํธ
ํ์ต ์์ธ ์ ๋ณด
ํ์ต ๋ฐ์ดํฐ์
๋ฐ์ดํฐ์ ์์ฒด ์ ์ ๋ฐ์ดํฐ์ -์ถ์ฒ: NH๋ํ์ํ -NH๋ํ์ํ ์ํ์ค๋ช ์๋ฅผ gemma ๋ชจ๋ธ์ ํฌ์ ํ์ฌ ๋ณํํ์ฌ ์์ฑ
ํ์ต ์ค์ (trainer_state.json ๊ธฐ๋ฐ)
- ์ํฌํฌ: 10
- ๋ฐฐ์น ํฌ๊ธฐ: 4 (gradient accumulation steps: 2)
- ์ต๋ ํ์ต๋ฅ : 2.99e-05
- ์ต์ข ํ์ต๋ฅ : 8.82e-09
- ์ตํฐ๋ง์ด์ : AdamW (warmup steps: 200)
- ๋ ์ด๋ธ ์ค๋ฌด๋ฉ: 0.1
- ๋๋กญ์์: 0.2 (์ธ์ฝ๋ ๋ฐ ๋์ฝ๋)
์์ฑ ํ์ดํผํ๋ผ๋ฏธํฐ
- Beam Search: 6 beams
- Repetition Penalty: 1.2
- Length Penalty: 0.8
- Temperature: 0.7
- Top-k: 50
- Top-p: 0.95
ํ๊ฐ ๊ฒฐ๊ณผ
ํ์ต ์ฑ๊ณผ (trainer_state.json ๊ธฐ์ค)
- ์ด๊ธฐ ์์ค: 13.53
- ์ต์ข ์์ค: 3.76
- ์์ค ๊ฐ์์จ: 72.2%
- ์ด ํ์ต ์คํ : 3,600
- ์๋ ด ํจํด: ์ํฌํฌ 8๋ถํฐ ์์ ์ ์๋ ด
์ํฌํฌ๋ณ ํ๊ท ์์ค
์ํฌํฌ | ํ๊ท ์์ค |
---|---|
1 | 8.98 |
2 | 6.93 |
3 | 5.95 |
4 | 5.28 |
5 | 4.81 |
6 | 4.44 |
7 | 4.17 |
8 | 3.97 |
9 | 3.82 |
10 | 3.73 |
์์ ์ถ๋ ฅ
์๋ฌธ (Complex) | ๋ณํ ๊ฒฐ๊ณผ (Simplified) |
---|---|
์๊ฐ์ด์ก์ ๋ฐํ์ฃผ์์์ ์ฃผ๊ฐ๋ฅผ ๊ณฑํ ๊ฐ์ผ๋ก ๊ธฐ์ ์ ์์ฅ๊ฐ์น๋ฅผ ๋ํ๋ ๋๋ค. | ์๊ฐ์ด์ก์ ํ์ฌ์ ๋ชจ๋ ์ฃผ์์ ํฉ์น ๊ฐ๊ฒฉ์ ๋๋ค. |
ํ์๊ฒฐํฉ์ฆ๊ถ์ ๊ธฐ์ด์์ฐ์ ๊ฐ๊ฒฉ๋ณ๋์ ์ฐ๊ณํ์ฌ ์์ต์ด ๊ฒฐ์ ๋๋ ์ฆ๊ถ์ ๋๋ค. | ํ์๊ฒฐํฉ์ฆ๊ถ์ ๋ค๋ฅธ ์ํ ๊ฐ๊ฒฉ์ ๋ฐ๋ผ ์์ต์ด ๋ฐ๋๋ ํฌ์ ์ํ์ ๋๋ค. |
ํ๋งค์กฐ๊ฑด๋ถ์ฑ๊ถ(RP)์ ์ผ์ ๊ธฐ๊ฐ ํ ๋ค์ ๋งค์ ํ๋ ์กฐ๊ฑด์ผ๋ก ๋งค๋ํ๋ ์ฑ๊ถ์ ๋๋ค. | RP๋ ๋์ค์ ๋ค์ ์ฌ๊ฒ ๋ค๊ณ ์ฝ์ํ๊ณ ์ผ๋จ ํ๋ ์ฑ๊ถ์ ๋๋ค. |
์ ๋์ฑ์ํ์ ์์ฐ์ ์ ์ ๊ฐ๊ฒฉ์ ํ๊ธํํ์ง ๋ชปํ ์ํ์ ๋๋ค. | ์ ๋์ฑ์ํ์ ๊ธํ๊ฒ ํ ๋ ์ ๊ฐ์ ๋ชป ๋ฐ์ ์ํ์ ๋๋ค. |
์๋ฆฌ๊ธ๊ท ๋ฑ์ํ์ ๋งค์ ๋์ผํ ๊ธ์ก์ผ๋ก ์๊ธ๊ณผ ์ด์๋ฅผ ์ํํ๋ ๋ฐฉ์์ ๋๋ค. | ์๋ฆฌ๊ธ๊ท ๋ฑ์ํ์ ๋งค๋ฌ ๊ฐ์ ๊ธ์ก์ ๊ฐ๋ ๋ฐฉ์์ ๋๋ค. |
์ธ์ฉ
@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}
}
๊ฐ์ฌ์ ๋ง
- KR-FinBert-SC: ๊ธ์ต ๋๋ฉ์ธ ํนํ ์ธ์ฝ๋ ์ ๊ณต
- SKT KoGPT2: ํ๊ตญ์ด ์์ฑ ๋ชจ๋ธ ์ ๊ณต
์ฐ๋ฝ์ฒ
- HuggingFace: combe4259
- Model Card: ๋ฌธ์์ฌํญ์ HuggingFace ํ ๋ก ํญ์ ์ด์ฉํด์ฃผ์ธ์
- Downloads last month
- 112
Inference Providers
NEW
This model isn't deployed by any Inference Provider.
๐
Ask for provider support