-
Install dependencies: Create a virtual environment and upgrade the version of
pippython3 -m venv .env source .env/bin/activate python -m pip install -U pipInstall the required packages
cd text_classification_app pip install -r requirements.txt -
Run the application:
python app.py
The server is setup on port 5000.
- Users input text or upload CSV files containing texts via the web interface.
- The app processes the text with multiple pretrained models (ML, LSTM, Transformer) for tasks such as sentiment analysis, spam detection, and topic classification.
- Predicted labels and confidence scores are displayed for each input text, with options to export results.
app.py: Main Flask application, handles routes, user input, and prediction.models/checkpoints: Contains pretrained ML and LSTM model files and source code.utils: Utility functions for preprocessing, loading embeddings, and vocabularies.data: Contains vocabulary files and GloVe embeddings.templates/index.html: Stores uploaded and processed images.static/css/: CSS files for styling the web pages.
- The app supports multiple text classification tasks with different models for comparison.
- Large model files are stored externally (e.g., Google Drive) and loaded at runtime.
- For better performance, a CUDA-enabled GPU is recommended if using LSTM models.
- The app can be deployed on Render or similar cloud services for public access.
- Built using PyTorch and Hugging Face Transformers.
- Pretrained models and datasets sourced from public repositories.
- Inspired by the need for a simple, multifunctional text classification web application.
