razent commited on
Commit
7ab4a76
1 Parent(s): 4b691ed

Create README.md

Browse files
Files changed (1) hide show
  1. README.md +40 -0
README.md ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language: vi
3
+ datasets:
4
+ - cc100
5
+ tags:
6
+ - summarization
7
+
8
+ license: mit
9
+ ---
10
+
11
+ # ViT5-large Finetuned on `vietnews` Abstractive Summarization
12
+
13
+ State-of-the-art pre-trained Transformer-based encoder-decoder model for Vietnamese.
14
+
15
+ ## How to use
16
+ For more details, do check out [our Github repo](https://github.com/justinphan3110/ViT5).
17
+ ```python
18
+ from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
19
+
20
+ tokenizer = AutoTokenizer.from_pretrained("VietAI/vit5-large-vietnews-summarization")
21
+ model = AutoModelForSeq2SeqLM.from_pretrained("VietAI/vit5-large-vietnews-summarization")
22
+
23
+ sentence = "Xin chào"
24
+ text = "summarize: " + sentence + " </s>"
25
+ encoding = tokenizer.encode_plus(text, pad_to_max_length=True, return_tensors="pt")
26
+ input_ids, attention_masks = encoding["input_ids"].to("cuda"), encoding["attention_mask"].to("cuda")
27
+ outputs = model.generate(
28
+ input_ids=input_ids, attention_mask=attention_masks,
29
+ max_length=256,
30
+ early_stopping=True
31
+ )
32
+ for output in outputs:
33
+ line = tokenizer.decode(output, skip_special_tokens=True, clean_up_tokenization_spaces=True)
34
+ print(line)
35
+ ```
36
+
37
+ ## Citation
38
+ ```
39
+ Coming Soon...
40
+ ```