yousefg commited on
Commit
1cee2bb
·
verified ·
1 Parent(s): e1e757c

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +13 -157
README.md CHANGED
@@ -18,6 +18,7 @@ pipeline_tag: summarization
18
  <!-- Provide a quick summary of what the model is/does. -->
19
  Academ is a fine-tuned BART model for summarizing academic lectures.
20
 
 
21
 
22
  ## Model Details
23
 
@@ -28,61 +29,20 @@ Academ is a fine-tuned BART model for summarizing academic lectures.
28
  This is the model card of a 🤗 transformers model that has been pushed on the Hub. This model card has been automatically generated.
29
 
30
  - **Developed by:** Yousef Gamaleldin
31
- - **Funded by [optional]:** [More Information Needed]
32
- - **Shared by [optional]:** [More Information Needed]
33
  - **Model type:** Summarization
34
  - **Language(s) (NLP):** English
35
- - **License:** [More Information Needed]
36
- - **Finetuned from model [optional]:** BART Large
37
-
38
- ### Model Sources [optional]
39
-
40
- <!-- Provide the basic links for the model. -->
41
-
42
- - **Repository:** [More Information Needed]
43
- - **Paper [optional]:** [More Information Needed]
44
- - **Demo [optional]:** [More Information Needed]
45
-
46
- ## Uses
47
-
48
- <!-- Address questions around how the model is intended to be used, including the foreseeable users of the model and those affected by the model. -->
49
-
50
- ### Direct Use
51
-
52
- <!-- This section is for the model use without fine-tuning or plugging into a larger ecosystem/app. -->
53
-
54
-
55
-
56
- [More Information Needed]
57
-
58
- ### Downstream Use [optional]
59
-
60
- <!-- This section is for the model use when fine-tuned for a task, or when plugged into a larger ecosystem/app -->
61
-
62
- [More Information Needed]
63
-
64
- ### Out-of-Scope Use
65
-
66
- <!-- This section addresses misuse, malicious use, and uses that the model will not work well for. -->
67
-
68
- [More Information Needed]
69
-
70
- ## Bias, Risks, and Limitations
71
-
72
- <!-- This section is meant to convey both technical and sociotechnical limitations. -->
73
-
74
- [More Information Needed]
75
-
76
- ### Recommendations
77
-
78
- <!-- This section is meant to convey recommendations with respect to the bias, risk, and technical limitations. -->
79
-
80
- Users (both direct and downstream) should be made aware of the risks, biases, and limitations of the model. More information needed for further recommendations.
81
 
82
  ## How to Get Started with the Model
83
 
84
  Use the code below to get started with the model.
85
 
 
 
 
 
 
86
  def get_summary(input_ids, attention_mask, context_length):
87
 
88
  summaries = []
@@ -106,135 +66,31 @@ attention_mask = torch.tensor(batch['attention_mask']).unsqueeze(0).to(device)
106
  summary = get_summary(input_ids, attention_mask, 1654)
107
  print(summary)
108
 
109
- [More Information Needed]
110
-
111
  ## Training Details
112
 
113
- ### Training Data
114
-
115
- <!-- This should link to a Dataset Card, perhaps with a short stub of information on what the training data is all about as well as documentation related to data pre-processing or additional filtering. -->
116
-
117
- [More Information Needed]
118
-
119
- ### Training Procedure
120
-
121
- <!-- This relates heavily to the Technical Specifications. Content here should link to that section when it is relevant to the training procedure. -->
122
-
123
- #### Preprocessing [optional]
124
-
125
- [More Information Needed]
126
-
127
 
128
  #### Training Hyperparameters
129
 
130
- - **Training regime:** [More Information Needed] bf16 non-mixed precision<!--fp32, fp16 mixed precision, bf16 mixed precision, bf16 non-mixed precision, fp16 non-mixed precision, fp8 mixed precision -->
131
  - **Learning Rate:** 0.001
132
  - **Weight Decay:** 0.01
133
  - **Epochs:** 4
134
  - **Batch Size:** 16
135
- #### Speeds, Sizes, Times [optional]
136
-
137
- <!-- This section provides information about throughput, start/end time, checkpoint size if relevant, etc. -->
138
-
139
- [More Information Needed]
140
-
141
  ## Evaluation
142
 
143
  <!-- This section describes the evaluation protocols and provides the results. -->
144
  The evaluation is based on ROUGE 1 with a change of discounting padding tokens.
145
 
146
- ### Testing Data, Factors & Metrics
147
-
148
  #### Testing Data
149
 
150
  The model's test dataset had 289 lectures, mainly from MIT OpenCourseWare.
151
  <!-- This should link to a Dataset Card if possible. -->
152
 
153
- [More Information Needed]
154
-
155
- #### Factors
156
-
157
- <!-- These are the things the evaluation is disaggregating by, e.g., subpopulations or domains. -->
158
-
159
- [More Information Needed]
160
-
161
- #### Metrics
162
-
163
- <!-- These are the evaluation metrics being used, ideally with a description of why. -->
164
-
165
- [More Information Needed]
166
-
167
  ### Results
168
 
169
- [More Information Needed]
170
 
171
  #### Summary
172
- Academ is a summarization model trained on 2307 lectures, mainly from MIT OpenCourseWare. The model has a max sequence length of 1654, an increase of 630 tokens from the original model.
173
-
174
-
175
-
176
- ## Model Examination [optional]
177
-
178
- <!-- Relevant interpretability work for the model goes here -->
179
-
180
- [More Information Needed]
181
-
182
- ## Environmental Impact
183
-
184
- <!-- Total emissions (in grams of CO2eq) and additional considerations, such as electricity usage, go here. Edit the suggested text below accordingly -->
185
-
186
- Carbon emissions can be estimated using the [Machine Learning Impact calculator](https://mlco2.github.io/impact#compute) presented in [Lacoste et al. (2019)](https://arxiv.org/abs/1910.09700).
187
-
188
- - **Hardware Type:** [More Information Needed]
189
- - **Hours used:** [More Information Needed]
190
- - **Cloud Provider:** [More Information Needed]
191
- - **Compute Region:** [More Information Needed]
192
- - **Carbon Emitted:** [More Information Needed]
193
-
194
- ## Technical Specifications [optional]
195
-
196
- ### Model Architecture and Objective
197
-
198
- [More Information Needed]
199
-
200
- ### Compute Infrastructure
201
-
202
- [More Information Needed]
203
-
204
- #### Hardware
205
-
206
- [More Information Needed]
207
-
208
- #### Software
209
-
210
- [More Information Needed]
211
-
212
- ## Citation [optional]
213
-
214
- <!-- If there is a paper or blog post introducing the model, the APA and Bibtex information for that should go in this section. -->
215
-
216
- **BibTeX:**
217
-
218
- [More Information Needed]
219
-
220
- **APA:**
221
-
222
- [More Information Needed]
223
-
224
- ## Glossary [optional]
225
-
226
- <!-- If relevant, include terms and calculations in this section that can help readers understand the model or model card. -->
227
-
228
- [More Information Needed]
229
-
230
- ## More Information [optional]
231
-
232
- [More Information Needed]
233
-
234
- ## Model Card Authors [optional]
235
-
236
- [More Information Needed]
237
-
238
- ## Model Card Contact
239
-
240
- [More Information Needed]
 
18
  <!-- Provide a quick summary of what the model is/does. -->
19
  Academ is a fine-tuned BART model for summarizing academic lectures.
20
 
21
+ To find out how the model was fine-tuned, you can check the notebook on Kaggle: https://www.kaggle.com/code/yousefr/college-lectures-summarization-bart-unsupervised/
22
 
23
  ## Model Details
24
 
 
29
  This is the model card of a 🤗 transformers model that has been pushed on the Hub. This model card has been automatically generated.
30
 
31
  - **Developed by:** Yousef Gamaleldin
 
 
32
  - **Model type:** Summarization
33
  - **Language(s) (NLP):** English
34
+ - **License:** MIT
35
+ - **Finetuned from model [optional]:** BART Large CNN
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
36
 
37
  ## How to Get Started with the Model
38
 
39
  Use the code below to get started with the model.
40
 
41
+ from transformers import BartForConditionalGeneration, AutoTokenizer
42
+
43
+ model = BartForConditionalGeneration.from_pretrained('yousefg/Academ-0.5')
44
+ tokenizer = AutoTokenizer.from_pretrained('facebook/bart-large-cnn')
45
+
46
  def get_summary(input_ids, attention_mask, context_length):
47
 
48
  summaries = []
 
66
  summary = get_summary(input_ids, attention_mask, 1654)
67
  print(summary)
68
 
 
 
69
  ## Training Details
70
 
71
+ The model's training used a custom loss function for getting the model into an optimal length (35% chosen as the optimal length).
 
 
 
 
 
 
 
 
 
 
 
 
 
72
 
73
  #### Training Hyperparameters
74
 
75
+ - **Training regime:** bf16 non-mixed precision<!--fp32, fp16 mixed precision, bf16 mixed precision, bf16 non-mixed precision, fp16 non-mixed precision, fp8 mixed precision -->
76
  - **Learning Rate:** 0.001
77
  - **Weight Decay:** 0.01
78
  - **Epochs:** 4
79
  - **Batch Size:** 16
80
+ -
 
 
 
 
 
81
  ## Evaluation
82
 
83
  <!-- This section describes the evaluation protocols and provides the results. -->
84
  The evaluation is based on ROUGE 1 with a change of discounting padding tokens.
85
 
 
 
86
  #### Testing Data
87
 
88
  The model's test dataset had 289 lectures, mainly from MIT OpenCourseWare.
89
  <!-- This should link to a Dataset Card if possible. -->
90
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
91
  ### Results
92
 
93
+ The model achieved 96% accuracy for ROUGUE 1 in the test dataset, and 93% in the evaluation dataset.
94
 
95
  #### Summary
96
+ Academ is a summarization model trained on 2307 lectures, mainly from MIT OpenCourseWare. The model has a max sequence length of 1654, increasing 630 tokens from the original model.