## 🏗️ Project Structure ``` ├── app.py # Main FastAPI app entrypoint ├── config.py # Configuration loader (.env, settings) ├── features/ │ ├── text_classifier/ # English (GPT-2) classifier │ │ ├── controller.py │ │ ├── inferencer.py │ │ ├── model_loader.py │ │ ├── preprocess.py │ │ └── routes.py │ └── nepali_text_classifier/ # Nepali (sentencepiece) classifier │ ├── controller.py │ ├── inferencer.py │ ├── model_loader.py │ ├── preprocess.py │ └── routes.py ├── np_text_model/ # Nepali model artifacts (auto-downloaded) │ ├── classifier/ │ │ └── sentencepiece.bpe.model │ └── model_95_acc.pth ├── models/ # English GPT-2 model/tokenizer (auto-downloaded) │ ├── merges.txt │ ├── tokenizer.json │ └── model_weights.pth ├── Dockerfile # Container build config ├── Procfile # Deployment entrypoint (for PaaS) ├── requirements.txt # Python dependencies ├── README.md ├── Docs # documents └── .env # Secret token(s), environment config ``` ### 🌟 Key Files and Their Roles - **`app.py`**: Entry point initializing FastAPI app and routes. - **`Procfile`**: Tells Railway (or similar platforms) how to run the program. - **`requirements.txt`**: Tracks all Python dependencies for the project. - **`__init__.py`**: Package initializer for the root module and submodules. - **`features/text_classifier/`** - **`controller.py`**: Handles logic between routes and the model. - **`inferencer.py`**: Runs inference and returns predictions as well as file system utilities. - **`features/NP/`** - **`controller.py`**: Handles logic between routes and the model. - **`inferencer.py`**: Runs inference and returns predictions as well as file system utilities. - **`model_loader.py`**: Loads the ML model and tokenizer. - **`preprocess.py`**: Prepares input text for the model. - **`routes.py`**: Defines API routes for text classification. -[Main](../README.md)