PavanNeerudu commited on
Commit
f0ad688
·
1 Parent(s): 7453612

Create README.md

Browse files
Files changed (1) hide show
  1. README.md +59 -0
README.md ADDED
@@ -0,0 +1,59 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language:
3
+ - en
4
+ license: apache-2.0
5
+ datasets:
6
+ - xsum
7
+ metrics:
8
+ - rouge
9
+ model-index:
10
+ - name: t5-base-finetuned-xsum
11
+ results:
12
+ - task:
13
+ name: Text Summarization
14
+ type: text-summarization
15
+ dataset:
16
+ name: Xsum
17
+ type: xsum
18
+ args: xsum
19
+ metrics:
20
+ - name: rouge
21
+ type: rouge
22
+ value: 0.3414
23
+ ---
24
+
25
+
26
+ # gpt2-finetuned-xsum
27
+
28
+ <!-- Provide a quick summary of what the model is/does. -->
29
+
30
+ This model is t5-base fine-tuned on Xsum dataset for text summarization.
31
+
32
+
33
+ ## Model Details
34
+ T5 is an encoder-decoder model pre-trained on a multi-task mixture of unsupervised and supervised tasks and for which each task is converted into a text-to-text format.
35
+
36
+ ## Training Procedure
37
+ To train the T5 model for text-summarization, I have used "summarize" prefix before every sentence and gave the encoding of this sentence as input ids and attention mask.
38
+ For the labels, I used the encoding of the summaries as the decoder input ids and decoder attention mask.
39
+
40
+
41
+
42
+ ## Usage:
43
+ For generating summaries on a example use:
44
+ ```python
45
+ predictions = []
46
+ tokenised_dataset = tokenizer(documents, truncation=True, padding='max_length', max_length=1024, return_tensors='pt')
47
+ source_ids = tokenised_dataset['input_ids']
48
+ source_mask = tokenised_dataset['attention_mask']
49
+ output = model.generate(input_ids=source_ids, attention_mask=source_mask, max_length=256)
50
+ print(tokenizer.decode(output[0], skip_special_tokens=True))
51
+ ```
52
+
53
+ ## Experiments
54
+ We report the ROUGE-1, ROUGE-2 and ROUGE-L on the test datasets.
55
+
56
+ ### Xsum
57
+ | ROUGE-1 | ROUGE-2| ROUGE-L|
58
+ |---------|--------|--------|
59
+ | 0.3414 | 0.1260 | 0.2832 |