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.
Single text, list of texts, dict pairs or list of dicts to classify. Required.
Number of top labels to return for each input.
Function to apply to logits to produce probabilities or scores.
Available options:
sigmoid, softmax, none ⌘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
}
]