tensorflow:: ops:: StringSplit
#include <string_ops.h> input要素をdelimiterに基づいて分割し、 SparseTensorを作成します。
まとめ
ソースのサイズをNとします(通常、Nはバッチサイズになります)。 inputの各要素をdelimiterに基づいて分割し、分割されたトークンを含むSparseTensorを返します。空のトークンは無視されます。
delimiter空文字列、または分割文字の文字列を指定できます。 delimiterが空文字列の場合、 inputの各要素は個別の1バイト文字列に分割されます(UTF-8マルチバイトシーケンスの分割も含まれます)。それ以外の場合は、 delimiterのすべての文字が分割ポイントとなる可能性があります。
例えば、N = 2、input[0]が「hello world」、input[1]が「ab c」の場合、出力は次のようになります。
インデックス = [0, 0; 0, 1; 1, 0; 1, 1; 1, 2] 形状 = [2, 3] 値 = ['hello', 'world', 'a', 'b', 'c']
議論:
- スコープ:スコープオブジェクト
- 入力:1次元文字列。分割対象。
- 区切り文字: 0-D。区切り文字(バイト)、または空文字列。
オプション属性( Attrs参照):
- skip_empty:
bool。TrueTrue場合、結果から空の文字列をスキップします。
返品:
-
Outputインデックス: スパーステンソルのインデックスを表すint64型の密行列。 -
Output値:分割された値に対応する文字列のベクトル。 -
Output形状:疎テンソルの形状を表す長さ2のint64型ベクトル。最初の値はN、2番目の値は単一の入力エントリ内のトークンの最大数です。
コンストラクターとデストラクタ | |
|---|---|
StringSplit (const :: tensorflow::Scope & scope, :: tensorflow::Input input, :: tensorflow::Input delimiter) | |
StringSplit (const :: tensorflow::Scope & scope, :: tensorflow::Input input, :: tensorflow::Input delimiter, const StringSplit::Attrs & attrs) |
公開属性 | |
|---|---|
indices | |
operation | |
shape | |
values | |
パブリック静的関数 | |
|---|---|
SkipEmpty (bool x) | |
構造 | |
|---|---|
| tensorflow:: ops:: StringSplit:: Attrs | StringSplitのオプション属性セッター。 |
公開属性
指数
::tensorflow::Output indices
手術
Operation operation
形
::tensorflow::Output shape
値
::tensorflow::Output values
公的機能
文字列分割
StringSplit( const ::tensorflow::Scope & scope, ::tensorflow::Input input, ::tensorflow::Input delimiter )
文字列分割
StringSplit( const ::tensorflow::Scope & scope, ::tensorflow::Input input, ::tensorflow::Input delimiter, const StringSplit::Attrs & attrs )
パブリック静的関数
スキップエンプティ
Attrs SkipEmpty( bool x )