This repository provides a simple implementation of a text classification model using BERT (Bidirectional Encoder Representations from Transformers).
- Uses Hugging Face's Transformers library.
- Simple and easy-to-understand implementation.
- Includes scripts for data preprocessing, model training, and prediction.
- Python 3.6+
- PyTorch
- Transformers
- scikit-learn
- pandas
Install the required packages using:
pip install -r requirements.txt
git clone https://github.com/StarJulian/Simple-BERT-text-classification-model.git
cd Simple-BERT-text-classification-model
Prepare your dataset in CSV format with text
and label
columns.
python train.py
python test.py
python predict.py
Simple-BERT-text-classification-model/
├── datasets/
│ ├── your_train_dataset.txt
│ ├── your_testt_dataset.txt
├── saved_models/
│ └── your_model.pth
├── datasets.py
├── main.py
├── predict.py
├── requirements.txt
├── test.py
├── train.py
└── README.md
datasets.py
: Script for data preprocessing.train.py
: Script for training the BERT model.test.py
: Script for evaluating the model.predict.py
: Script for making predictions on new data.
This project is licensed under the Apache-2.0 License. See the LICENSE file for details.