텐서플로우:: ops:: StringSplitV2

#include <string_ops.h>

sep 기준으로 source 의 요소를 SparseTensor 로 분할합니다.

요약

소스 데이터의 크기를 N이라고 합시다(일반적으로 N은 배치 크기입니다). source 의 각 요소를 sep 기준으로 분할하고, 분할된 토큰들을 포함하는 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이거나 빈 문자열인 경우, 연속된 공백은 하나의 구분자로 간주되며, 문자열의 시작이나 끝에 공백이 있는 경우 결과에는 시작이나 끝에 빈 문자열이 포함되지 않습니다.

위에서 언급한 동작은 파이썬의 `str.split`과 동일하다는 점에 유의하십시오.

논거:

  • 범위: Scope 객체
  • 입력: 1-D 문자열 Tensor , 분할할 문자열.
  • sep: 0-D 문자열 Tensor , 구분자 문자.

선택적 속성( Attrs 참조):

  • maxsplit: int . maxsplit > 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)

구조

텐서플로우:: 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
)