注: 以下の翻訳の正確性は検証されていません。AIPを利用して英語版の原文から機械的に翻訳されたものです。

テキストセグメンテーション

サポート対象: バッチ、ストリーミング

スライディングウィンドウセグメンテーションを使用して一連のテキストセグメントを抽出します。

式カテゴリ: 文字列

引数

  • - セグメント化されるテキストの本文。
    Expression<String>
  • 長さ - テキストを分割するセグメントの単語数。
    Expression<Integer>
  • オプション オーバーフロー - セグメントが他のセグメントと共有できる単語数。
    Expression<Integer>

出力タイプ: Array<String>

例 1: 基本ケース

説明: このテストは、小さなテキストセットを適切にセグメント化するトランスフォームの能力を示しています。最後は独自のセグメントになります。 引数値:

  • : string
  • 長さ: 3
  • オーバーフロー: 1
string出力
hello world this is a test string[ hello world this, this is a, a test string, string ]

例 2: 基本ケース

説明: 負のオーバーフローを持つテスト。 引数値:

  • : string
  • 長さ: length
  • オーバーフロー: overflow
stringlengthoverflow出力
She sells sea shells by2-1[ She sells, shells by ]

例 3: 基本ケース

説明: オーバーフローと最後に小さなセグメントがある大きなテスト。 引数値:

  • : string
  • 長さ: length
  • オーバーフロー: overflow
stringlengthoverflow出力
hello world this is a larger test with overlap, the nature of the human spirit is strange as such i ...103[ hello world this is a larger test with overlap, the, with overlap, the nature of the human spirit ...

例 4: 基本ケース

説明: オーバーフローが 0 に設定されており、最後のセグメントが完全な長さよりも小さい文字列をテストします。 引数値:

  • : string
  • 長さ: 3
  • オーバーフロー: null
string出力
hello world this is a test string[ hello world this, is a test, string ]

例 5: 基本ケース

説明: セグメントが長さによって完全に分割されるオーバーフローなしのテスト。 引数値:

  • : string
  • 長さ: length
  • オーバーフロー: overflow
stringlengthoverflow出力
hello world this is a test string without overlap30[ hello world this, is a test, string without overlap ]

例 6: Null ケース

説明: セグメントが長さによって完全に分割されるオーバーフローなしのテスト。 引数値:

  • : string
  • 長さ: length
  • オーバーフロー: overflow
stringlengthoverflow出力
nullnullnullnull

例 7: Null ケース

説明: セグメントが長さによって完全に分割されるオーバーフローなしのテスト。 引数値:

  • : string
  • 長さ: length
  • オーバーフロー: overflow
stringlengthoverflow出力
null1nullnull

例 8: Null ケース

説明: セグメントが長さによって完全に分割されるオーバーフローなしのテスト。 引数値:

  • : string
  • 長さ: length
  • オーバーフロー: overflow
stringlengthoverflow出力
Hello worldnullnullnull