zaemyung commited on
Commit
0eba429
1 Parent(s): 0778a1b

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +30 -0
README.md CHANGED
@@ -1,3 +1,33 @@
1
  ---
2
  license: apache-2.0
 
 
 
 
 
3
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
  license: apache-2.0
3
+ datasets:
4
+ - zaemyung/IteraTeR_plus
5
+ language:
6
+ - en
7
+ pipeline_tag: text2text-generation
8
  ---
9
+ # DElIteraTeR-PEGASUS-Multi-Sent-Revision-Generator
10
+ This model was obtained by fine-tuning [google/pegasus-large](https://huggingface.co/google/pegasus-large) on [IteraTeR+](https://huggingface.co/datasets/zaemyung/IteraTeR_plus) `multi_sent` dataset.
11
+
12
+ Paper: [Improving Iterative Text Revision by Learning Where to Edit from Other Revision Tasks](https://aclanthology.org/2022.emnlp-main.678/) <br>
13
+ Authors: Zae Myung Kim, Wanyu Du, Vipul Raheja, Dhruv Kumar, and Dongyeop Kang
14
+
15
+ ## Usage
16
+ ```python
17
+ from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
18
+
19
+ tokenizer = AutoTokenizer.from_pretrained("zaemyung/DElIteraTeR-PEGASUS-Multi-Sent-Revision-Generator")
20
+ model = AutoModelForSeq2SeqLM.from_pretrained("zaemyung/DElIteraTeR-PEGASUS-Multi-Sent-Revision-Generator")
21
+
22
+ before_inputs = [
23
+ "<bos>These were known as temple rings <coherence>. They</coherence> were worn on the head, near the temples of a woman or a girl.<eos>",
24
+ "Andrew Hendy, Hereditary Chief of the Miskitu Nation.<bos> <clarity>Proclaimed</clarity> by the Nicaraguans on the death of his cousin George V, who died on 8th November 1888.<eos> He was repudiated by many people of the Miskitu Nation and abdicated in favour of his cousin Jonathan I, on 8th March 1889. He retired to Nicaraguan territory where he became a Miskitu Jefe Inspector and River Magistrate."
25
+ ]
26
+ model_inputs = tokenizer(before_inputs, return_tensors='pt', padding=True)
27
+ model_outputs = model.generate(**model_inputs, num_beams=8, max_length=1024)
28
+ after_texts = tokenizer.batch_decode(model_outputs, skip_special_tokens=True)
29
+
30
+ print(after_texts)
31
+ # 'These were known as temple rings because they were worn on the head, near the temples of a woman or a girl.',
32
+ # 'Andrew Hendy, Hereditary Chief of the Miskitu Nation. He was proclaimed by the Nicaraguans on the death of his cousin George V, who died on 8th November 1888. He was repudiated by many people of the Miskitu Nation and abdicated in favour of his cousin Jonathan I, on 8th March 1889. He retired to Nicaraguan territory where he became a Miskitu Jefe Inspector and River Magistrate.']
33
+ ```