NLP-powered language detection service β trained on a custom dataset, served via FastAPI, containerized with Docker, deployed on Railway.
Built end-to-end: from raw data and model training in Jupyter to a live production endpoint with a web UI.
Why it exists: My first complete ML project shipped to production β not a notebook, not a tutorial result. A running service.
- UI: https://full-ml-pipeline-production.up.railway.app/ui
- Health check: https://full-ml-pipeline-production.up.railway.app/
- API docs (Swagger): https://full-ml-pipeline-production.up.railway.app/docs
- Language prediction endpoint for user text
- Clean web UI for manual testing
- FastAPI OpenAPI documentation
- Dockerized deployment flow
- Railway hosting support
.
βββ Dockerfile
βββ README.md
βββ app
βββ main.py
βββ requirements.txt
βββ static
β βββ index.html
βββ model
βββ model.py
βββ trained_pipeline-0.1.0.pkl
βββ LangDetetctionModel.ipynb
Returns service status and model version.
Example response:
{
"health_check": "OK",
"model_version": "0.1.0"
}Serves the web interface for submitting text and viewing predictions.
Predicts the language of the provided text.
Request body:
{
"text": "Bonjour, comment allez-vous aujourd'hui?"
}Response:
{
"language": "French"
}Build image:
docker build -t language-detection-app .Run container:
docker run --rm -p 80:80 language-detection-appOpen in browser:
curl -X POST "http://localhost/predict" \
-H "Content-Type: application/json" \
-d '{"text":"Hello, how are you today?"}'- Hosted on Railway using the repository Dockerfile.
- For lower startup overhead on small instances, worker settings can be tuned with:
- WEB_CONCURRENCY=1
- MAX_WORKERS=1
- Python 3.9
- FastAPI
- scikit-learn
- NumPy
- Docker
- Railway
Adam Vakar