🚀 Turkish News Summarization Model Based on mT5
This model is designed to summarize Turkish news texts. It leverages the power of the mT5 architecture, specifically fine - tuned for the task of summarizing Turkish news. Built upon the google/mt5 - base
architecture, it is trained on a dataset composed of Turkish economic and current news texts, aiming to provide users with the most crucial points of the news by generating summaries.
🚀 Quick Start
Basic Usage
from transformers import MT5Tokenizer, MT5ForConditionalGeneration
model_name = 'nebiberke/news - sum - tr'
tokenizer = MT5Tokenizer.from_pretrained(model_name)
model = MT5ForConditionalGeneration.from_pretrained(model_name)
news_text = "Buraya Türkçe haber metni gelecek."
input_ids = tokenizer.encode(news_text, return_tensors="pt", max_length=512, truncation=True)
summary_ids = model.generate(input_ids, max_length=150, min_length=30, length_penalty=2.0, num_beams=7, early_stopping=True)
summary = tokenizer.decode(summary_ids[0], skip_special_tokens=True)
print("Summary:", summary)
✨ Features
- Summarization: The primary function of this model is to transform long Turkish news texts into short and understandable summaries.
- Potential Applications: It can be used in news summarization platforms.
📦 Installation
No specific installation steps are provided in the original document, so this section is skipped.
💻 Usage Examples
Basic Usage
from transformers import MT5Tokenizer, MT5ForConditionalGeneration
model_name = 'nebiberke/news - sum - tr'
tokenizer = MT5Tokenizer.from_pretrained(model_name)
model = MT5ForConditionalGeneration.from_pretrained(model_name)
news_text = "Buraya Türkçe haber metni gelecek."
input_ids = tokenizer.encode(news_text, return_tensors="pt", max_length=512, truncation=True)
summary_ids = model.generate(input_ids, max_length=150, min_length=30, length_penalty=2.0, num_beams=7, early_stopping=True)
summary = tokenizer.decode(summary_ids[0], skip_special_tokens=True)
print("Summary:", summary)
Advanced Usage
There are no advanced usage examples in the original document, so this part is not added.
📚 Documentation
Model Information
This model is based on mT5 and is fine - tuned specifically for summarizing Turkish news texts. It is built on the google/mT5 - base
architecture and trained on a combined dataset of batubayk/TR - News
and denizzhansahin/100K - TR - News
.
Model Purpose
The main purpose of this model is to convert long Turkish news texts into short and understandable summaries. Potential use cases include news summarization platforms.
Dataset
The model is trained on a combined dataset of batubayk/TR - News
and denizzhansahin/100K - TR - News
. The dataset contains Turkish economic and current news content, where each news text is paired with a summary.
- Training and Test Split: The dataset is split into 80% for training and 20% for testing.
- Maximum Input Length: 512 tokens
- Maximum Output Length (Summary): 150 tokens
Training Details
- Model Architecture: MT5 - base
- Training Objective: Seq2Seq summarization
- Batch Size: 4
- Number of Epochs: 6
- Weight Decay: 0.01
- Learning Rate: 5e - 5
- Evaluation Strategy: Evaluation is conducted at the end of each epoch.
- Logging: Logging is done at the end of each epoch.
- Device: CUDA - enabled GPU
Training and Evaluation Losses
- At the end of the first epoch, the training loss is 0.6440, and the validation loss is 0.5474.
- At the end of the last epoch, the training loss is 0.4879, and the validation loss is 0.4721.
Evaluation Results
The performance of the model is evaluated using ROUGE and BERTScore metrics.
ROUGE Scores:
- ROUGE - 1: Precision: 0.4231, Recall: 0.5000, F1 - score: 0.4583
- ROUGE - 2: Precision: 0.2400, Recall: 0.2857, F1 - score: 0.2609
- ROUGE - L: Precision: 0.4231, Recall: 0.5000, F1 - score: 0.4583
BERTScore:
- Precision: 0.9031
- Recall: 0.9196
- F1 - score: 0.9113
Limitations and Biases
- The model may learn biases present in the training data and reflect them in the summaries.
- A decline in summarization quality may be observed, especially for very long and complex news texts.
📄 License
No license information is provided in the original document, so this section is skipped.
📚 Additional Information
Property |
Details |
Model Type |
Summarization model based on mT5 |
Training Data |
Combined dataset of batubayk/TR - News and denizzhansahin/100K - TR - News |
Pipeline Tag |
Summarization |
Library Name |
transformers |
Tags |
Summarization, transformers |
Metrics |
BERTScore, ROUGE |
📖 Citation
If you use this model, please cite it as follows:
@article{2024turkishsummarization,
title={mT5 Tabanlı Türkçe Haber Özetleme Modeli},
author={Nebi Berke İçöz},
year={2024},
url={https://huggingface.co/nebiberke/news - sum - tr}
}