riva/proto/riva_nlp.proto
riva/proto/riva_nlp.proto#
-
service RivaLanguageUnderstanding
- 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.
- rpc TokenClassResponse AnalyzeEntities(AnalyzeEntitiesRequest)
AnalyzeEntities accepts an input string and returns all named entities within the text, as well as a category and likelihood.
- rpc AnalyzeIntentResponse AnalyzeIntent(AnalyzeIntentRequest)
AnalyzeIntent accepts an input string and returns the most likely intent as well as slots relevant to that intent.
The model requires that a valid “domain” be passed in, and optionally supports including a previous intent classification result to provide context for the model.
- rpc TextTransformResponse PunctuateText(TextTransformRequest)
PunctuateText takes text with no- or limited- punctuation and returns the same text with corrected punctuation and capitalization.
- rpc NaturalQueryResponse NaturalQuery(NaturalQueryRequest)
NaturalQuery is a search function that enables querying one or more documents or contexts with a query that is written in natural language.
- rpc RivaNLPConfigResponse GetRivaNLPConfig(RivaNLPConfigRequest)
Enables clients to request the configuration of the current ASR service, or a specific model within the service.
-
message AnalyzeEntitiesOptions
AnalyzeEntitiesOptions is an optional configuration message to be sent as part of an AnalyzeEntitiesRequest with query metadata
-
string lang
Optional language field. Assumed to be “en-US” if not specified.
-
string lang
-
message AnalyzeEntitiesRequest
AnalyzeEntitiesRequest is the input message for the AnalyzeEntities service
-
string query
The string to analyze for intent and slots
-
AnalyzeEntitiesOptions options
Optional configuration for the request, including providing context from previous turns and hardcoding a domain/language
-
string query
-
message AnalyzeIntentContext
AnalyzeIntentContext is reserved for future use when we may send context back in a a variety of different formats (including raw neural network hidden states)
Reserved for future use
-
message AnalyzeIntentOptions
AnalyzeIntentOptions is an optional configuration message to be sent as part of an AnalyzeIntentRequest with query metadata
-
string previous_intent
-
AnalyzeIntentContext vectors
-
string domain
Optional domain field. Domain must be supported otherwise an error will be returned. If left blank, a domain detector will be run first and then the query routed to the appropriate intent classifier (if it exists)
-
string lang
Optional language field. Assumed to be “en-US” if not specified.
-
string previous_intent
-
message AnalyzeIntentRequest
AnalyzeIntentRequest is the input message for the AnalyzeIntent service
-
string query
The string to analyze for intent and slots
-
AnalyzeIntentOptions options
Optional configuration for the request, including providing context from previous turns and hardcoding a domain/language
-
string query
-
message AnalyzeIntentResponse
AnalyzeIntentResponse is returned by the AnalyzeIntent service, and includes information related to the query’s intent, (optionally) slot data, and its domain.
-
Classification intent
Intent classification result, including the label and score
-
TokenClassValue slots(repeated)
List of tokens explicitly marked as filling a slot relevant to the intent, where the tokens may not exactly match the input (based on the recombined values after tokenization)
-
string domain_str
Returns the inferred domain for the query if not hardcoded in the request. In the case where the domain was hardcoded in AnalyzeIntentRequest, the returned domain is an exact match to the request. In the case where no domain matches the query, intent and slots will be unset.
DEPRECATED, use Classification domain field.
-
Classification domain
Returns the inferred domain for the query if not hardcoded in the request. In the case where the domain was hardcoded in AnalyzeIntentRequest, the returned domain is an exact match to the request. In the case where no domain matches the query, intent and slots will be unset.
-
Classification intent
-
message Classification
Classification messages return a class name and corresponding score
-
string class_name
-
float score
-
string class_name
-
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)
-
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 specified, this takes preference over language_code.
-
string language_code
Specify language of the supplied text as a [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag. Defaults to “en-US” if not set.
-
string model_name
-
message NaturalQueryRequest
-
string query
The natural language query
-
uint32 top_n
Maximum number of answers to return for the query. Defaults to 1 if not set.
-
string context
Context to search with the above query
-
string query
-
message NaturalQueryResponse
-
NaturalQueryResult results(repeated)
-
NaturalQueryResult results(repeated)
-
message NaturalQueryResult
-
string answer
text which answers the query
-
float score
Score representing confidence in result
-
string answer
-
message RivaNLPConfigRequest
-
string model_name
If model is specified only return config for model, otherwise return all configs.
-
string model_name
-
message RivaNLPConfigResponse
- RivaNLPConfigResponse.Config model_config (repeated)
- message RivaNLPConfigResponse.Config
-
string model_name
- RivaNLPConfigResponse.Config.ParametersEntry parameters (repeated)
-
string model_name
- message RivaNLPConfigResponse.Config.ParametersEntry
-
string key
-
string value
-
string key
-
message Span
Span of a particular result
-
uint32 start
-
uint32 end
-
uint32 start
-
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
-
string text(repeated)
-
message TextClassResponse
TextClassResponse is the return message from the ClassifyText service.
-
ClassificationResult results(repeated)
-
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
-
string text(repeated)
-
message TextTransformResponse
TextTransformResponse is returned by the TransformText method. Responses are returned in the same order as they were requested.
-
string text(repeated)
-
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
-
string text(repeated)
-
message TokenClassResponse
TokenClassResponse returns a single TokenClassSequence per input request
-
TokenClassSequence results(repeated)
-
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)
-
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)
-
string token