API Reference
Zero-shot text classification
POST
/
v1
/
classifications
/
zero-shot
Zero-shot text classification
curl --request POST \
--url https://api.synapsai.cloud/v1/classifications/zero-shot \
--header 'Content-Type: application/json' \
--data '
{
"sequences": "<string>",
"candidate_labels": "<string>",
"hypothesis_template": "This example is {}.",
"multi_label": false
}
'import requests
url = "https://api.synapsai.cloud/v1/classifications/zero-shot"
payload = {
"sequences": "<string>",
"candidate_labels": "<string>",
"hypothesis_template": "This example is {}.",
"multi_label": False
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"sequence": "<string>",
"labels": [
"<string>"
],
"scores": [
123
]
}Body
application/json
Zero-shot text classification request.
Sequence(s) to classify. Required.
Label or list of labels to test against the sequences. Required.
Template used to convert labels into hypotheses for entailment scoring.
If true, multiple labels may be true and scores are not normalized across labels.
⌘I
Zero-shot text classification
curl --request POST \
--url https://api.synapsai.cloud/v1/classifications/zero-shot \
--header 'Content-Type: application/json' \
--data '
{
"sequences": "<string>",
"candidate_labels": "<string>",
"hypothesis_template": "This example is {}.",
"multi_label": false
}
'import requests
url = "https://api.synapsai.cloud/v1/classifications/zero-shot"
payload = {
"sequences": "<string>",
"candidate_labels": "<string>",
"hypothesis_template": "This example is {}.",
"multi_label": False
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"sequence": "<string>",
"labels": [
"<string>"
],
"scores": [
123
]
}