This project implements a machine learning model capable of handling adversarial attacks, focusing particularly on a question-answering system that can withstand deceptive inputs designed to confuse or manipulate AI predictions.
Booklet : Adversarial Attack on Text Classification
-
Create a Virtual Environment
-
For Windows:
python.exe -m pip install --upgrade pip python -m venv myenv myenv\Scripts\activate
-
For Linux/Mac:
python -m pip install --upgrade pip python -m venv myenv source myenv/bin/activate
-
-
Install Required Python Packages
Run the following command to install all necessary dependencies listed in the
requirements.txt
file:pip install -r requirements.txt python -m pip install -e .
Before training the model, you need to download and prepare the required datasets:
cd utils
python dataloader.py
You can train the model by specifying the number of epochs in the model.py file. By default, the number of epochs is set to 1. To start training, execute the following commands:
cd model
python model.py