API Reference
Zero-shot audio classification
POST
/
v1
/
classifications
/
zero-shot
/
audio
Zero-shot audio classification
curl --request POST \
--url https://api.synapsai.cloud/v1/classifications/zero-shot/audio \
--header 'Content-Type: application/json' \
--data '
{
"audios": [
[
123
]
],
"candidate_labels": [
"<string>"
],
"hypothesis_template": "This is a sound of {}"
}
'import requests
url = "https://api.synapsai.cloud/v1/classifications/zero-shot/audio"
payload = {
"audios": [[123]],
"candidate_labels": ["<string>"],
"hypothesis_template": "This is a sound of {}"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)[
{
"label": "<string>",
"score": 123
}
]Body
application/json
Zero-shot classification request for audio inputs using candidate labels.
Audio input(s) as list(s) of floats (waveform arrays). Required.
List of candidate labels to classify the audio against. Required.
Template used to format each candidate label into a hypothesis for scoring.
⌘I
Zero-shot audio classification
curl --request POST \
--url https://api.synapsai.cloud/v1/classifications/zero-shot/audio \
--header 'Content-Type: application/json' \
--data '
{
"audios": [
[
123
]
],
"candidate_labels": [
"<string>"
],
"hypothesis_template": "This is a sound of {}"
}
'import requests
url = "https://api.synapsai.cloud/v1/classifications/zero-shot/audio"
payload = {
"audios": [[123]],
"candidate_labels": ["<string>"],
"hypothesis_template": "This is a sound of {}"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)[
{
"label": "<string>",
"score": 123
}
]