Downloads · 30 days
0
abhi227070/distilbert-base-uncased-finetuned-imdb
distilbert-base-uncased-finetuned-imdb is a text classification model from abhi227070. Use it when you need a label for a piece of text. It is set up for adapter-transformers. The card lists the license as apache-2.0.
should probably proofread and complete it, then remove this comment. --
Downloads · 30 days
0
Access
Public
Updated Jul 16, 2024
Parameters
67M
268 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors268 MB · 100%
From the Hugging Face model README
This model is a fine-tuned version of distilbert/distilbert-base-uncased on the IMDB dataset. It achieves the following results on the evaluation set:
This model is based on DistilBERT, a smaller, faster, cheaper, and lighter version of BERT developed by Hugging Face. It has been fine-tuned specifically for sentiment analysis on the IMDB movie reviews dataset. DistilBERT retains 97% of BERT's performance while being 60% faster and 40% smaller.
The model is trained to classify text into positive or negative sentiment, making it suitable for applications that need to understand user opinions or reviews.
The model is trained on the IMDB dataset, which consists of 50,000 highly polar movie reviews labeled as either positive or negative. The dataset is balanced, with an equal number of positive and negative reviews.
The evaluation was performed on a separate validation set derived from the IMDB dataset, ensuring that the model's performance metrics are based on data it has not seen during training.
The IMDB dataset was loaded and preprocessed to include numerical labels for sentiments (positive and negative). It was then split into training (60%), validation (20%), and test (20%) sets, and the indices were reset for proper formatting.
The data was converted into the DatasetDict format compatible with the Hugging Face Transformers library. The AutoTokenizer for DistilBERT was used to tokenize the text data, truncating where necessary. A preprocessing function applied tokenization to the entire dataset, preparing it for model training.
A DataCollatorWithPadding was used to handle the variability in sequence lengths during batching, ensuring efficiency and standardization. The AutoModelForSequenceClassification with DistilBERT as the base model was set up for binary classification, mapping labels to sentiment classes (positive and negative).
Training arguments included learning rate, batch size, number of epochs, evaluation strategy, and logging steps, optimized for effective training. Evaluation metrics, including accuracy and F1 score, were defined to assess model performance, with a function to compute these metrics by comparing predictions with true labels.
The Trainer class from the Transformers library was used to conduct the training over three epochs, integrating the model, training arguments, tokenized datasets, data collator, and evaluation metrics. This comprehensive approach ensured effective fine-tuning for sentiment analysis on the IMDB dataset, achieving high accuracy and F1 scores.
The following hyperparameters were used during training:
| Training Loss | Epoch | Step | Validation Loss | Accuracy | F1 |
|---|---|---|---|---|---|
| 0.241 | 1.0 | 1875 | 0.2029 | 0.9268 | 0.9268 |
| 0.1411 | 2.0 | 3750 | 0.2442 | 0.932 | 0.9320 |
| 0.079 | 3.0 | 5625 | 0.2882 | 0.9347 | 0.9347 |