machine-learning-exchange / katalog

MLX Katalog is a project to hold the default content samples to bootstrap Machine Learning eXchange.
Apache License 2.0
11 stars 13 forks source link

Return top 3 predictions in Codenet Language Classifier model #42

Open ckadner opened 2 years ago

ckadner commented 2 years ago

@kmh4321 -- I thought we had decided to print the first 3 highest predictions, if there are more than one? When I run the prediction on a Python script I get 85% match for Haskel. It would be interesting to see the next best prediction.

Curl

curl -X POST "http://0.0.0.0:5000/model/predict" -H  "accept: application/json" -H  "Content-Type: multipart/form-data" -F 
"file=@animal_tasks.py;type=text/x-python-script"

Request URL

http://0.0.0.0:5000/model/predict

Server response

Code: 200

Response body:

{
  "status": "ok",
  "predictions": [
    {
      "language": "Haskell",
      "probability": 0.8541885018348694
    }
  ]
}

Originally posted by @ckadner in https://github.com/machine-learning-exchange/katalog/issues/41#issuecomment-926078483