text-to-role-classification
Webserver hosting a semantic role labeling model. Can make predictions
-
argm-phrases.json
The labeled training data -
train_model.py
Trains the model from the fileargm-phrases.json
and stores the model inmodel.pkl
-
model.pkl
The model to be used in the webserver to make predictions -
server.py
The flask webserver hosting the model for predictions -
example_request.py
Example of using the API.
Usage:
- installation:
pip install -r requirements.txt
- training:
python train_model.py
- run API server:
python server.py
- API usage:
POST
http://localhost:5000/predict
jsondata = ["Great", "Bad"]
curl -H "Content-Type: application/json" -X POST -d '["Great", "Bad"]' http://localhost:5000/predict