View source on GitHub |
A container for the input text tensor metadata information.
Inherits From: TensorMd
tflite_support.metadata_writers.metadata_info.InputTextTensorMd(
name: Optional[str] = None,
description: Optional[str] = None,
tokenizer_md: Optional[tflite_support.metadata_writers.metadata_info.RegexTokenizerMd
] = None
)
Args | |
---|---|
name
|
name of the tensor. |
description
|
description of what the tensor is. |
tokenizer_md
|
information of the tokenizer in the input text tensor, if
any. Only RegexTokenizer 1 is currenly supported. If the tokenizer
is BertTokenizer 2 or SentencePieceTokenizer 3, refer to
bert_nl_classifier.MetadataWriter .
|
Attributes | |
---|---|
tokenizer_md
|
information of the tokenizer in the input text tensor, if any. |
Methods
create_metadata
create_metadata() -> tflite_support.metadata_schema_py_generated.TensorMetadataT
Creates the input text metadata based on the information.
Returns | |
---|---|
A Flatbuffers Python object of the input text metadata. |
Raises | |
---|---|
ValueError
|
if the type of tokenizer_md is unsupported. |