CodeGenTokenizer.GetIndexByTokenCountFromEnd メソッド
定義
重要
一部の情報は、リリース前に大きく変更される可能性があるプレリリースされた製品に関するものです。 Microsoft は、ここに記載されている情報について、明示または黙示を問わず、一切保証しません。
オーバーロード
| 名前 | 説明 |
|---|---|
| GetIndexByTokenCountFromEnd(ReadOnlySpan<Char>, Int32, Boolean, Boolean, Boolean, String, Int32, Boolean, Boolean) |
トークンの制限を超えずに、テキスト内の末尾から最大エンコード容量のインデックスを検索します。 |
| GetIndexByTokenCountFromEnd(String, Int32, Boolean, Boolean, Boolean, String, Int32, Boolean, Boolean) |
トークンの制限を超えずに、テキスト内の末尾から最大エンコード容量のインデックスを検索します。 |
GetIndexByTokenCountFromEnd(ReadOnlySpan<Char>, Int32, Boolean, Boolean, Boolean, String, Int32, Boolean, Boolean)
トークンの制限を超えずに、テキスト内の末尾から最大エンコード容量のインデックスを検索します。
public int GetIndexByTokenCountFromEnd(ReadOnlySpan<char> text, int maxTokenCount, bool addPrefixSpace, bool addBeginningOfSentence, bool addEndOfSentence, out string? normalizedText, out int tokenCount, bool considerPreTokenization = true, bool considerNormalization = true);
override this.GetIndexByTokenCountFromEnd : ReadOnlySpan<char> * int * bool * bool * bool * string * int * bool * bool -> int
Public Function GetIndexByTokenCountFromEnd (text As ReadOnlySpan(Of Char), maxTokenCount As Integer, addPrefixSpace As Boolean, addBeginningOfSentence As Boolean, addEndOfSentence As Boolean, ByRef normalizedText As String, ByRef tokenCount As Integer, Optional considerPreTokenization As Boolean = true, Optional considerNormalization As Boolean = true) As Integer
パラメーター
- text
- ReadOnlySpan<Char>
エンコードするテキスト。
- maxTokenCount
- Int32
エンコード容量を制限する最大トークン数。
- addPrefixSpace
- Boolean
テキストをエンコードする前に先頭のスペースを含めるかどうかを示します。
- addBeginningOfSentence
- Boolean
エンコードに文トークンの先頭を含めるかどうかを示します。
- addEndOfSentence
- Boolean
エンコードに文末トークンを含めるかどうかを示します。
- normalizedText
- String
トークナイザーの正規化が有効になっている場合、入力テキストは正規化形式で表されます。それ以外の場合は null になります。
- tokenCount
- Int32
トークン数は、最大トークン数よりも小さくする必要がある生成できます。
- considerPreTokenization
- Boolean
トークン化の前に事前トークン化を検討するかどうかを示します。
- considerNormalization
- Boolean
トークン化の前に正規化を検討するかどうかを示します。
返品
トークンの制限を超えずに処理されたテキスト内の最大エンコード容量の開始インデックス。
これは、含める最初の文字のインデックスを表します。 トークンが適合しない場合、結果は normalizedTextの長さになります。逆に、すべてのトークンが適合する場合、結果は 0 になります。
注釈
トークンの制限内でテキスト全体をエンコードできる場合、返されるインデックスは 0 になります。
適用対象
GetIndexByTokenCountFromEnd(String, Int32, Boolean, Boolean, Boolean, String, Int32, Boolean, Boolean)
トークンの制限を超えずに、テキスト内の末尾から最大エンコード容量のインデックスを検索します。
public int GetIndexByTokenCountFromEnd(string text, int maxTokenCount, bool addPrefixSpace, bool addBeginningOfSentence, bool addEndOfSentence, out string? normalizedText, out int tokenCount, bool considerPreTokenization = true, bool considerNormalization = true);
override this.GetIndexByTokenCountFromEnd : string * int * bool * bool * bool * string * int * bool * bool -> int
Public Function GetIndexByTokenCountFromEnd (text As String, maxTokenCount As Integer, addPrefixSpace As Boolean, addBeginningOfSentence As Boolean, addEndOfSentence As Boolean, ByRef normalizedText As String, ByRef tokenCount As Integer, Optional considerPreTokenization As Boolean = true, Optional considerNormalization As Boolean = true) As Integer
パラメーター
- text
- String
エンコードするテキスト。
- maxTokenCount
- Int32
エンコード容量を制限する最大トークン数。
- addPrefixSpace
- Boolean
テキストをエンコードする前に先頭のスペースを含めるかどうかを示します。
- addBeginningOfSentence
- Boolean
エンコードに文トークンの先頭を含めるかどうかを示します。
- addEndOfSentence
- Boolean
エンコードに文末トークンを含めるかどうかを示します。
- normalizedText
- String
トークナイザーの正規化が有効になっている場合、入力テキストは正規化形式で表されます。それ以外の場合は null になります。
- tokenCount
- Int32
トークン数は、最大トークン数よりも小さくする必要がある生成できます。
- considerPreTokenization
- Boolean
トークン化の前に事前トークン化を検討するかどうかを示します。
- considerNormalization
- Boolean
トークン化の前に正規化を検討するかどうかを示します。
返品
トークンの制限を超えずに処理されたテキスト内の最大エンコード容量の開始インデックス。
これは、含める最初の文字のインデックスを表します。 トークンが適合しない場合、結果はテキストの長さになります。正規化が有効な場合は normalizedText になります。逆に、すべてのトークンが適合する場合、結果は 0 になります。
注釈
トークンの制限内でテキスト全体をエンコードできる場合、返されるインデックスは 0 になります。