テンソルフロー::作戦::文字列分割V2

#include <string_ops.h>

sepに基づいてsourceの要素をSparseTensorに分割します。

まとめ

N をソースのサイズとします (通常、N はバッチ サイズになります)。 sepに基づいてsourceの各要素を分割し、分割トークンを含むSparseTensorを返します。空のトークンは無視されます。

たとえば、N = 2、source[0] が「hello world」、source[1] が「ab c」の場合、出力は

st.indices = [0, 0;
              0, 1;
              1, 0;
              1, 1;
              1, 2]
st.shape = [2, 3]
st.values = ['hello', 'world', 'a', 'b', 'c']
になります。

sepが指定された場合、連続する区切り文字はグループ化されず、空の文字列を区切るものとみなされます。たとえば、 "1\<\>2\<\>\<\>3"のソースと"\<\>"の sep ["1", "2", "", "3"]を返します。 sepが None または空の文字列の場合、連続する空白は単一の区切り文字とみなされ、文字列の先頭または末尾に空白がある場合、結果には先頭または末尾に空の文字列が含まれません。

上記の動作は Python の str.split と一致することに注意してください。

引数:

  • スコープ:スコープオブジェクト
  • 入力: 1-D文字列Tensor 、分割する文字列。
  • sep: 0-D文字列Tensor 、区切り文字。

オプションの属性 ( Attrsを参照):

  • maxsplit: intmaxsplit > 0の場合、結果の分割の制限。

戻り値:

コンストラクターとデストラクター

StringSplitV2 (const :: tensorflow::Scope & scope, :: tensorflow::Input input, :: tensorflow::Input sep)
StringSplitV2 (const :: tensorflow::Scope & scope, :: tensorflow::Input input, :: tensorflow::Input sep, const StringSplitV2::Attrs & attrs)

パブリック属性

indices
operation
shape
values

パブリック静的関数

Maxsplit (int64 x)

構造体

tensorflow:: ops:: StringSplitV2:: Attrs

StringSplitV2のオプションの属性セッター。

パブリック属性

インデックス

::tensorflow::Output indices

手術

Operation operation

::tensorflow::Output shape

価値観

::tensorflow::Output values

公共機能

文字列分割V2

 StringSplitV2(
  const ::tensorflow::Scope & scope,
  ::tensorflow::Input input,
  ::tensorflow::Input sep
)

文字列分割V2

 StringSplitV2(
  const ::tensorflow::Scope & scope,
  ::tensorflow::Input input,
  ::tensorflow::Input sep,
  const StringSplitV2::Attrs & attrs
)

パブリック静的関数

マックススプリット

Attrs Maxsplit(
  int64 x
)