Foundation Models Text Classification API, gRPC: TextClassificationService.Classify
Written by
Updated at October 17, 2024
RPC method for text classification.
gRPC request
rpc Classify (TextClassificationRequest) returns (TextClassificationResponse)
TextClassificationRequest
{
"modelUri": "string",
"text": "string"
}
Request for the service to classify text.
Field |
Description |
modelUri |
string The identifier of the classification model. |
text |
string Text for classification. |
TextClassificationResponse
{
"predictions": [
{
"label": "string",
"confidence": "double"
}
],
"modelVersion": "string"
}
Response containing classifier predictions.
Field |
Description |
predictions[] |
Result of classification - a list of label-confidence pairs. |
modelVersion |
string Model version (changes with model releases). |
ClassificationLabel
A pair of text label and corresponding confidence used in classification problems.
Field |
Description |
label |
string A label with a class name. |
confidence |
double Confidence of item's belonging to a class. |