This repository contains a DistilBERT model fine-tuned using the Hugging Face Transformers library on the IMDb movie review dataset. The model is designed for sentiment analysis, enabling the determination of sentiment polarity (positive or negative) within text reviews.
The model is based on the paper DistilBERT: a distilled version of BERT: smaller, faster, cheaper and lighter.
dataset/
: Contains scripts or code related to dataset handling and processing.pretrained/
: (Please manually download and place thepytorch_model.bin
file from the link below)predict.ipynb
: Notebook demonstrating the prediction process using the fine-tuned DistilBERT model.
Please download the pre-trained model pytorch_model.bin
from the following link and move it to the pretrained/
folder: Download Model
To get started, clone the repository and navigate to the project directory:
git clone https://github.com/zyh040521/distilbert-base-uncased-finetuning
cd distilbert-base-uncased-finetuning
To set up the required environment, install the dependencies listed in the requirements.txt
file using pip:
pip install -r requirements.txt
Run main.ipynb
Run predict.ipynb
- Use the
evaluate
library to assess model accuracy