텍스트 분할
| 항목 | 값 |
|---|---|
| 화면 이름 | Text segmentation |
| 식별자 | textSegmentationV1 |
| 지원 실행 방식 | Batch, Faster, Streaming |
| 범주 | 문자열 (String) |
| 반환 자료형 | Array<String> |
슬라이딩 윈도 방식으로 일련의 텍스트 조각을 추출합니다.
입력 인자
| 이름 | 지정 여부 | 자료형 | 의미와 조건 |
|---|---|---|---|
Expression | 필수 | Expression<String> | 분할할 본문 텍스트입니다. |
Length | 필수 | Expression<Integer> | 텍스트 조각의 길이를 단어 수로 지정합니다. |
Overflow | 선택 | Expression<Integer> | 인접 조각 사이에 겹칠 수 있는 단어 수입니다. |
입출력 예시
예시 1: 기본 동작
짧은 텍스트를 분할하며 마지막 남은 부분도 별도 조각으로 만듭니다.
인자 값:
Expression:stringLength: 3Overflow: 1
| string | 출력 |
|---|---|
| hello world this is a test string | [ hello world this, this is a, a test string, string ] |
예시 2: 기본 동작
overflow가 음수인 경우입니다.
인자 값:
Expression:stringLength:lengthOverflow:overflow
| string | length | overflow | 출력 |
|---|---|---|---|
| She sells sea shells by | 2 | -1 | [ She sells, shells by ] |
예시 3: 기본 동작
overflow를 사용한 긴 텍스트에서 마지막 조각이 더 짧은 경우입니다.
인자 값:
Expression:stringLength:lengthOverflow:overflow
| string | length | overflow | 출력 |
|---|---|---|---|
| hello world this is a larger test with overlap, the nature of the human spirit is strange as such i ... | 10 | 3 | [ hello world this is a larger test with overlap, the, with overlap, the nature of the human spirit ... |
예시 4: 기본 동작
overflow가 0이고 마지막 조각이 목표 길이보다 짧은 경우입니다.
인자 값:
Expression:stringLength: 3Overflow: null
| string | 출력 |
|---|---|
| hello world this is a test string | [ hello world this, is a test, string ] |
예시 5: 기본 동작
overflow 없이 길이로 정확하게 나누어지는 경우입니다.
인자 값:
Expression:stringLength:lengthOverflow:overflow
| string | length | overflow | 출력 |
|---|---|---|---|
| hello world this is a test string without overlap | 3 | 0 | [ hello world this, is a test, string without overlap ] |
예시 6: null 처리
overflow 없이 길이로 정확하게 나누어지는 경우입니다.
인자 값:
Expression:stringLength:lengthOverflow:overflow
| string | length | overflow | 출력 |
|---|---|---|---|
| null | null | null | null |
예시 7: null 처리
overflow 없이 길이로 정확하게 나누어지는 경우입니다.
인자 값:
Expression:stringLength:lengthOverflow:overflow
| string | length | overflow | 출력 |
|---|---|---|---|
| null | 1 | null | null |
예시 8: null 처리
overflow 없이 길이로 정확하게 나누어지는 경우입니다.
인자 값:
Expression:stringLength:lengthOverflow:overflow
| string | length | overflow | 출력 |
|---|---|---|---|
| Hello world | null | null | null |
긴 구조값 안의 줄임표는 생략한 내용을 나타냅니다.