Description Usage Arguments Details
The input to this feature column is a batch of multiple strings with arbitrary size, assuming the input is a SparseTensor.
1 2 3 4 5 6 7 | hub_sparse_text_embedding_column(
key,
module_spec,
combiner,
default_value,
trainable = FALSE
)
|
key |
A string or [feature_column](https://tensorflow.rstudio.com/tfestimators/articles/feature_columns.html) identifying the text feature. |
module_spec |
A string handle or a _ModuleSpec identifying the module. |
combiner |
a string specifying reducing op for embeddings in the same Example. Currently, 'mean', 'sqrtn', 'sum' are supported. Using 'combiner = NULL' is undefined. |
default_value |
default value for Examples where the text feature is empty. Note, it's recommended to have default_value consistent OOV tokens, in case there was special handling of OOV in the text module. If 'NULL', the text feature is assumed be non-empty for each Example. |
trainable |
Whether or not the Module is trainable. 'FALSE' by default, meaning the pre-trained weights are frozen. This is different from the ordinary 'tf.feature_column.embedding_column()', but that one is intended for training from scratch. |
This type of feature column is typically suited for modules that operate on pre-tokenized text to produce token level embeddings which are combined with the combiner into a text embedding. The combiner always treats the tokens as a bag of words rather than a sequence.
The output (i.e., transformed input layer) is a DenseTensor, with shape [batch_size, num_embedding_dim].
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.