Skip to main content
POST
/
models
/
v2
/
facebook
/
bart-large-mnli
zero-shot-classification
curl --request POST \
  --url https://api.bytez.com/models/v2/facebook/bart-large-mnli \
  --header 'Authorization: <api-key>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "text": "One day I will see the world",
  "candidate_labels": [
    "travel",
    "cooking",
    "dancing"
  ]
}
'
{
  "error": "<string>",
  "output": {
    "sequence": "One day I will see the world",
    "labels": [
      "travel",
      "dancing",
      "cooking"
    ],
    "scores": [
      0.9941015839576721,
      0.0031261409167200327,
      0.002772255800664425
    ]
  }
}

Authorizations

Authorization
string
header
required

Set Authorization header to BYTEZ_KEY 'Authorization: YOUR_BYTEZ_KEY_HERE'

Body

application/json

Schema for zero-shot-classification models

text
string
required
Example:

"One day I will see the world"

candidate_labels
string[]
required
Example:
["travel", "cooking", "dancing"]

Response

Successful zero-shot-classification response.

error
string | null
required

Null on success; otherwise an error message.

output
object
required

Successful response with text-classification sequence, labels, and scores

Example:
{
"sequence": "One day I will see the world",
"labels": ["travel", "dancing", "cooking"],
"scores": [
0.9941015839576721,
0.0031261409167200327,
0.002772255800664425
]
}