A simple and powerful end-to-end short text classification project in Rust, using Polars, Candle and Warp.
- 🧘 Simple NLP neural network training using 🤗 Candle
- 🚀 CSV I/O and processing with Polars
- ⚡️ Inference via HTTP with Warp
To train a model, run the training binary:
RUST_LOG=info cargo run --bin training
To start the prediction service over HTTP, run the inference binary:
RUST_LOG=warn cargo run --bin inference
Then, to get the predictions, send a request via CURL/Postman:
curl -X POST -H "Content-Type: application/json" -d '{"text": "blizzard hits southwest"}' http://localhost:3030/predict
To build and run a Docker container:
docker build -t "headline-classifier" .; docker run -p 3030:3030 headline-classifier:latest