Instructions to use BM-K/NewsKoT5-small with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use BM-K/NewsKoT5-small with Transformers:
# Load model directly from transformers import AutoTokenizer, AutoModelForSeq2SeqLM tokenizer = AutoTokenizer.from_pretrained("BM-K/NewsKoT5-small") model = AutoModelForSeq2SeqLM.from_pretrained("BM-K/NewsKoT5-small") - Notebooks
- Google Colab
- Kaggle
Create README.md
Browse files
README.md
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
language:
|
| 3 |
+
- ko
|
| 4 |
+
---
|
| 5 |
+
# NewsKoT5
|
| 6 |
+
The training data for this T5 model consists of Korean news articles (29GB). However, the performance has not been fine-tuned through the use of small batches and a limited number of training steps, so it may not be fully optimized.
|
| 7 |
+
|
| 8 |
+
## Quick tour
|
| 9 |
+
```python
|
| 10 |
+
from transformers import AutoTokenizer, T5ForConditionalGeneration
|
| 11 |
+
|
| 12 |
+
tokenizer = AutoTokenizer.from_pretrained("BM-K/NewsKoT5-small")
|
| 13 |
+
model = T5ForConditionalGeneration.from_pretrained("BM-K/NewsKoT5-small")
|
| 14 |
+
|
| 15 |
+
input_ids = tokenizer("한국형발사체 누리호가 실용급 <extra_id_0> 발사체로서 ‘데뷔’를 성공적으로 <extra_id_1>", return_tensors="pt").input_ids
|
| 16 |
+
labels = tokenizer("<extra_id_0> 위성 <extra_id_1> 마쳤다 <extra_id_2>", return_tensors="pt").input_ids
|
| 17 |
+
|
| 18 |
+
outputs = model(input_ids=input_ids,
|
| 19 |
+
labels=labels)
|
| 20 |
+
```
|
| 21 |
+
|
| 22 |
+
## News Summarization Performance (F1-score)
|
| 23 |
+
After restoring the model's tokenized output to the original text, Rouge performance was evaluated by comparing it to the reference and hypothesis tokenized using [mecab](https://konlpy.org/ko/v0.4.0/).
|
| 24 |
+
|
| 25 |
+
- Dacon 한국어 문서 생성요약 AI 경진대회 [Dataset](https://dacon.io/competitions/official/235673/overview/description)
|
| 26 |
+
- Training: 29,432
|
| 27 |
+
- Validation: 7,358
|
| 28 |
+
- Test: 9,182
|
| 29 |
+
|
| 30 |
+
| | #Param | rouge-1 |rouge-2|rouge-l|
|
| 31 |
+
|-------|--------:|--------:|--------:|--------:|
|
| 32 |
+
| pko-t5-small | 95M | 51.48 | 33.18 | 44.96 |
|
| 33 |
+
| NewsT5-small | 61M | 52.15 | 33.59 | 45.41 |
|
| 34 |
+
|
| 35 |
+
- AI-Hub 문서요약 텍스트 [Dataset](https://www.aihub.or.kr/aihubdata/data/view.do?currMenu=115&topMenu=100&aihubDataSe=realm&dataSetSn=97)
|
| 36 |
+
- Training: 245,626
|
| 37 |
+
- Validation: 20,296
|
| 38 |
+
- Test: 9,931
|
| 39 |
+
|
| 40 |
+
| | #Param | rouge-1 |rouge-2|rouge-l|
|
| 41 |
+
|-------|--------:|--------:|--------:|--------:|
|
| 42 |
+
| pko-t5-small | 95M | 53.44 | 34.03 | 45.36 |
|
| 43 |
+
| NewsT5-small | 61M | 53.74 | 34.27 | 45.52 |
|
| 44 |
+
|
| 45 |
+
- [pko-t5-small](https://github.com/paust-team/pko-t5)
|