transformers pytorch gpt2 text-classification en dataset:glue license:apache-2.0 model-index autotrain_compatible text-generation-inference endpoints_compatible region:us
---
datasets:
- glue
language:
- en
license: apache-2.0
metrics:
- accuracy
model-index:
- name: gpt2-finetuned-qnli
  results:
  - task:
      type: text-classification
      name: Text Classification
    dataset:
      name: GLUE QNLI
      type: glue
      args: qnli
    metrics:
    - type: accuracy
      value: 0.87791
      name: Accuracy
---


# gpt2-finetuned-qnli

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

This model is GPT-2 fine-tuned on GLUE STS-B dataset. It acheives the following results on the validation set
- Accuracy: 0.87791


## Model Details
GPT-2 is a transformers model pretrained on a very large corpus of English data in a self-supervised fashion. 
This means it was pretrained on the raw texts only, with no humans labelling them in any way (which is why it can use lots of publicly available data) with an automatic process to generate inputs and labels from those texts. More precisely, it was trained to guess the next word in sentences. 
However, it acheives very good results on Text Classification tasks.
## Training procedure


### Training hyperparameters

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

### Training results



|Epoch | Training Loss | Training Accuracy | Validation Loss | Validation Accuracy |
|:----:|:-------------:|:-----------------:|:---------------:|:-------------------:|
|   1  |     0.47803   | 0.77344          |     0.34630    |       0.85502    |
|   2  |     0.36961   | 0.85486           |    0.32994     |       0.85502       | 
|   3  |     0.32343   | 0.88785           |   0.38374     |       **0.87791**       | 