Create README.md
Browse files
README.md
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
datasets:
|
| 3 |
+
- Mir-2002/python-google-style-docstrings
|
| 4 |
+
language:
|
| 5 |
+
- en
|
| 6 |
+
metrics:
|
| 7 |
+
- bleu
|
| 8 |
+
- rouge
|
| 9 |
+
base_model:
|
| 10 |
+
- Salesforce/codet5p-220m-bimodal
|
| 11 |
+
pipeline_tag: summarization
|
| 12 |
+
tags:
|
| 13 |
+
- code
|
| 14 |
+
---
|
| 15 |
+
|
| 16 |
+
# Overview
|
| 17 |
+
|
| 18 |
+
This is a fine tuned CodeT5+ (220m) bimodal model tuned on a dataset consisting of 59,000 Python code-docstring pairs. The docstrings are in Google style format.
|
| 19 |
+
A google style docstring is formatted as follows:
|
| 20 |
+
```
|
| 21 |
+
<Description of the code>
|
| 22 |
+
|
| 23 |
+
Args:
|
| 24 |
+
<var1> (<data-type>) : <description of var1>
|
| 25 |
+
<var2> (<data_type>) : <description of var2>
|
| 26 |
+
|
| 27 |
+
Returns:
|
| 28 |
+
<var3> (<data-type>) : <description of var3>
|
| 29 |
+
|
| 30 |
+
Raises:
|
| 31 |
+
<var4> (<data-type>) : <description of var4>
|
| 32 |
+
```
|
| 33 |
+
|
| 34 |
+
For more information on my dataset, please see the included referenced dataset.
|
| 35 |
+
|
| 36 |
+
# Hyperparameters
|
| 37 |
+
|
| 38 |
+
MAX_SOURCE_LENGTH = 256
|
| 39 |
+
MAX_TARGET_LENGTH = 128
|
| 40 |
+
BATCH_SIZE = 16
|
| 41 |
+
NUM_EPOCHS = 35
|
| 42 |
+
LEARNING_RATE = 3e-5
|
| 43 |
+
GRADIENT_ACCUMULATION_STEPS = 4
|
| 44 |
+
EARLY_STOPPING_PATIENCE = 2
|
| 45 |
+
WEIGHT_DECAY = 0.01
|
| 46 |
+
OPTIMIZER = ADAFACTOR
|
| 47 |
+
LR_SCHEDULER = LINEAR
|
| 48 |
+
|
| 49 |
+
# Loss
|
| 50 |
+
|
| 51 |
+
On the 35th epoch, the model achieved the following loss:
|
| 52 |
+
|
| 53 |
+
Epoch Training Loss Validation Loss
|
| 54 |
+
26 1.001400 1.288712
|
| 55 |
+
27 0.983600 1.284895
|
| 56 |
+
28 0.961300 1.277680
|
| 57 |
+
29 0.940600 1.275018
|
| 58 |
+
30 0.933600 1.275621
|
| 59 |
+
31 0.918200 1.270074
|
| 60 |
+
32 0.904700 1.268874
|
| 61 |
+
33 0.908800 1.268534
|
| 62 |
+
34 0.900600 1.268240
|
| 63 |
+
*35* *0.894800* *1.268536*
|
| 64 |
+
|
| 65 |
+
# BLEU and ROUGE Scores
|
| 66 |
+
|
| 67 |
+
==================================================
|
| 68 |
+
EVALUATION RESULTS
|
| 69 |
+
==================================================
|
| 70 |
+
BLEU Score: 0.3540
|
| 71 |
+
ROUGE-1: 0.5855
|
| 72 |
+
ROUGE-2: 0.3946
|
| 73 |
+
ROUGE-L: 0.5243
|