텐서플로우:: 작전:: 문자열 분할

#include <string_ops.h>

delimiter 기반으로 input 요소를 SparseTensor 로 분할합니다.

요약

N을 소스의 크기로 설정합니다. 일반적으로 N은 배치 크기입니다. delimiter 기준으로 input 의 각 요소를 분할하고 분할된 토큰이 포함된 SparseTensor 를 반환합니다. 토큰은 무시됩니다.

delimiter 비어 있거나 분할된 문자열일 수 있습니다. delimiter 가 빈 문자열인 경우 input 의 각 요소는 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-D. 분할할 문자열입니다.
  • 구분 기호: 0-D. 구분 기호 문자(바이트) 또는 빈 문자열입니다.

선택적 속성( Attrs 참조):

  • Skip_empty: bool . True 인 경우 결과에서 빈 문자열을 건너뜁니다.

보고:

  • Output 인덱스: 희소 텐서의 인덱스를 나타내는 int64의 조밀한 행렬입니다.
  • Output 값: 분할된 값에 해당하는 문자열의 벡터입니다.
  • Output 형태: 희소 텐서의 형태를 나타내는 int64의 길이 2 벡터입니다. 여기서 첫 번째 값은 N이고 두 번째 값은 단일 입력 항목의 최대 토큰 수입니다.

생성자와 소멸자

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)

구조체

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