assamim commited on
Commit
e8e9af7
1 Parent(s): 27653f5

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +34 -37
README.md CHANGED
@@ -1,6 +1,10 @@
1
  ---
2
  tags:
3
  - generated_from_keras_callback
 
 
 
 
4
  model-index:
5
  - name: assamim/mt5-pukulenam-summarization
6
  results: []
@@ -11,43 +15,36 @@ probably proofread and complete it, then remove this comment. -->
11
 
12
  # assamim/mt5-pukulenam-summarization
13
 
14
- This model is a fine-tuned version of [csebuetnlp/mT5_multilingual_XLSum](https://huggingface.co/csebuetnlp/mT5_multilingual_XLSum) on an unknown dataset.
15
- It achieves the following results on the evaluation set:
16
- - Train Loss: 1.7639
17
- - Validation Loss: 1.8188
18
- - Train Rouge1: 36.5639
19
- - Train Rouge2: 17.0888
20
- - Train Rougel: 31.0462
21
- - Train Rougelsum: 31.1825
22
- - Train Gen Len: 30.735
23
- - Epoch: 0
24
-
25
- ## Model description
26
-
27
- More information needed
28
-
29
- ## Intended uses & limitations
30
-
31
- More information needed
32
-
33
- ## Training and evaluation data
34
-
35
- More information needed
36
-
37
- ## Training procedure
38
-
39
- ### Training hyperparameters
40
-
41
- The following hyperparameters were used during training:
42
- - optimizer: {'name': 'AdamWeightDecay', 'learning_rate': 2e-05, 'decay': 0.0, 'beta_1': 0.9, 'beta_2': 0.999, 'epsilon': 1e-07, 'amsgrad': False, 'weight_decay_rate': 0.01}
43
- - training_precision: float32
44
-
45
- ### Training results
46
-
47
- | Train Loss | Validation Loss | Train Rouge1 | Train Rouge2 | Train Rougel | Train Rougelsum | Train Gen Len | Epoch |
48
- |:----------:|:---------------:|:------------:|:------------:|:------------:|:---------------:|:-------------:|:-----:|
49
- | 1.7639 | 1.8188 | 36.5639 | 17.0888 | 31.0462 | 31.1825 | 30.735 | 0 |
50
-
51
 
52
  ### Framework versions
53
 
 
1
  ---
2
  tags:
3
  - generated_from_keras_callback
4
+ - Summarization
5
+ - mT5
6
+ datasets:
7
+ - csebuetnlp/xlsum
8
  model-index:
9
  - name: assamim/mt5-pukulenam-summarization
10
  results: []
 
15
 
16
  # assamim/mt5-pukulenam-summarization
17
 
18
+ This model is a fine-tuned version of [csebuetnlp/mT5_multilingual_XLSum](https://huggingface.co/csebuetnlp/mT5_multilingual_XLSum) on an [csebuetnlp/xlsum](https://huggingface.co/datasets/csebuetnlp/xlsum) dataset
19
+
20
+ ## Using this model in `transformers` (tested on 4.19.2)
21
+
22
+ ```python
23
+ from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
24
+ import re
25
+ news = """
26
+ Anggota Unit Perlindungan Rakyat Kurdi di kota Rabia, pada perbatasan Irak-Suriah. Pasukan Kurdi Irak dilaporkan sudah menguasai kembali kota Rabia meskipun banyak korban jatuh. Pejabat senior Kurdi Irak mengatakan pasukan Kurdi Peshmerga mencatat kemajuan lewat serangan dini hari di Rabia. Sementara itu, milisi ISIS berusaha memukul mundur pasukan Kurdi Suriah di bagian lain perbatasan. Hal ini terjadi saat koalisi pimpinan Amerika terus melanjutkan serangan udara terhadap sasaran ISIS di Suriah dan Irak. Hari Selasa (30 September) dilaporkan juga terjadi serangkaian serangan bom di ibu kota Irak, Baghdad dan kota suci Syiah, Karbala. Dalam perkembangan terpisah, sejumlah tank Turki berada di bukit di sepanjang perbatasan dekat kota Kobane, Suriah setelah sejumlah bom mengenai wilayah Turki saat terjadi bentrokan dengan milisi ISIS dan pejuang Kurdi. Pemerintah Turki diperkirakan akan menyampaikan mosi ke parlemen, agar menyetujui aksi militer terhadap ISIS di Irak dan Suriah.
27
+ """
28
+ tokenizer = AutoTokenizer.from_pretrained("assamim/mt5-small-indonesian-sum")
29
+ model = AutoModelForSeq2SeqLM.from_pretrained("assamim/mt5-small-indonesian-sum", from_tf=True)
30
+ WHITESPACE_HANDLER = lambda k: re.sub('\s+', ' ', re.sub('\n+', ' ', k.strip()))
31
+ input_ids = tokenizer.encode(WHITESPACE_HANDLER(news1), return_tensors='pt')
32
+ summary_ids = model.generate(input_ids,
33
+ min_length=20,
34
+ max_length=200,
35
+ num_beams=7,
36
+ repetition_penalty=2.5,
37
+ length_penalty=1.0,
38
+ early_stopping=True,
39
+ no_repeat_ngram_size=2,
40
+ use_cache=True,
41
+ do_sample = True,
42
+ temperature = 0.8,
43
+ top_k = 50,
44
+ top_p = 0.95)
45
+ summary_text = tokenizer.decode(summary_ids[0], skip_special_tokens=True)
46
+ print(summary_text)
47
+ ```
 
 
 
 
 
 
 
48
 
49
  ### Framework versions
50