

# Turkish BERT2BERT (shared) fine-tuned on MLSUM TR for summarization


## Model
[dbmdz/bert-base-turkish-cased](https://huggingface.co/dbmdz/bert-base-turkish-cased) (BERT Checkpoint)

## Dataset
**MLSUM** is the first large-scale MultiLingual SUMmarization dataset. Obtained from online newspapers, it contains 1.5M+ article/summary pairs in five different languages -- namely, French, German, Spanish, Russian, **Turkish**. Together with English newspapers from the popular CNN/Daily mail dataset, the collected data form a large scale multilingual dataset which can enable new research directions for the text summarization community. We report cross-lingual comparative analyses based on state-of-the-art systems. These highlight existing biases which motivate the use of a multi-lingual dataset.

[MLSUM tu/tr](https://huggingface.co/datasets/viewer/?dataset=mlsum)

## Results

|Set|Metric| Value|
|----|------|------|
| Test  |Rouge2 - mid -precision | **32.41**|
| Test | Rouge2 - mid - recall | **28.65**|
| Test | Rouge2 - mid - fmeasure | **29.48**|

## Usage

 ```python
 import torch
 from transformers import BertTokenizerFast, EncoderDecoderModel
 device = 'cuda' if torch.cuda.is_available() else 'cpu'
 ckpt = 'mrm8488/bert2bert_shared-turkish-summarization'
 tokenizer = BertTokenizerFast.from_pretrained(ckpt)
model = EncoderDecoderModel.from_pretrained(ckpt).to(device)

def generate_summary(text):

    inputs = tokenizer([text], padding="max_length", truncation=True, max_length=512, return_tensors="pt")
    input_ids = inputs.input_ids.to(device)
    attention_mask = inputs.attention_mask.to(device)
    output = model.generate(input_ids, attention_mask=attention_mask)
    return tokenizer.decode(output[0], skip_special_tokens=True)
    
text = "Your text here..."
generate_summary(text)
```

> Created by [Manuel Romero/@mrm8488](https://twitter.com/mrm8488) with the support of [Narrativa](https://www.narrativa.com/)

> Made with <span style="color: #e25555;">&hearts;</span> in Spain


{"language": "tr", "tags": ["summarization", "news"], "datasets": ["mlsum"], "widget": [{"text": "Ankara'da oto h\u0131rs\u0131zl\u0131k \u00e7etesine y\u00f6nelikd\u00fczenlenen \u2018Balta\u2019 operasyonunda, \u00e7ete lideri\u2018balta\u2019 lakapl\u0131 \u015fah\u0131s ile 7 ki\u015fi g\u00f6zalt\u0131na al\u0131nd\u0131.Di\u011fer bir operasyonda ise 3 \u015f\u00fcpheli \u00e7ald\u0131klar\u0131ara\u00e7lar\u0131 par\u00e7alarken yap\u0131lan bask\u0131nda su\u00e7\u00fcst\u00fcyakaland\u0131. Ankara Emniyet M\u00fcd\u00fcrl\u00fc\u011f\u00fc\u2019ne ba\u011fl\u0131Asayi\u015f \u015eube M\u00fcd\u00fcrl\u00fc\u011f\u00fc Oto H\u0131rs\u0131zl\u0131k B\u00fcro Amirli\u011fiekipleri, Ankara ilinde meydana gelen, otoh\u0131rs\u0131zl\u0131k olaylar\u0131na kar\u015f\u0131 Ankara CumhuriyetBa\u015fsavc\u0131l\u0131\u011f\u0131\u2019n\u0131n izniyle y\u00fcr\u00fctt\u00fckleri 3 ayl\u0131k\u00e7al\u0131\u015fma sonucunda operasyon d\u00fc\u011fmesine bast\u0131.Yap\u0131lan teknik ve fiziki takip sonucunda, \u2018Balta\u2019\u00e7etesine ula\u015f\u0131ld\u0131. \u00c7eteyi izleyen ekipler, Ankara,Konya ve Antalya\u2019da e\u015f zamanl\u0131 operasyond\u00fczenleyerek \u00e7ete lideri \u2018Balta\u2019 lakapl\u0131 Necati D.ve \u00e7ete \u00fcyesi 7 ki\u015fiyi yakalad\u0131. Takip edildi\u011finianlay\u0131nca ortadan kayboldu \u00c7ete lideri \u2018Balta\u2019n\u0131n,polis ekipleri taraf\u0131ndan izlendi\u011fini anlad\u0131\u011f\u0131 veaylarca ortada g\u00f6r\u00fcnmedi\u011fini tespit eden H\u0131rs\u0131zl\u0131kB\u00fcro ekipleri, \u2018Balta\u2019n\u0131n kendi su\u00e7 ortaklar\u0131n\u0131 dadoland\u0131rmaya \u00e7al\u0131\u015ft\u0131\u011f\u0131n\u0131 saptad\u0131. Adliyeye sevkedilen \u015f\u00fcphelilerden haklar\u0131nda \u00e7ok say\u0131da otoh\u0131rs\u0131zl\u0131k kayd\u0131 bulunan \u00e7ete lideri Necati D.,Ferhat K., Atakan A. ve Tayfun G., \u00e7\u0131kar\u0131ld\u0131klar\u0131n\u00f6bet\u00e7i sulh hakimli\u011fince tutuklanarak cezaevineg\u00f6nderildi. Di\u011fer 3 \u015f\u00fcpheli ise adli kontrol\u015fart\u0131yla serbest b\u0131rak\u0131ld\u0131. \u00c7ald\u0131klar\u0131 ara\u00e7lar\u0131par\u00e7alarken polis bast\u0131 Di\u011fer bir olay iseAlt\u0131nda\u011f il\u00e7esinde meydana geldi. H\u0131rs\u0131zl\u0131k B\u00fcroekipleri inceledikleri 2 oto h\u0131rs\u0131zl\u0131k olay\u0131n\u0131nsonucunda 3 \u015f\u00fcpheliyi takibe ald\u0131. \u015e\u00fcphelilerin\u00e7ald\u0131klar\u0131 2 arac\u0131 \u0130vedik Hurdac\u0131lar Sitesi\u2019ndekidepolar\u0131nda par\u00e7alayacaklar\u0131n\u0131 belirleyen ekiplerharekete ge\u00e7ti. Depoya bask\u0131n yapan polisekipleri, 3 \u015f\u00fcpheliyi su\u00e7\u00fcst\u00fc yakalad\u0131.Emniyetteki i\u015flemlerinin ard\u0131ndan adliyeye sevkedilen h\u0131rs\u0131zl\u0131k zanl\u0131lar\u0131, \u00e7\u0131kar\u0131ld\u0131klar\u0131 n\u00f6bet\u00e7imahkeme taraf\u0131ndan adli kontrol \u015fart\u0131yla serbestb\u0131rak\u0131ld\u0131."}]}
transformers pytorch safetensors encoder-decoder text2text-generation summarization news tr dataset:mlsum autotrain_compatible endpoints_compatible has_space region:us
TAGS
#transformers #pytorch #safetensors #encoder-decoder #text2text-generation #summarization #news #tr #dataset-mlsum #autotrain_compatible #endpoints_compatible #has_space #region-us 

Turkish BERT2BERT (shared) fine-tuned on MLSUM TR for summarization
===================================================================


Model
-----


dbmdz/bert-base-turkish-cased (BERT Checkpoint)


Dataset
-------


MLSUM is the first large-scale MultiLingual SUMmarization dataset. Obtained from online newspapers, it contains 1.5M+ article/summary pairs in five different languages -- namely, French, German, Spanish, Russian, Turkish. Together with English newspapers from the popular CNN/Daily mail dataset, the collected data form a large scale multilingual dataset which can enable new research directions for the text summarization community. We report cross-lingual comparative analyses based on state-of-the-art systems. These highlight existing biases which motivate the use of a multi-lingual dataset.


MLSUM tu/tr


Results
-------


Set: Test, Metric: Rouge2 - mid -precision, Value: 32.41
Set: Test, Metric: Rouge2 - mid - recall, Value: 28.65
Set: Test, Metric: Rouge2 - mid - fmeasure, Value: 29.48


Usage
-----



> 
> Created by Manuel Romero/@mrm8488 with the support of Narrativa
> 
> 
> 



> 
> Made with ♥ in Spain
> 
> 
> 



TAGS
#transformers #pytorch #safetensors #encoder-decoder #text2text-generation #summarization #news #tr #dataset-mlsum #autotrain_compatible #endpoints_compatible #has_space #region-us 

passage: TAGS
#transformers #pytorch #safetensors #encoder-decoder #text2text-generation #summarization #news #tr #dataset-mlsum #autotrain_compatible #endpoints_compatible #has_space #region-us 
