chatthai commited on
Commit
9befb5f
1 Parent(s): 284d13e

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +15 -4
README.md CHANGED
@@ -27,13 +27,24 @@ from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
27
 
28
  tokenizer = AutoTokenizer.from_pretrained("preechanon/mt5-base-thaisum-text-summarization")
29
  model = AutoModelForSeq2SeqLM.from_pretrained("preechanon/mt5-base-thaisum-text-summarization")
 
 
 
 
 
 
 
 
 
 
 
30
  ```
31
 
32
  ### Score
33
- - Rouge1: 0.478420
34
- - Rouge2: 0.308502
35
- - Rougel: 0.392542
36
- - Rougelsum: 0.434619
37
 
38
  ### Training hyperparameters
39
 
 
27
 
28
  tokenizer = AutoTokenizer.from_pretrained("preechanon/mt5-base-thaisum-text-summarization")
29
  model = AutoModelForSeq2SeqLM.from_pretrained("preechanon/mt5-base-thaisum-text-summarization")
30
+ new_input_string = "ข้อความที่ต้องการสรุป"
31
+ input_ =tokenizer(new_input_string, truncation=True, max_length=1024, return_tensors="pt")
32
+ with torch.no_grad():
33
+ preds = model.generate(
34
+ input_['input_ids'].to('cpu'),
35
+ num_beams=15,
36
+ num_return_sequences=1,
37
+ no_repeat_ngram_size=1,
38
+ remove_invalid_values=True,
39
+ max_length=140,
40
+ )
41
  ```
42
 
43
  ### Score
44
+ - Rouge1: 0.488931
45
+ - Rouge2: 0.309732
46
+ - Rougel: 0.425490
47
+ - Rougelsum: 0.444359
48
 
49
  ### Training hyperparameters
50