riva/proto/jarvis_nlp_core.proto

service JarvisCoreNLP

The Jarvis Core NLP Service provides generic NLP services for custom model use cases. The intent of this service is to allow users to design models for arbitrary use cases that conform simply with input and output types specified in the service. As an explicit example, the ClassifyText function could be used for sentiment classification, domain recognition, language identification, etc.

rpc TextClassResponse ClassifyText(TextClassRequest)

ClassifyText takes as input an input/query string and parameters related to the requested model to use to evaluate the text. The service evaluates the text with the requested model, and returns one or more classifications.

rpc TokenClassResponse ClassifyTokens(TokenClassRequest)

ClassifyTokens takes as input either a string or list of tokens and parameters related to which model to use. The service evaluates the text with the requested model, performing additional tokenization if necessary, and returns one or more class labels per token.

rpc TextTransformResponse TransformText(TextTransformRequest)

TransformText takes an input/query string and parameters related to the requested model and returns another string. The behavior of the function is defined entirely by the underlying model and may be used for tasks like translation, adding punctuation, augment the input directly, etc.

message Classification

Classification messages return a class name and corresponding score

string class_name
float score
message ClassificationResult

ClassificationResults contain zero or more Classification messages If the number of Classifications is > 1, top_n > 1 must have been specified.

Classification labels(repeated)
message NLPModelParams

NLPModelParams is a metadata message that is included in every request message used by the Core NLP Service and is used to specify model characteristics/requirements

string model_name

Requested model to use. If unavailable, the request will return an error

message Span

Span of a particular result

uint32 start
uint32 end
message TextClassRequest

TextClassRequest is the input message to the ClassifyText service.

string text(repeated)

Each repeated text element is handled independently for handling multiple input strings with a single request

uint32 top_n

Return the top N classification results for each input. 0 or 1 will return top class, otherwise N. Note: Current disabled.

NLPModelParams model
message TextClassResponse

TextClassResponse is the return message from the ClassifyText service.

ClassificationResult results(repeated)
message TextTransformRequest

TextTransformRequest is a request type intended for services like TransformText which take an arbitrary text input

string text(repeated)

Each repeated text element is handled independently for handling multiple input strings with a single request

uint32 top_n
NLPModelParams model
message TextTransformResponse

TextTransformResponse is returned by the TransformText method. Responses are returned in the same order as they were requested.

string text(repeated)
message TokenClassRequest

TokenClassRequest is the input message to the ClassifyText service.

string text(repeated)

Each repeated text element is handled independently for handling multiple input strings with a single request

uint32 top_n

Return the top N classification results for each input. 0 or 1 will return top class, otherwise N. Note: Current disabled.

NLPModelParams model
message TokenClassResponse

TokenClassResponse returns a single TokenClassSequence per input request

TokenClassSequence results(repeated)
message TokenClassSequence

TokenClassSequence is used for returning a sequence of TokenClassValue objects in the original order of input tokens

TokenClassValue results(repeated)
message TokenClassValue

TokenClassValue is used to correlate an input token with its classification results

string token
Classification label(repeated)
Span span(repeated)