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This model is a fine-tuned version of [xlnet-base-cased](https://huggingface.co/xlnet-base-cased) on the imdb dataset.
|
| 7 |
+
It achieves the following results on the evaluation set:
|
| 8 |
+
- Loss: 0.16
|
| 9 |
+
- Accuracy: 0.93
|
| 10 |
+
- F1: 0.93
|
| 11 |
+
|
| 12 |
+
## Model Description
|
| 13 |
+
|
| 14 |
+
This project uses a fine-tuned XLNet model for sentiment analysis on English movie reviews. The model was fine-tuned using PyTorch and Huggingface Transformers libraries to improve its performance on sentiment classification tasks.
|
| 15 |
+
|
| 16 |
+
XLNet (eXtreme Language Model) is an autoregressive pre-training method that combines the best of BERT and Transformer-XL architectures, providing significant improvements in performance over traditional language models. This fine-tuned XLNet model aims to provide high accuracy and reliability in sentiment analysis.
|
| 17 |
+
|
| 18 |
+
The training process involved the use of the AdamW optimizer with a learning rate of 2e-5, betas of [0.9, 0.999], and epsilon of 1e-6. The model was trained for 2 epochs with a linear learning rate scheduler and no warmup steps.
|
| 19 |
+
|
| 20 |
+
|
| 21 |
+
## Training and Evaluation Data
|
| 22 |
+
|
| 23 |
+
[IMDB Dataset of 50K Movie Reviews](https://www.kaggle.com/datasets/lakshmi25npathi/imdb-dataset-of-50k-movie-reviews)
|
| 24 |
+
|
| 25 |
+
|
| 26 |
+
### Training Hyperparameters
|
| 27 |
+
|
| 28 |
+
The following hyperparameters were used during training:
|
| 29 |
+
- learning_rate: 2e-5
|
| 30 |
+
- train_batch_size: 32
|
| 31 |
+
- eval_batch_size: 32
|
| 32 |
+
- seed: 42
|
| 33 |
+
- total_train_batch_size: 38
|
| 34 |
+
- optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-6
|
| 35 |
+
- lr_scheduler_type: linear
|
| 36 |
+
- num_epochs: 2
|
| 37 |
+
### Training Results
|
| 38 |
+
|
| 39 |
+
======== Epoch 1 / 2 ========
|
| 40 |
+
Training...
|
| 41 |
+
Batch 30 of 1,222. Elapsed: 0:00:38.
|
| 42 |
+
Batch 60 of 1,222. Elapsed: 0:01:16.
|
| 43 |
+
Batch 90 of 1,222. Elapsed: 0:01:53.
|
| 44 |
+
Batch 120 of 1,222. Elapsed: 0:02:30.
|
| 45 |
+
Batch 150 of 1,222. Elapsed: 0:03:07.
|
| 46 |
+
Batch 180 of 1,222. Elapsed: 0:03:44.
|
| 47 |
+
Batch 210 of 1,222. Elapsed: 0:04:21.
|
| 48 |
+
Batch 240 of 1,222. Elapsed: 0:04:58.
|
| 49 |
+
Batch 270 of 1,222. Elapsed: 0:05:35.
|
| 50 |
+
Batch 300 of 1,222. Elapsed: 0:06:12.
|
| 51 |
+
Batch 330 of 1,222. Elapsed: 0:06:49.
|
| 52 |
+
Batch 360 of 1,222. Elapsed: 0:07:27.
|
| 53 |
+
Batch 390 of 1,222. Elapsed: 0:08:04.
|
| 54 |
+
Batch 420 of 1,222. Elapsed: 0:08:41.
|
| 55 |
+
Batch 450 of 1,222. Elapsed: 0:09:18.
|
| 56 |
+
Batch 480 of 1,222. Elapsed: 0:09:55.
|
| 57 |
+
Batch 510 of 1,222. Elapsed: 0:10:32.
|
| 58 |
+
Batch 540 of 1,222. Elapsed: 0:11:09.
|
| 59 |
+
Batch 570 of 1,222. Elapsed: 0:11:46.
|
| 60 |
+
Batch 600 of 1,222. Elapsed: 0:12:24.
|
| 61 |
+
Batch 630 of 1,222. Elapsed: 0:13:01.
|
| 62 |
+
Batch 660 of 1,222. Elapsed: 0:13:38.
|
| 63 |
+
Batch 690 of 1,222. Elapsed: 0:14:15.
|
| 64 |
+
Batch 720 of 1,222. Elapsed: 0:14:52.
|
| 65 |
+
Batch 750 of 1,222. Elapsed: 0:15:29.
|
| 66 |
+
Batch 780 of 1,222. Elapsed: 0:16:06.
|
| 67 |
+
Batch 810 of 1,222. Elapsed: 0:16:43.
|
| 68 |
+
Batch 840 of 1,222. Elapsed: 0:17:20.
|
| 69 |
+
Batch 870 of 1,222. Elapsed: 0:17:57.
|
| 70 |
+
Batch 900 of 1,222. Elapsed: 0:18:35.
|
| 71 |
+
Batch 930 of 1,222. Elapsed: 0:19:12.
|
| 72 |
+
Batch 960 of 1,222. Elapsed: 0:19:49.
|
| 73 |
+
Batch 990 of 1,222. Elapsed: 0:20:26.
|
| 74 |
+
Batch 1,020 of 1,222. Elapsed: 0:21:03.
|
| 75 |
+
Batch 1,050 of 1,222. Elapsed: 0:21:40.
|
| 76 |
+
Batch 1,080 of 1,222. Elapsed: 0:22:17.
|
| 77 |
+
Batch 1,110 of 1,222. Elapsed: 0:22:54.
|
| 78 |
+
Batch 1,140 of 1,222. Elapsed: 0:23:31.
|
| 79 |
+
Batch 1,170 of 1,222. Elapsed: 0:24:09.
|
| 80 |
+
Batch 1,200 of 1,222. Elapsed: 0:24:46.
|
| 81 |
+
|
| 82 |
+
Average training loss: 0.27
|
| 83 |
+
Training epoch took: 0:25:12
|
| 84 |
+
|
| 85 |
+
Running Validation...
|
| 86 |
+
Accuracy: 0.92
|
| 87 |
+
Validation took: 0:02:51
|
| 88 |
+
|
| 89 |
+
======== Epoch 2 / 2 ========
|
| 90 |
+
Training...
|
| 91 |
+
Batch 30 of 1,222. Elapsed: 0:00:37.
|
| 92 |
+
Batch 60 of 1,222. Elapsed: 0:01:14.
|
| 93 |
+
Batch 90 of 1,222. Elapsed: 0:01:51.
|
| 94 |
+
Batch 120 of 1,222. Elapsed: 0:02:29.
|
| 95 |
+
Batch 150 of 1,222. Elapsed: 0:03:06.
|
| 96 |
+
Batch 180 of 1,222. Elapsed: 0:03:43.
|
| 97 |
+
Batch 210 of 1,222. Elapsed: 0:04:20.
|
| 98 |
+
Batch 240 of 1,222. Elapsed: 0:04:57.
|
| 99 |
+
Batch 270 of 1,222. Elapsed: 0:05:34.
|
| 100 |
+
Batch 300 of 1,222. Elapsed: 0:06:11.
|
| 101 |
+
Batch 330 of 1,222. Elapsed: 0:06:48.
|
| 102 |
+
Batch 360 of 1,222. Elapsed: 0:07:25.
|
| 103 |
+
Batch 390 of 1,222. Elapsed: 0:08:03.
|
| 104 |
+
Batch 420 of 1,222. Elapsed: 0:08:40.
|
| 105 |
+
Batch 450 of 1,222. Elapsed: 0:09:17.
|
| 106 |
+
Batch 480 of 1,222. Elapsed: 0:09:54.
|
| 107 |
+
Batch 510 of 1,222. Elapsed: 0:10:31.
|
| 108 |
+
Batch 540 of 1,222. Elapsed: 0:11:08.
|
| 109 |
+
Batch 570 of 1,222. Elapsed: 0:11:45.
|
| 110 |
+
Batch 600 of 1,222. Elapsed: 0:12:23.
|
| 111 |
+
Batch 630 of 1,222. Elapsed: 0:13:00.
|
| 112 |
+
Batch 660 of 1,222. Elapsed: 0:13:37.
|
| 113 |
+
Batch 690 of 1,222. Elapsed: 0:14:14.
|
| 114 |
+
Batch 720 of 1,222. Elapsed: 0:14:51.
|
| 115 |
+
Batch 750 of 1,222. Elapsed: 0:15:28.
|
| 116 |
+
Batch 780 of 1,222. Elapsed: 0:16:05.
|
| 117 |
+
Batch 810 of 1,222. Elapsed: 0:16:43.
|
| 118 |
+
Batch 840 of 1,222. Elapsed: 0:17:20.
|
| 119 |
+
Batch 870 of 1,222. Elapsed: 0:17:57.
|
| 120 |
+
Batch 900 of 1,222. Elapsed: 0:18:34.
|
| 121 |
+
Batch 930 of 1,222. Elapsed: 0:19:11.
|
| 122 |
+
Batch 960 of 1,222. Elapsed: 0:19:48.
|
| 123 |
+
Batch 990 of 1,222. Elapsed: 0:20:25.
|
| 124 |
+
Batch 1,020 of 1,222. Elapsed: 0:21:03.
|
| 125 |
+
Batch 1,050 of 1,222. Elapsed: 0:21:40.
|
| 126 |
+
Batch 1,080 of 1,222. Elapsed: 0:22:17.
|
| 127 |
+
Batch 1,110 of 1,222. Elapsed: 0:22:54.
|
| 128 |
+
Batch 1,140 of 1,222. Elapsed: 0:23:31.
|
| 129 |
+
Batch 1,170 of 1,222. Elapsed: 0:24:08.
|
| 130 |
+
Batch 1,200 of 1,222. Elapsed: 0:24:45.
|
| 131 |
+
|
| 132 |
+
Average training loss: 0.16
|
| 133 |
+
Training epoch took: 0:25:12
|
| 134 |
+
|
| 135 |
+
Running Validation...
|
| 136 |
+
Accuracy: 0.93
|
| 137 |
+
Validation took: 0:02:52
|
| 138 |
+
|
| 139 |
+
### Framework Versions
|
| 140 |
+
- Transformers 4.41.2
|
| 141 |
+
- Pytorch 2.3
|
| 142 |
+
- Tokenizers 0.19.1
|