API Reference
Text classification
POST
/
v1
/
classifications
/
text
Text classification
curl --request POST \
--url https://api.synapsai.cloud/v1/classifications/text \
--header 'Content-Type: application/json' \
--data '
{
"inputs": "<string>",
"top_k": 1,
"function_to_apply": "softmax"
}
'import requests
url = "https://api.synapsai.cloud/v1/classifications/text"
payload = {
"inputs": "<string>",
"top_k": 1,
"function_to_apply": "softmax"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)[
{
"label": "<string>",
"score": 123
}
]Body
application/json
Request to classify text inputs.
⌘I
Text classification
curl --request POST \
--url https://api.synapsai.cloud/v1/classifications/text \
--header 'Content-Type: application/json' \
--data '
{
"inputs": "<string>",
"top_k": 1,
"function_to_apply": "softmax"
}
'import requests
url = "https://api.synapsai.cloud/v1/classifications/text"
payload = {
"inputs": "<string>",
"top_k": 1,
"function_to_apply": "softmax"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)[
{
"label": "<string>",
"score": 123
}
]