Skip to main content
POST
/
ai
/
ml-models
/
{modelId}
/
prediction
Get a prediction
import requests

url = "https://{FUSION HOST}/api/ai/ml-models/{modelId}/prediction"

payload = { "text": "Hello world.  How are you doing today?" }
headers = {"Content-Type": "application/json"}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
{
  "score": [
    "0.8543054461479187"
  ],
  "label": [
    "positive"
  ],
  "_rawJsonResponse": "{\n  \"names\": [\"label\", \"score\", \"tokens\", \"attention_weights\"],\n  \"ndarray\": [[\"positive\"], [\"0.8543054461479187\"]]\n}"
}

Path Parameters

modelId
string
required

Body

application/json · object

Response

OK

The response is of type object.