Update README.md
Browse files
README.md
CHANGED
@@ -1,199 +1,100 @@
|
|
1 |
---
|
2 |
library_name: transformers
|
3 |
-
tags:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4 |
---
|
5 |
|
6 |
# Model Card for Model ID
|
7 |
|
8 |
-
|
9 |
|
|
|
10 |
|
|
|
11 |
|
12 |
-
|
13 |
-
|
14 |
-
### Model Description
|
15 |
-
|
16 |
-
<!-- Provide a longer summary of what this model is. -->
|
17 |
|
18 |
-
|
19 |
|
20 |
-
|
21 |
-
- **Funded by [optional]:** [More Information Needed]
|
22 |
-
- **Shared by [optional]:** [More Information Needed]
|
23 |
-
- **Model type:** [More Information Needed]
|
24 |
-
- **Language(s) (NLP):** [More Information Needed]
|
25 |
-
- **License:** [More Information Needed]
|
26 |
-
- **Finetuned from model [optional]:** [More Information Needed]
|
27 |
|
28 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
29 |
|
30 |
-
|
31 |
|
32 |
-
|
33 |
-
|
34 |
-
- **Demo [optional]:** [More Information Needed]
|
35 |
|
36 |
## Uses
|
37 |
|
38 |
-
|
39 |
-
|
40 |
-
### Direct Use
|
41 |
-
|
42 |
-
<!-- This section is for the model use without fine-tuning or plugging into a larger ecosystem/app. -->
|
43 |
-
|
44 |
-
[More Information Needed]
|
45 |
-
|
46 |
-
### Downstream Use [optional]
|
47 |
-
|
48 |
-
<!-- This section is for the model use when fine-tuned for a task, or when plugged into a larger ecosystem/app -->
|
49 |
-
|
50 |
-
[More Information Needed]
|
51 |
-
|
52 |
-
### Out-of-Scope Use
|
53 |
-
|
54 |
-
<!-- This section addresses misuse, malicious use, and uses that the model will not work well for. -->
|
55 |
-
|
56 |
-
[More Information Needed]
|
57 |
|
58 |
## Bias, Risks, and Limitations
|
59 |
|
60 |
-
|
61 |
-
|
62 |
-
[More Information Needed]
|
63 |
-
|
64 |
-
### Recommendations
|
65 |
-
|
66 |
-
<!-- This section is meant to convey recommendations with respect to the bias, risk, and technical limitations. -->
|
67 |
-
|
68 |
-
Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model. More information needed for further recommendations.
|
69 |
-
|
70 |
-
## How to Get Started with the Model
|
71 |
-
|
72 |
-
Use the code below to get started with the model.
|
73 |
-
|
74 |
-
[More Information Needed]
|
75 |
|
76 |
## Training Details
|
77 |
|
78 |
### Training Data
|
79 |
|
80 |
-
|
81 |
-
|
82 |
-
[More Information Needed]
|
83 |
|
84 |
### Training Procedure
|
85 |
|
86 |
-
|
87 |
-
|
88 |
-
#### Preprocessing [optional]
|
89 |
-
|
90 |
-
[More Information Needed]
|
91 |
-
|
92 |
-
|
93 |
-
#### Training Hyperparameters
|
94 |
-
|
95 |
-
- **Training regime:** [More Information Needed] <!--fp32, fp16 mixed precision, bf16 mixed precision, bf16 non-mixed precision, fp16 non-mixed precision, fp8 mixed precision -->
|
96 |
-
|
97 |
-
#### Speeds, Sizes, Times [optional]
|
98 |
|
99 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
100 |
|
101 |
-
|
102 |
|
103 |
## Evaluation
|
104 |
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
### Results
|
128 |
-
|
129 |
-
[More Information Needed]
|
130 |
-
|
131 |
-
#### Summary
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
## Model Examination [optional]
|
136 |
-
|
137 |
-
<!-- Relevant interpretability work for the model goes here -->
|
138 |
-
|
139 |
-
[More Information Needed]
|
140 |
-
|
141 |
-
## Environmental Impact
|
142 |
-
|
143 |
-
<!-- Total emissions (in grams of CO2eq) and additional considerations, such as electricity usage, go here. Edit the suggested text below accordingly -->
|
144 |
-
|
145 |
-
Carbon emissions can be estimated using the [Machine Learning Impact calculator](https://mlco2.github.io/impact#compute) presented in [Lacoste et al. (2019)](https://arxiv.org/abs/1910.09700).
|
146 |
-
|
147 |
-
- **Hardware Type:** [More Information Needed]
|
148 |
-
- **Hours used:** [More Information Needed]
|
149 |
-
- **Cloud Provider:** [More Information Needed]
|
150 |
-
- **Compute Region:** [More Information Needed]
|
151 |
-
- **Carbon Emitted:** [More Information Needed]
|
152 |
-
|
153 |
-
## Technical Specifications [optional]
|
154 |
-
|
155 |
-
### Model Architecture and Objective
|
156 |
-
|
157 |
-
[More Information Needed]
|
158 |
-
|
159 |
-
### Compute Infrastructure
|
160 |
-
|
161 |
-
[More Information Needed]
|
162 |
-
|
163 |
-
#### Hardware
|
164 |
-
|
165 |
-
[More Information Needed]
|
166 |
-
|
167 |
-
#### Software
|
168 |
-
|
169 |
-
[More Information Needed]
|
170 |
-
|
171 |
-
## Citation [optional]
|
172 |
-
|
173 |
-
<!-- If there is a paper or blog post introducing the model, the APA and Bibtex information for that should go in this section. -->
|
174 |
-
|
175 |
-
**BibTeX:**
|
176 |
-
|
177 |
-
[More Information Needed]
|
178 |
-
|
179 |
-
**APA:**
|
180 |
-
|
181 |
-
[More Information Needed]
|
182 |
-
|
183 |
-
## Glossary [optional]
|
184 |
-
|
185 |
-
<!-- If relevant, include terms and calculations in this section that can help readers understand the model or model card. -->
|
186 |
-
|
187 |
-
[More Information Needed]
|
188 |
-
|
189 |
-
## More Information [optional]
|
190 |
-
|
191 |
-
[More Information Needed]
|
192 |
-
|
193 |
-
## Model Card Authors [optional]
|
194 |
-
|
195 |
-
[More Information Needed]
|
196 |
-
|
197 |
-
## Model Card Contact
|
198 |
-
|
199 |
-
[More Information Needed]
|
|
|
1 |
---
|
2 |
library_name: transformers
|
3 |
+
tags:
|
4 |
+
- summarization
|
5 |
+
- text-to-text
|
6 |
+
- turkish
|
7 |
+
- abstractive-summarization
|
8 |
+
license: apache-2.0
|
9 |
+
datasets:
|
10 |
+
- yeniguno/turkish-news-summary-onesentence
|
11 |
+
language:
|
12 |
+
- tr
|
13 |
+
base_model:
|
14 |
+
- mukayese/mt5-base-turkish-summarization
|
15 |
+
pipeline_tag: summarization
|
16 |
---
|
17 |
|
18 |
# Model Card for Model ID
|
19 |
|
20 |
+
This model is a fine-tuned version of mukayese/mt5-base-turkish-summarization, specifically adapted for generating concise and coherent summaries of Turkish news articles. The fine-tuning was performed using the yeniguno/turkish-news-summary-onesentence dataset, which consists of approximately 60,000 Turkish news articles paired with one-sentence summaries. The objective is to enhance the model's ability to produce shorter, more concise, and compact news summaries.
|
21 |
|
22 |
+
## How to Get Started with the Model
|
23 |
|
24 |
+
Use the code below to get started with the model.
|
25 |
|
26 |
+
```python
|
27 |
+
from transformers import pipeline
|
|
|
|
|
|
|
28 |
|
29 |
+
pipe = pipeline("summarization", model="yeniguno/turkish-abstractive-summary-mt5")
|
30 |
|
31 |
+
text = """Brezilya'nın kuzeydoğu kıyısındaki Recife kentinde yangın çıkan bir gökdelen alevlere teslim oldu. Paylaşılan video kaydında, binayı alt katlarından üst katlarına kadar alevlerin sardığı görüldü. İlk belirlemelere göre ölen ya da yaralanan olmadı. Timesnow'ın haberine göre, binadan molozlar düşmesi nedeniyle civardaki binaların elektriği kesildi ve binalar tahliye edildi."""
|
|
|
|
|
|
|
|
|
|
|
|
|
32 |
|
33 |
+
response = pipe(
|
34 |
+
text,
|
35 |
+
max_length=150, # Adjust as needed
|
36 |
+
num_beams=4, # Beam search for better quality
|
37 |
+
length_penalty=3.0, # Penalize longer sequences
|
38 |
+
early_stopping=True # Stop when at least num_beams sentences are finished)
|
39 |
+
)
|
40 |
|
41 |
+
print(response[0]["summary_text"])
|
42 |
|
43 |
+
# Brezilya'nın Recebi kentinde yangın çıkan gökdelen, alevlere teslim olurken, binadan molozlar düşmesi nedeniyle binaların elektriği kesildi ve tahliye edildi.
|
44 |
+
```
|
|
|
45 |
|
46 |
## Uses
|
47 |
|
48 |
+
This model is intended for applications requiring the summarization of Turkish news content, such as news aggregation platforms, content curation services, and applications aiming to provide quick overviews of lengthy news articles.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
49 |
|
50 |
## Bias, Risks, and Limitations
|
51 |
|
52 |
+
The model's performance is contingent upon the quality and diversity of the training data. It may not perform optimally on news topics or styles not represented in the training dataset. Users should exercise caution and consider the context when interpreting the generated summaries.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
53 |
|
54 |
## Training Details
|
55 |
|
56 |
### Training Data
|
57 |
|
58 |
+
The model was fine-tuned on the yeniguno/turkish-news-summary-onesentence dataset, comprising approximately 60,000 Turkish news articles and their corresponding one-sentence summaries.
|
|
|
|
|
59 |
|
60 |
### Training Procedure
|
61 |
|
62 |
+
The model was fine-tuned using **mukayese/mt5-base-turkish-summarization** on the **yeniguno/turkish-news-summary-onesentence** dataset. The training was conducted using **Hugging Face's `transformers` library** with the following hyperparameters:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
63 |
|
64 |
+
- **Learning Rate**: `5e-6`
|
65 |
+
- **Batch Size**: `8` per device for both training and evaluation
|
66 |
+
- **Weight Decay**: `0.01`
|
67 |
+
- **Epochs**: `10`
|
68 |
+
- **Evaluation Strategy**: `epoch` (evaluated at the end of each epoch)
|
69 |
+
- **Loss Function**: Cross-entropy loss
|
70 |
+
- **Optimizer**: AdamW
|
71 |
+
- **Training Steps**: `49,560`
|
72 |
+
- **Total FLOPs**: `7.78e+17`
|
73 |
+
- **Predict with Generate**: Enabled
|
74 |
|
75 |
+
The fine-tuning process was conducted on a **single GPU**, with dynamic padding applied using the `DataCollatorForSeq2Seq`.
|
76 |
|
77 |
## Evaluation
|
78 |
|
79 |
+
To assess the model's performance, we used **ROUGE scores**, a widely used metric for text summarization tasks. The following metrics were calculated on the validation set at the end of each epoch:
|
80 |
+
|
81 |
+
| Epoch | Training Loss | Validation Loss | ROUGE-1 | ROUGE-2 | ROUGE-L | Gen Len |
|
82 |
+
|-------|--------------|----------------|---------|---------|---------|---------|
|
83 |
+
| 1 | 1.3854 | 1.2058 | 35.10 | 22.95 | 31.92 | 8.86 |
|
84 |
+
| 2 | 1.2895 | 1.1541 | 36.27 | 24.05 | 33.05 | 8.87 |
|
85 |
+
| 3 | 1.2631 | 1.1258 | 36.58 | 24.55 | 33.41 | 8.85 |
|
86 |
+
| 4 | 1.2318 | 1.1072 | 36.98 | 24.95 | 33.80 | 8.84 |
|
87 |
+
| 5 | 1.2130 | 1.0946 | 37.17 | 25.18 | 34.01 | 8.83 |
|
88 |
+
| 6 | 1.1948 | 1.0861 | 37.38 | 25.41 | 34.22 | 8.83 |
|
89 |
+
| 7 | 1.1888 | 1.0803 | 37.56 | 25.60 | 34.39 | 8.83 |
|
90 |
+
| 8 | 1.1810 | 1.0764 | 37.58 | 25.63 | 34.41 | 8.84 |
|
91 |
+
| 9 | 1.1690 | 1.0738 | 37.68 | 25.74 | 34.52 | 8.83 |
|
92 |
+
| 10 | 1.1814 | 1.0732 | 37.68 | 25.73 | 34.52 | 8.84 |
|
93 |
+
|
94 |
+
- **ROUGE-1**: Measures the overlap of unigrams between generated summaries and reference summaries.
|
95 |
+
- **ROUGE-2**: Measures the overlap of bigrams.
|
96 |
+
- **ROUGE-L**: Measures the longest common subsequence between reference and generated summaries.
|
97 |
+
- **Gen Len**: Represents the average length of generated summaries.
|
98 |
+
|
99 |
+
After **10 epochs**, the model achieved **ROUGE-1: 37.68, ROUGE-2: 25.73, ROUGE-L: 34.52** on the validation dataset, indicating improved summarization capabilities.
|
100 |
+
At the end of training, the **final training loss was 1.2444**, with the last recorded **validation loss of 1.0732**. The model was optimized to generate more concise and compact Turkish news summaries while maintaining high **semantic accuracy and readability**.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|