Open the notebook and run it to the last cell to get a trained model at ./model.joblib
.
Kaggle CLI should be installed.
Or:
- Install train dependencies (use virtual environment):
pip install -r requirements.train.txt
-
Download CommonLib Readability Prize dataset and unzip data to
./commonlitreadabilityprize/
. -
Run train script to get a trained model at
./model.joblib
:
python train.py
- Install API dependencies (use virtual environment):
pip install -r requirements.api.txt
- Run server:
python -m uvicorn api:app
- Test predict using
./example.json
:
curl -H "Content-Type: application/json" --data "@example.json" -X POST http://localhost:8000/predict
- Output should be:
[-0.8]
Try:
curl -H "Content-Type: application/json" --data "@example.json" -X POST https://guarded-fortress-68184.herokuapp.com/predict