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.text){
"score": [
"0.8543054461479187"
],
"label": [
"positive"
],
"_rawJsonResponse": "{\n \"names\": [\"label\", \"score\", \"tokens\", \"attention_weights\"],\n \"ndarray\": [[\"positive\"], [\"0.8543054461479187\"]]\n}"
}Get a prediction
Get a prediction from the specified model.
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.text){
"score": [
"0.8543054461479187"
],
"label": [
"positive"
],
"_rawJsonResponse": "{\n \"names\": [\"label\", \"score\", \"tokens\", \"attention_weights\"],\n \"ndarray\": [[\"positive\"], [\"0.8543054461479187\"]]\n}"
}Path Parameters
Body
application/json
The body is of type object.
Response
OK
The response is of type object.
Was this page helpful?
⌘I