File size: 2,056 Bytes
3407670
 
 
 
 
 
 
 
 
 
 
 
 
 
 
03bf20e
 
5444752
 
3407670
 
 
 
 
 
 
 
 
 
 
 
 
03bf20e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3407670
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
03bf20e
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
66
67
68
69
70
71
72
73
74
75
76
77
---
language:
- en
license: mit
base_model: gpt2
tags:
- pytorch
- GPT2ForSequenceClassification
- generated_from_trainer
metrics:
- accuracy
- matthews_correlation
model-index:
- name: GPT2-genre-detection
  results: []
library_name: transformers
pipeline_tag: text-classification
datasets:
- datadrivenscience/movie-genre-prediction
---

<!-- This model card has been generated automatically according to the information the Trainer had access to. You
should probably proofread and complete it, then remove this comment. -->

# GPT2-genre-detection

This model is a fine-tuned version of [gpt2](https://huggingface.co/gpt2) on the datadrivenscience/movie-genre-prediction dataset.
It achieves the following results on the evaluation set:
- Loss: 1.5267
- Accuracy: 0.4593
- Matthews Correlation: 0.1010

##  description

[Data-Driven Science](https://huggingface.co/datadrivenscience) organized a competition where in the goal was to fine tune a model that can predict the genre of a movie from a given synopsis. There were a total of 10 genres as follows:
```json
{
    "0": "horror",
    "1": "adventure",
    "2": "action",
    "3": "crime",
    "4": "mystery",
    "5": "family",
    "6": "scifi",
    "7": "thriller",
    "8": "fantasy",
    "9": "romance"
  }
```


### Training hyperparameters

The following hyperparameters were used during training:
- learning_rate: 2e-05
- train_batch_size: 8
- eval_batch_size: 32
- seed: 85855289
- optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08
- lr_scheduler_type: cosine
- lr_scheduler_warmup_ratio: 0.05
- num_epochs: 2

### Training results

| Training Loss | Epoch | Step  | Validation Loss | Accuracy | Matthews Correlation |
|:-------------:|:-----:|:-----:|:---------------:|:--------:|:--------------------:|
| 1.5765        | 1.0   | 10125 | 1.5562          | 0.4589   | 0.0899               |
| 1.5058        | 2.0   | 20250 | 1.5267          | 0.4593   | 0.1010               |


### Framework versions

- Transformers 4.36.2
- Pytorch 2.1.0+cu121
- Datasets 2.16.0
- Tokenizers 0.15.0