Welcome to our Support Center

StringSplit

Description

StringSplit splits a string tensor’s elements into substrings based on a delimiter attribute and a maxsplit attribute.

 

 

The first output of this operator is a tensor of strings representing the substrings from splitting each input string on the delimiter substring. This tensor has one additional rank compared to the input tensor in order to store the substrings for each input element (where the input tensor is not empty). Note that, in order to ensure the same number of elements are present in the final dimension, this tensor will pad empty strings as illustrated in the examples below. Consecutive delimiters are not grouped together and are deemed to delimit empty strings, except if the delimiter is unspecified or is the empty string (“”). In the case where the delimiter is unspecified or the empty string, consecutive whitespace characters are regarded as a single separator and leading or trailing whitespace is removed in the output.

The second output tensor represents the number of substrings generated. maxsplit can be used to limit the number of splits performed – after the maxsplitth split if the string is not fully split, the trailing suffix of input string after the final split point is also added. For elements where fewer splits are possible than specified in maxsplit, it has no effect.

 

Input parameters

 

specified_outputs_namearray, this parameter lets you manually assign custom names to the output tensors of a node.
X (heterogeneous) – T1 : object, tensor of strings to split.

 Parameters : cluster,

delimiter : string, delimiter to split on. If left unset or set to the empty string (“”), the input is split on consecutive whitespace.
maxsplit : integer, maximum number of splits (from left to right). If left unset (or if the number of possible splits are less than maxsplit), it will make as many splits as possible. Note that the maximum possible number of substrings returned with maxsplit specified is maxsplit+1 since the remaining suffix after the maxsplitth split is included in the output.
Default value “0”.
 training? : boolean, whether the layer is in training mode (can store data for backward).
Default value “True”.
 lda coeff : float, defines the coefficient by which the loss derivative will be multiplied before being sent to the previous layer (since during the backward run we go backwards).
Default value “1”.

 name (optional) : string, name of the node.

Output parameters

 Graphs out : cluster, ONNX model architecture.

Y (heterogeneous) – T2 : object, tensor of substrings representing the outcome of splitting the strings in the input on the delimiter. Note that to ensure the same number of elements are present in the final rank, this tensor will pad any necessary empty strings.
Z (heterogeneous) – T3 : object, the number of substrings generated for each input element.

Type Constraints

T1 in (tensor(string)) : The input must be a UTF-8 string tensor

T2 in (tensor(string)) : Tensor of substrings.

T3 in (tensor(int64)) : The number of substrings generated.

Example

All these exemples are snippets PNG, you can drop these Snippet onto the block diagram and get the depicted code added to your VI (Do not forget to install Deep Learning library to run it).
Table of Contents