/UitClassifier

A simple classifier web api using LSTM model to predict gender based on Vietnamese names

Primary LanguagePython

File Structure

  • app_name
    • app.py: Flask API application
    • requirements.txt: list of packages that the app will import
    • models: directory that contains the pickled/json model files

Testing the API

  1. Run the Flask API locally for testing. Go to directory with app.py.
python3 app.py
  1. In a new terminal window, use HTTPie to make a GET request at the URL of the API.
http http://127.0.0.1:5000/ query=="Nguyễn Thị Minh Khai"
  1. Example of successful output.
HTTP/1.0 200 OK
Content-Length: 57
Content-Type: application/json
Date: Tue, 21 Aug 2018 19:04:04 GMT
Server: Werkzeug/0.14.1 Python/3.6.3

{
    "prediction": "Female",
    "confidence": 99.68,
}