curl --request POST \
--url http://localhost:8000/classify \
--header 'Content-Type: application/json' \
--data '
{
"input": "I love programming."
}
'{
"data": [
{
"index": 0,
"label": "Positive",
"num_classes": 2,
"probs": [
0.9,
0.1
]
}
],
"object": "list",
"usage": {
"prompt_tokens": 5,
"total_tokens": 5
}
}Container text classification
Classify text into categories using Friendli Container. Run text classification models on your own infrastructure with full data control and privacy.
curl --request POST \
--url http://localhost:8000/classify \
--header 'Content-Type: application/json' \
--data '
{
"input": "I love programming."
}
'{
"data": [
{
"index": 0,
"label": "Positive",
"num_classes": 2,
"probs": [
0.9,
0.1
]
}
],
"object": "list",
"usage": {
"prompt_tokens": 5,
"total_tokens": 5
}
}Body
Routes the request to a specific adapter.
"(adapter-route)"
Input text to classify, encoded as a string or array of strings. To classify multiple inputs in a single request, pass an array of strings.
Either input or tokens field is required.
"I love programming."
The tokenized prompt (i.e., input tokens).
Either input or tokens field is required.
72
Response
Successfully classified the text input.
Hide child attributes
Hide child attributes
The index of the input in the list of inputs.
0
The predicted label for the input text.
"Positive"
The number of possible labels the model can predict.
2
A list of logits for each possible label.
[0.1, 0.9]
The object type, which is always set to list.
"list"