tf.raw_ops.StringNGrams

Creates ngrams from ragged string data.

This op accepts a ragged tensor with 1 ragged dimension containing only strings and outputs a ragged tensor with 1 ragged dimension containing ngrams of that string, joined along the innermost axis.

dataA Tensor of type string. The values tensor of the ragged string tensor to make ngrams out of. Must be a 1D string tensor.
data_splitsA Tensor. Must be one of the following types: int32, int64. The splits tensor of the ragged string tensor to make ngrams out of.
separatorA string. The string to append between elements of the token. Use "" for no separator.
ngram_widthsA list of ints. The sizes of the ngrams to create.
left_padA string. The string to use to pad the left side of the ngram sequence. Only used if pad_width != 0.
right_padA string. The string to use to pad the right side of the ngram sequence. Only used if pad_width != 0.
pad_widthAn int. The number of padding elements to add to each side of each sequence. Note that padding will never be greater than 'ngram_widths'-1 regardless of this value. If pad_width=-1, then add max(ngram_widths)-1 elements.
preserve_short_sequencesA bool.
nameA name for the operation (optional).

A tuple of Tensor objects (ngrams, ngrams_splits).
ngramsA Tensor of type string.
ngrams_splitsA Tensor. Has the same type as data_splits.