syntax = "proto3";

package encoderfile.token_classification;

import "proto/token.proto";
import "proto/metadata.proto";

service TokenClassificationInference {
  rpc Predict(TokenClassificationRequest) returns (TokenClassificationResponse);
  rpc GetModelMetadata(encoderfile.metadata.GetModelMetadataRequest) returns (encoderfile.metadata.GetModelMetadataResponse);
}

message TokenClassificationRequest {
  repeated string inputs = 1;
  map<string, string> metadata = 2;
}

message TokenClassificationResponse {
  repeated TokenClassificationResult results = 1;
  string model_id = 2;
  map<string, string> metadata = 3;
}

message TokenClassificationResult {
  repeated TokenClassification tokens = 1;
}

message TokenClassification {
  encoderfile.token.TokenInfo token_info = 1;
  repeated float scores = 2;
  string label = 3;
  float score = 4;
}
