Foundation Models Text Classification API, gRPC: TextClassificationService.Classify
RPC method to classify text with tuned model.
The names of the classes between which the model will be distributing requests
must be specified during model tuning and are not provided in the request.
gRPC request
rpc Classify (TextClassificationRequest) returns (TextClassificationResponse)
TextClassificationRequest
{
"modelUri": "string",
"text": "string"
}
Request for the service to classify text with tuned model.
The names of the classes between which the model will be distributing requests must be specified during model tuning;
therefore, they are not provided in the request.
For examples of usage, see step-by-step guides.
Field |
Description |
modelUri |
string The URI of your tuned classifier model. |
text |
string Text for classification. |
TextClassificationResponse
{
"predictions": [
{
"label": "string",
"confidence": "double"
}
],
"modelVersion": "string"
}
Response with classifier predictions.
Field |
Description |
predictions[] |
The classification results with the `confidence`` values |
modelVersion |
string The model version changes with each new releases. |
ClassificationLabel
A pair of text labels and their corresponding confidence values.
Field |
Description |
label |
string A class name label. |
confidence |
double The probability of classifying text into a specific class. |