--- library_name: transformers license: apache-2.0 base_model: distilbert-base-uncased tags: - generated_from_trainer - NLP - Language-Model - Sentiment-Analysis - Analysis metrics: - accuracy - f1 - precision - recall model-index: - name: my_distilbert_model results: [] datasets: - cornell-movie-review-data/rotten_tomatoes --- # my_distilbert_model This model is a fine-tuned version of [distilbert-base-uncased](https://huggingface.co/distilbert-base-uncased) on an cornell-movie-review-data/rotten_tomatoes dataset. It achieves the following results on the evaluation set: - Loss: 0.5379 - Accuracy: 0.8424 - F1: 0.8424 - Precision: 0.8424 - Recall: 0.8424 ## Model description ## How to use the model ``` python !pip install -q transformers from huggingface_hub import notebook_login notebook_login()#after running this line enter the access token generated on your hugging face account from transformers import AutoTokenizer, AutoModelForSequenceClassification tokenizer = AutoTokenizer.from_pretrained("gokarn09/my_distilbert_model") model = AutoModelForSequenceClassification.from_pretrained("gokarn09/my_distilbert_model") from transformers import pipeline text=["This is wonderful movie!", "The movie was really bad; I didn't like it."] classifier = pipeline("sentiment-analysis", model="gokarn09/my_distilbert_model") classifier(text) ``` ## Training and evaluation data More information needed ## Training procedure ### Training hyperparameters The following hyperparameters were used during training: - learning_rate: 2e-05 - train_batch_size: 16 - eval_batch_size: 16 - seed: 42 - optimizer: Use adamw_torch with betas=(0.9,0.999) and epsilon=1e-08 and optimizer_args=No additional optimizer arguments - lr_scheduler_type: linear - num_epochs: 3 ### Training results | Training Loss | Epoch | Step | Validation Loss | Accuracy | F1 | Precision | Recall | |:-------------:|:-----:|:----:|:---------------:|:--------:|:------:|:---------:|:------:| | 0.4193 | 1.0 | 534 | 0.4263 | 0.8180 | 0.8162 | 0.8311 | 0.8180 | | 0.2548 | 2.0 | 1068 | 0.4289 | 0.8377 | 0.8376 | 0.8383 | 0.8377 | | 0.1582 | 3.0 | 1602 | 0.5379 | 0.8424 | 0.8424 | 0.8424 | 0.8424 | ### Framework versions - Transformers 4.47.1 - Pytorch 2.5.1+cu121 - Datasets 3.2.0 - Tokenizers 0.21.0