This project implements 3 classifier structures:
- Local Classifier par Parent Node (LCPN) - each parent node receives one multiclass classifier.
- Local Classifier per Node (LCN) - training one multiclass classifier for each level.
- Flat Classifier ("flat" classifier) - training on concatenated data.
The implementation of each of them is in the app/model/analyze.ipynb folder.
- Python 3.10 or higher
pipfor managing Python packages- Docker (optional, if using Docker)
-
Clone the repository:
git clone https://github.com/your-username/fastapi-text-classification.git cd fastapi-text-classification -
Install the required Python packages:
pip install -r requirements.txt
-
Make sure your model files (
model.pkl,encoder.pkl,vectorizer.pkl) are located in themodel/directory.
Run the FastAPI application locally:
uvicorn main:app --reload-
Building the Docker Image:
docker build -t fastapi-app . -
Running the Docker Container
docker run -d -p 8000:8000 fastapi-app