luluw commited on
Commit
9b2beb8
1 Parent(s): 332c1a5

End of training

Browse files
README.md CHANGED
@@ -1,72 +1,69 @@
1
  ---
2
- language: en
3
- tags:
4
- - sentiment-analysis
5
- - transformers
6
- - pytorch
7
  license: apache-2.0
8
- datasets:
9
- - custom-dataset
 
10
  metrics:
11
  - accuracy
12
- model_name: distilbert-base-uncased-finetuned-sentiment
 
 
13
  ---
14
 
15
- # DistilBERT Base Uncased Fine-tuned for Sentiment Analysis
 
16
 
17
- ## Model Description
18
 
19
- This model is a fine-tuned version of `distilbert-base-uncased` on a sentiment analysis dataset. It is trained to classify text into positive and negative sentiment categories.
 
 
 
20
 
21
- ## Training Details
22
 
23
- The model was fine-tuned on a sentiment analysis dataset using the Hugging Face `transformers` library. The training parameters are as follows:
24
 
25
- - **Learning Rate**: 2e-5
26
- - **Batch Size**: 32
27
- - **Number of Epochs**: 4
28
- - **Optimizer**: AdamW
29
- - **Scheduler**: Linear with warmup
30
- - **Device**: Nvidia T4 GPU
31
 
32
- ## Training and Validation Metrics
33
 
34
- | Step | Training Loss | Validation Loss | Accuracy |
35
- |------|---------------|-----------------|----------|
36
- | 400 | 0.389300 | 0.181316 | 93.25% |
37
- | 800 | 0.161900 | 0.166204 | 94.13% |
38
- | 1200 | 0.114600 | 0.200135 | 94.30% |
39
- | 1600 | 0.076300 | 0.211609 | 94.40% |
40
- | 2000 | 0.041600 | 0.225439 | 94.45% |
41
 
42
- Final training metrics:
43
 
44
- - **Global Step**: 2000
45
- - **Training Loss**: 0.156715
46
- - **Training Runtime**: 1257.5696 seconds
47
- - **Training Samples per Second**: 50.892
48
- - **Training Steps per Second**: 1.59
49
- - **Total FLOPS**: 8477913513984000.0
50
- - **Epochs**: 4.0
51
 
52
- ## Model Performance
53
 
54
- The model achieves an accuracy of approximately 94.45% on the validation set.
 
 
 
 
 
 
 
 
 
55
 
56
- ## Usage
57
 
58
- To use this model for sentiment analysis, you can load it using the `transformers` library:
 
 
 
 
 
 
59
 
60
- ```python
61
- from transformers import DistilBertTokenizerFast, DistilBertForSequenceClassification
62
 
63
- model_name = 'luluw/distilbert-base-uncased-finetuned-sentiment'
64
- tokenizer = DistilBertTokenizerFast.from_pretrained(model_name)
65
- model = DistilBertForSequenceClassification.from_pretrained(model_name)
66
 
67
- # Example usage
68
- text = "I love this product!"
69
- inputs = tokenizer(text, return_tensors='pt')
70
- outputs = model(**inputs)
71
- predictions = torch.argmax(outputs.logits, dim=-1)
72
- ```
 
1
  ---
2
+ library_name: transformers
3
+ language:
4
+ - en
 
 
5
  license: apache-2.0
6
+ base_model: distilbert-base-uncased
7
+ tags:
8
+ - generated_from_trainer
9
  metrics:
10
  - accuracy
11
+ model-index:
12
+ - name: distilbert-base-uncased-finetuned-sentiment
13
+ results: []
14
  ---
15
 
16
+ <!-- This model card has been generated automatically according to the information the Trainer had access to. You
17
+ should probably proofread and complete it, then remove this comment. -->
18
 
19
+ # distilbert-base-uncased-finetuned-sentiment
20
 
21
+ This model is a fine-tuned version of [distilbert-base-uncased](https://huggingface.co/distilbert-base-uncased) on the imdb-dataset-of-50k-movie-reviews dataset.
22
+ It achieves the following results on the evaluation set:
23
+ - Loss: 0.2166
24
+ - Accuracy: 0.9263
25
 
26
+ ## Model description
27
 
28
+ More information needed
29
 
30
+ ## Intended uses & limitations
 
 
 
 
 
31
 
32
+ More information needed
33
 
34
+ ## Training and evaluation data
 
 
 
 
 
 
35
 
36
+ More information needed
37
 
38
+ ## Training procedure
 
 
 
 
 
 
39
 
40
+ ### Training hyperparameters
41
 
42
+ The following hyperparameters were used during training:
43
+ - learning_rate: 2.5e-05
44
+ - train_batch_size: 32
45
+ - eval_batch_size: 32
46
+ - seed: 42
47
+ - optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08
48
+ - lr_scheduler_type: linear
49
+ - lr_scheduler_warmup_steps: 500
50
+ - num_epochs: 5
51
+ - mixed_precision_training: Native AMP
52
 
53
+ ### Training results
54
 
55
+ | Training Loss | Epoch | Step | Validation Loss | Accuracy |
56
+ |:-------------:|:-----:|:----:|:---------------:|:--------:|
57
+ | 0.3029 | 1.0 | 1250 | 0.2369 | 0.9085 |
58
+ | 0.1607 | 2.0 | 2500 | 0.2166 | 0.9263 |
59
+ | 0.0924 | 3.0 | 3750 | 0.2867 | 0.9208 |
60
+ | 0.0521 | 4.0 | 5000 | 0.3193 | 0.9235 |
61
+ | 0.0312 | 5.0 | 6250 | 0.3764 | 0.9227 |
62
 
 
 
63
 
64
+ ### Framework versions
 
 
65
 
66
+ - Transformers 4.44.2
67
+ - Pytorch 2.5.0+cu121
68
+ - Datasets 3.1.0
69
+ - Tokenizers 0.19.1
 
 
model.safetensors CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:b8b0b94d570d9e72562ec6a67e1f9e661b8fd37d61713328cbaee868d2d894c1
3
  size 267832560
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1206849e3c05739b6e3bf22cc7eaeb36a30aa7d253db0b5fda5700924cdcfc6f
3
  size 267832560
runs/Nov10_17-03-26_f6031cd483a5/events.out.tfevents.1731258420.f6031cd483a5.323.2 CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:67c95f1e6f50faa95c018d9c8a825ee37aa3eb6cd5634cbeb4647663335f8335
3
- size 7672
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2df890952a7d0da62e644e9e049b65069e27e68594739f8232bcaa4f14f07765
3
+ size 8026
runs/Nov10_17-03-26_f6031cd483a5/events.out.tfevents.1731261865.f6031cd483a5.323.3 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e2db3174734ef3f66770fe0084eff460f5a4a913807a6dda62c6696ea68bdb73
3
+ size 411