This is the backend for the project using FastAPI. It is simple API containing a single endpoint that returns a classification for a given email.
pip install -r requirements.txt
uvicorn app.main:app --reload
In order to train the model, you need to download the dataset from here and create a folder called spambase
in the root directory of the repository. Then, place the spambase.data
and spambase.names
files in the spambase
directory.
Then, run the following command:
python ./app/models/ml/train.py
Method | Endpoint | Description |
---|---|---|
POST | /spam/predict | Get Prediction |
No parameters
Name | Type | Description |
---|---|---|
text | string | The email text to classify |
Name | Type | Description |
---|---|---|
label | string | The predicted label, either spam or not spam |