bhargavis commited on
Commit
92f42ab
·
verified ·
1 Parent(s): d3f9b74

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +98 -3
README.md CHANGED
@@ -1,3 +1,98 @@
1
- ---
2
- license: mit
3
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: mit
3
+ datasets:
4
+ - EdinburghNLP/xsum
5
+ language:
6
+ - en
7
+ metrics:
8
+ - bleu
9
+ - rouge
10
+ base_model:
11
+ - facebook/bart-large
12
+ new_version: facebook/bart-large
13
+ pipeline_tag: summarization
14
+ library_name: transformers
15
+ tags:
16
+ - fine-tuning
17
+ - bart-large
18
+ - xsum
19
+ ---
20
+ ## Model Description
21
+ #### Model - fulltrain-xsum-bart
22
+ - Architecture - BART (Bidirectional and Auto-Regressive Transformers)
23
+ - Task - Abstractive Summarization
24
+ - Dataset - XSum (Extreme Summarization)
25
+ - Training Hardware - 2x NVIDIA T4 GPUs (using Kaggle)
26
+ - Training Time: ~9 hours
27
+
28
+ This model is fine-tuned on the XSum dataset for abstractive summarization tasks. It takes a long document as input and generates a concise summary
29
+
30
+ #### Dataset Details
31
+ - Train Dataset - 204,045 samples
32
+ - Validation Dataset - 11,332 samples
33
+ - Test Dataset - 11,334 samples
34
+
35
+ The XSum dataset consists of BBC articles and their corresponding single-sentence summaries. The model was trained to generate summaries that are concise and capture the essence of the input document.
36
+
37
+ Training Details
38
+ | Training Parameter | Value |
39
+ | ------------- |:-------------:|
40
+ | Training Epochs | 1 |
41
+ | Batch Size | 8 (per device) |
42
+ | Learning Rate | 5e-5 |
43
+ | Weight Decay | 0.01 |
44
+ | Warmup Steps | 500 |
45
+ | FP16 Training | Enabled |
46
+ | Evaluation Strategy | Per Epoch |
47
+ | Best Model Selection | Based on validation loss (eval_loss) |
48
+
49
+
50
+ #### Evaluation Metrics
51
+ The model was evaluated using the following metrics.
52
+ | Metric | Score |
53
+ | ------------- |:-------------:|
54
+ | Training Loss | 0.3771 |
55
+ | Validation Loss | 0.350379 |
56
+ | Rouge-1 | 0.401344019 |
57
+ | Rouge-2 | 0.188076798 |
58
+ | Rouge-L | 0.33460693 |
59
+
60
+ These metrics were computed using the `rouge_scorer` library for ROUGE scores and the `corpus_bleu` function for BLEU score.
61
+
62
+ #### Training Arguments
63
+ The model was trained using the following Hugging Face Seq2SeqTrainingArguments:
64
+
65
+ | Save Strategy | Per Epoch
66
+ | ------------- |:-------------:|
67
+ | Logging Steps | 1000 |
68
+ | Dataloader Workers | 4 |
69
+ | Predict with Generate | True |
70
+ | Load Best Model at End | True |
71
+ | Metric for Best Model | eval_loss |
72
+ | Greater is Better | False (Lower validation loss is better) |
73
+ | Report To | Weights & Biases (WandB) |
74
+
75
+ ##### Other considerations
76
+ - The model was fine tuned on the XSum dataset, which consists of BBC articles. Its performance may vary on other domains or types of text. The model may inherit biases present in the XSum dataset, which consists of BBC articles.
77
+ - The model generates summaries based on patterns learned during training. It may occasionally produce inaccurate or misleading summaries, especially for complex or ambiguous input text.
78
+ - The model may struggle with highly technical or domain-specific content, as it was not explicitly trained on such data.
79
+ - The model generates summaries in English only.
80
+
81
+ ### Usage
82
+ Below is an example of how to load and use the model:
83
+
84
+ ```
85
+ from transformers import pipeline
86
+
87
+ # Load the few-shot model
88
+ summarizer = pipeline("summarization", model="bhargavis/fulltrain-xsum-bart")
89
+
90
+ # Provide input text
91
+ input_text = """
92
+ Authorities have issued a warning after multiple sightings of a large brown bear in the woods. The bear is known to become aggressive if disturbed, and residents are urged to exercise caution. Last week, a group of hikers reported a close encounter with the animal. While no injuries were sustained, the bear displayed defensive behavior when approached. Wildlife officials advise keeping a safe distance and avoiding the area if possible. Those encountering the bear should remain calm, back away slowly, and refrain from making sudden movements. Officials continue to monitor the situation.
93
+ """
94
+
95
+ # Generate summary
96
+ summary = summarizer(input_text, max_length=64, min_length=30, do_sample=False)
97
+ print(summary[0]["summary_text"])
98
+ ```