View source on GitHub |
The export module for the sentence prediction task.
Inherits From: ExportModule
tfm.nlp.serving_modules.SentencePrediction(
params, model: tf.keras.Model, inference_step=None
)
Child Classes
Methods
get_inference_signatures
get_inference_signatures(
function_keys: Dict[Text, Text]
)
Get defined function signatures.
serve
@tf.function
serve( input_word_ids, input_mask=None, input_type_ids=None ) -> Dict[str, tf.Tensor]
serve_examples
@tf.function
serve_examples( inputs ) -> Dict[str, tf.Tensor]
serve_probability
@tf.function
serve_probability( input_word_ids, input_mask=None, input_type_ids=None ) -> Dict[str, tf.Tensor]
serve_text_examples
@tf.function
serve_text_examples( inputs ) -> Dict[str, tf.Tensor]