AI vs Human Text Classification Using BERT by Vaibhav KumarAI vs Human Text Classification Using BERT by Vaibhav Kumar

AI vs Human Text Classification Using BERT

Vaibhav Kumar

Vaibhav Kumar

AI vs Human Text Classification

This project is designed to classify text as either AI-generated or human-written using a fine-tuned BERT model. The entire process includes data preprocessing, training, evaluation, and prediction.

๐Ÿš€ Project Setup

1. Mount Google Drive (Colab Users)

If using Google Colab, first mount your Google Drive:

๐Ÿ“ฆ Install Dependencies

Ensure the required libraries are installed:

๐Ÿ“‚ Dataset Preparation

2. Update Dataset Paths

Modify the paths to match your Google Drive structure:

3. Load Datasets


4. Preprocess Data

Ensure correct column names
Assign labels: 0 for Human, 1 for AI
Merge and shuffle the dataset

๐Ÿ”  Tokenization & Dataset Creation

5. Load BERT Tokenizer


6. Convert Data into Tensor Format


7. Create DataLoaders


๐Ÿ—๏ธ Model Setup

8. Load or Initialize Model


9. Define Optimizer


๐ŸŽฏ Training & Evaluation

10. Train the Model


11. Evaluate the Model


12. Train & Evaluate


๐Ÿง Text Prediction

13. Define Prediction Function


14. User Input for Testing


๐ŸŽฏ Final Notes

Ensure dataset paths are correct.
Model saves automatically after training.
Run the script in Google Colab or a local Python environment.
##๐Ÿ’นScreenshots
โœ… Now you are ready to classify AI vs Human text!
Like this project

Posted Aug 3, 2026

Developed a BERT-based model to classify AI vs human text.