File size: 2,469 Bytes
caf8b26
 
 
 
 
 
 
 
 
e9d8acf
 
 
 
 
 
caf8b26
e9d8acf
 
caf8b26
 
e9d8acf
 
 
caf8b26
 
 
eafa309
 
 
 
 
caf8b26
 
 
9fc8ee0
caf8b26
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
---
license: apache-2.0
tags:
- generated_from_trainer
metrics:
- rouge
model-index:
- name: fix_punct_cased_t5_small
  results: []
datasets:
- https://huggingface.co/datasets/nbroad/fix_punctuation
widget:
- text: This is, a sentence. with odd punctuation to show off what, the model. can do
- text: What, should the proper. punctuation. in. this sentence be?
- text: Where are. we? What, is, the meaning, of this?
---
# fix_punct_cased_t5_small
This model is a fine-tuned version of [google/t5-v1_1-small](https://huggingface.co/google/t5-v1_1-small) on the [NPR utterances dataset](https://www.kaggle.com/datasets/shuyangli94/interview-npr-media-dialog-transcripts?select=utterances.csv).


## Dataset
The model was trained on 80k rows from the above dataset consisting of NPR radio transcripts. Commans, periods, and semicolons were removed from the text and then random commas, periods, and semicolons were added. The model was trained to place those three punctuation marks in the correct location. The casing of the texts was not modified during training.


It achieves the following results on the evaluation set:
- Loss: 0.2744
- Rouge1: 93.3712
- Rouge2: 91.0027
- Rougel: 93.3618
- Rougelsum: 93.3479
- Gen Len: 46.0728

## Model description

The purpose of this model is to correct the punctuation in a sentence. For example, the phrase "This is, a sentence. with odd punctuation to show off what, the model. can do" gets changed to "This is a sentence with odd punctuation to show off what the model can do."

## Training procedure

### Training hyperparameters

The following hyperparameters were used during training:
- learning_rate: 8e-05
- train_batch_size: 128
- eval_batch_size: 256
- seed: 42
- optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08
- lr_scheduler_type: linear
- num_epochs: 3.0

### Training results

| Training Loss | Epoch | Step | Validation Loss | Rouge1  | Rouge2  | Rougel  | Rougelsum | Gen Len |
|:-------------:|:-----:|:----:|:---------------:|:-------:|:-------:|:-------:|:---------:|:-------:|
| 1.2254        | 1.0   | 600  | 0.3501          | 63.2952 | 59.8766 | 63.137  | 63.2022   | 16.2637 |
| 0.7345        | 2.0   | 1200 | 0.2815          | 64.896  | 61.6256 | 64.8677 | 64.8728   | 16.3625 |
| 0.6536        | 3.0   | 1800 | 0.2744          | 64.8724 | 61.6282 | 64.8483 | 64.8502   | 16.3906 |


### Framework versions

- Transformers 4.22.2
- Pytorch 1.11.0a0+17540c5
- Datasets 2.5.1
- Tokenizers 0.12.1