File size: 2,394 Bytes
c7c07b3
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
---
language:
- en
license: apache-2.0
datasets:
- glue
metrics:
- pearsonr
model-index:
- name: t5-base-finetuned-stsb
  results:
  - task:
      name: Text Classification
      type: text-classification
    dataset:
      name: GLUE STS-B
      type: glue
      args: stsb
    metrics:
    - name: Pearson Correlation
      type: pearson_correlation
      value: 0.8937
---


# T5-base-finetuned-stsb

<!-- Provide a quick summary of what the model is/does. -->

This model is T5 fine-tuned on GLUE STS-B dataset. It acheives the following results on the validation set
- Pearson Correlation Coefficient: 0.8937


## Model Details
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. 

## Training procedure

### Tokenization
Since, T5 is a text-to-text model, the labels of the dataset are converted as follows:
For each example, a sentence as been formed as **"stsb sentence1: " + stsb_sent1 + "sentence2: " + stsb_sent2** and fed to the tokenizer to get the **input_ids** and **attention_mask**.
Unlike other **GLUE** tasks, STS-B is a regression task where the goal is to predict a similarity score between 1 and 5. I have used the same stratey as descibed in the T5 paper for fine-tuning. In the paper, it is mentioned as 
``` We found that most of these scores were annotated in increments of 0.2, so we simply rounded any score to the nearest increment of 0.2 and converted the result to a literal string representation of the number (e.g. the floating-point value 2.57 would be mapped to the string “2.6”). At test time, if the model outputs a string corresponding to a number between 1 and 5, we convert it to a floating-point value; otherwise, we treat the model’s prediction as incorrect. This effectively recasts the STS-B
regression problem as a 21-class classification problem. ```


### Training hyperparameters

The following hyperparameters were used during training:
- learning_rate: 3e-4
- train_batch_size: 32
- eval_batch_size: 32
- seed: 42
- optimizer: epsilon=1e-08
- num_epochs: 3.0

### Training results


|Epoch | Training Loss | Validation Pearson Correlation Coefficient |
|:----:|:-------------:|:-------------------:|
|   1  |    0.8623     | 0.8200           |
|   2  |    0.7782     | 0.8675        |
|   3  |     0.7040   | **0.8937** |