

# T5-base-finetuned-mnli

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

This model is T5 fine-tuned on GLUE MNLI dataset. It acheives the following results on the **validation-matched** set
- Accuracy: 0.8567


## 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 **"mnli premise: " + mnli_premise + "hypothesis: " + mnli_hypothesis** and fed to the tokenizer to get the **input_ids** and **attention_mask**.
For each label, target is choosen as **"entailment"** if label is 0, else it is **"neutral"** if label is 1, else it is **"contradiction"**  and tokenized to get **input_ids** and **attention_mask** . 
  During training, these inputs_ids having **pad** token are replaced with -100 so that loss is not calculated for them. Then these input ids are given as labels, and above attention_mask of labels
  is given as decoder attention mask.

### Training hyperparameters

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

### Training results


|Epoch | Training Loss | Validation Matched Accuracy |
|:----:|:-------------:|:-------------------:|
|   1  |    0.1661     | 0.8404             |
|   2  |    0.1016     | 0.8567             |

{"language": ["en"], "license": "apache-2.0", "datasets": ["glue"], "metrics": ["accuracy"], "model-index": [{"name": "t5-base-finetuned-mnli", "results": [{"task": {"type": "text-classification", "name": "Text Classification"}, "dataset": {"name": "GLUE MNI", "type": "glue", "args": "mnli"}, "metrics": [{"type": "accuracy", "value": 0.8567, "name": "Accuracy"}]}]}]}
transformers pytorch t5 text2text-generation en dataset:glue license:apache-2.0 model-index autotrain_compatible endpoints_compatible text-generation-inference region:us
TAGS
#transformers #pytorch #t5 #text2text-generation #en #dataset-glue #license-apache-2.0 #model-index #autotrain_compatible #endpoints_compatible #text-generation-inference #region-us 

T5-base-finetuned-mnli
======================


This model is T5 fine-tuned on GLUE MNLI dataset. It acheives the following results on the validation-matched set


* Accuracy: 0.8567


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 "mnli premise: " + mnli\_premise + "hypothesis: " + mnli\_hypothesis and fed to the tokenizer to get the input\_ids and attention\_mask.
For each label, target is choosen as "entailment" if label is 0, else it is "neutral" if label is 1, else it is "contradiction" and tokenized to get input\_ids and attention\_mask .
During training, these inputs\_ids having pad token are replaced with -100 so that loss is not calculated for them. Then these input ids are given as labels, and above attention\_mask of labels
is given as decoder attention mask.


### Training hyperparameters


The following hyperparameters were used during training:


* learning\_rate: 3e-4
* train\_batch\_size: 8
* eval\_batch\_size: 8
* seed: 42
* optimizer: epsilon=1e-08
* num\_epochs: 2


### Training results




### 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 "mnli premise: " + mnli\_premise + "hypothesis: " + mnli\_hypothesis and fed to the tokenizer to get the input\_ids and attention\_mask.
For each label, target is choosen as "entailment" if label is 0, else it is "neutral" if label is 1, else it is "contradiction" and tokenized to get input\_ids and attention\_mask .
During training, these inputs\_ids having pad token are replaced with -100 so that loss is not calculated for them. Then these input ids are given as labels, and above attention\_mask of labels
is given as decoder attention mask. ### Training hyperparameters


The following hyperparameters were used during training:


* learning\_rate: 3e-4
* train\_batch\_size: 8
* eval\_batch\_size: 8
* seed: 42
* optimizer: epsilon=1e-08
* num\_epochs: 2 ### Training results
TAGS
#transformers #pytorch #t5 #text2text-generation #en #dataset-glue #license-apache-2.0 #model-index #autotrain_compatible #endpoints_compatible #text-generation-inference #region-us 
 ### 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 "mnli premise: " + mnli\_premise + "hypothesis: " + mnli\_hypothesis and fed to the tokenizer to get the input\_ids and attention\_mask.
For each label, target is choosen as "entailment" if label is 0, else it is "neutral" if label is 1, else it is "contradiction" and tokenized to get input\_ids and attention\_mask .
During training, these inputs\_ids having pad token are replaced with -100 so that loss is not calculated for them. Then these input ids are given as labels, and above attention\_mask of labels
is given as decoder attention mask. ### Training hyperparameters


The following hyperparameters were used during training:


* learning\_rate: 3e-4
* train\_batch\_size: 8
* eval\_batch\_size: 8
* seed: 42
* optimizer: epsilon=1e-08
* num\_epochs: 2 ### Training results
TAGS
#transformers #pytorch #t5 #text2text-generation #en #dataset-glue #license-apache-2.0 #model-index #autotrain_compatible #endpoints_compatible #text-generation-inference #region-us 
### 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 "mnli premise: " + mnli\_premise + "hypothesis: " + mnli\_hypothesis and fed to the tokenizer to get the input\_ids and attention\_mask.
For each label, target is choosen as "entailment" if label is 0, else it is "neutral" if label is 1, else it is "contradiction" and tokenized to get input\_ids and attention\_mask .
During training, these inputs\_ids having pad token are replaced with -100 so that loss is not calculated for them. Then these input ids are given as labels, and above attention\_mask of labels
is given as decoder attention mask.### Training hyperparameters


The following hyperparameters were used during training:


* learning\_rate: 3e-4
* train\_batch\_size: 8
* eval\_batch\_size: 8
* seed: 42
* optimizer: epsilon=1e-08
* num\_epochs: 2### Training results