Langage

Tokenizer.EncodeToIds Méthode

Définition

Surcharges

Nom Description
EncodeToIds(String, Int32, String, Int32, Boolean, Boolean)

Encode le texte d’entrée vers les ID de jeton jusqu’au nombre maximal de jetons.

<param name="text">The text to encode.</param>
EncodeToIds(ReadOnlySpan<Char>, Int32, String, Int32, Boolean, Boolean)

Encode le texte d’entrée vers les ID de jeton jusqu’au nombre maximal de jetons.

EncodeToIds(String, ReadOnlySpan<Char>, EncodeSettings)

Encode le texte d’entrée vers les ID de jeton.

EncodeToIds(String, Boolean, Boolean)

Encode le texte d’entrée vers les ID de jeton.

EncodeToIds(ReadOnlySpan<Char>, Boolean, Boolean)

Encode le texte d’entrée vers les ID de jeton.

EncodeToIds(String, Int32, String, Int32, Boolean, Boolean)

Source:
Tokenizer.cs
Source:
Tokenizer.cs
Source:
Tokenizer.cs

Encode le texte d’entrée vers les ID de jeton jusqu’au nombre maximal de jetons.

<param name="text">The text to encode.</param>
public System.Collections.Generic.IReadOnlyList<int> EncodeToIds(string text, int maxTokenCount, out string? normalizedText, out int charsConsumed, bool considerPreTokenization = true, bool considerNormalization = true);
member this.EncodeToIds : string * int * string * int * bool * bool -> System.Collections.Generic.IReadOnlyList<int>
Public Function EncodeToIds (text As String, maxTokenCount As Integer, ByRef normalizedText As String, ByRef charsConsumed As Integer, Optional considerPreTokenization As Boolean = true, Optional considerNormalization As Boolean = true) As IReadOnlyList(Of Integer)

Paramètres

text
String
maxTokenCount
Int32

Nombre maximal de jetons à encoder.

normalizedText
String

Si la normalisation du tokenizer est activée ou <si le nom paramRef="considerNormalization"></paramRef est falsedéfini <sur paramRef> name="text"></paramRef> dans sa forme normalisée ; sinon, cette valeur est définie nullsur .

charsConsumed
Int32

Nombre de caractères du texte qui englobe les jetons encodés maximum.

considerPreTokenization
Boolean

Indiquez s’il faut envisager la pré-tokenisation avant la tokenisation.

considerNormalization
Boolean

Indiquez s’il faut envisager la normalisation avant la tokenisation.

Retours

Liste des ID encodés.

S’applique à

EncodeToIds(ReadOnlySpan<Char>, Int32, String, Int32, Boolean, Boolean)

Source:
Tokenizer.cs
Source:
Tokenizer.cs
Source:
Tokenizer.cs

Encode le texte d’entrée vers les ID de jeton jusqu’au nombre maximal de jetons.

public System.Collections.Generic.IReadOnlyList<int> EncodeToIds(ReadOnlySpan<char> text, int maxTokenCount, out string? normalizedText, out int charsConsumed, bool considerPreTokenization = true, bool considerNormalization = true);
member this.EncodeToIds : ReadOnlySpan<char> * int * string * int * bool * bool -> System.Collections.Generic.IReadOnlyList<int>
Public Function EncodeToIds (text As ReadOnlySpan(Of Char), maxTokenCount As Integer, ByRef normalizedText As String, ByRef charsConsumed As Integer, Optional considerPreTokenization As Boolean = true, Optional considerNormalization As Boolean = true) As IReadOnlyList(Of Integer)

Paramètres

text
ReadOnlySpan<Char>

Texte à encoder.

maxTokenCount
Int32

Nombre maximal de jetons à encoder.

normalizedText
String

Si la normalisation du tokenizer est activée ou <si le nom paramRef="considerNormalization"></paramRef est falsedéfini <sur paramRef> name="text"></paramRef> dans sa forme normalisée ; sinon, cette valeur est définie nullsur .

charsConsumed
Int32

Nombre de caractères du texte qui englobe les jetons encodés maximum.

considerPreTokenization
Boolean

Indiquez s’il faut envisager la pré-tokenisation avant la tokenisation.

considerNormalization
Boolean

Indiquez s’il faut envisager la normalisation avant la tokenisation.

Retours

Liste des ID encodés.

S’applique à

EncodeToIds(String, ReadOnlySpan<Char>, EncodeSettings)

Source:
Tokenizer.cs
Source:
Tokenizer.cs
Source:
Tokenizer.cs

Encode le texte d’entrée vers les ID de jeton.

protected virtual Microsoft.ML.Tokenizers.EncodeResults<int> EncodeToIds(string? text, ReadOnlySpan<char> textSpan, Microsoft.ML.Tokenizers.EncodeSettings settings);
abstract member EncodeToIds : string * ReadOnlySpan<char> * Microsoft.ML.Tokenizers.EncodeSettings -> Microsoft.ML.Tokenizers.EncodeResults<int>
override this.EncodeToIds : string * ReadOnlySpan<char> * Microsoft.ML.Tokenizers.EncodeSettings -> Microsoft.ML.Tokenizers.EncodeResults<int>
Protected Overridable Function EncodeToIds (text As String, textSpan As ReadOnlySpan(Of Char), settings As EncodeSettings) As EncodeResults(Of Integer)

Paramètres

text
String

Texte à encoder.

textSpan
ReadOnlySpan<Char>

Étendue du texte à encoder, qui sera utilisée si la valeur text est null.

settings
EncodeSettings

Paramètres utilisés pour encoder le texte.

Retours

Résultats encodés contenant la liste des ID encodés.

Remarques

Les types dérivés de Tokenizer cette implémentation peuvent remplacer cette implémentation pour fournir une implémentation plus efficace. Par défaut, il utilise EncodeToTokens(String, ReadOnlySpan<Char>, EncodeSettings).

S’applique à

EncodeToIds(String, Boolean, Boolean)

Source:
Tokenizer.cs
Source:
Tokenizer.cs
Source:
Tokenizer.cs

Encode le texte d’entrée vers les ID de jeton.

public System.Collections.Generic.IReadOnlyList<int> EncodeToIds(string text, bool considerPreTokenization = true, bool considerNormalization = true);
member this.EncodeToIds : string * bool * bool -> System.Collections.Generic.IReadOnlyList<int>
Public Function EncodeToIds (text As String, Optional considerPreTokenization As Boolean = true, Optional considerNormalization As Boolean = true) As IReadOnlyList(Of Integer)

Paramètres

text
String

Texte à encoder.

considerPreTokenization
Boolean

Indiquez s’il faut envisager la pré-tokenisation avant la tokenisation.

considerNormalization
Boolean

Indiquez s’il faut envisager la normalisation avant la tokenisation.

Retours

Liste des ID encodés.

S’applique à

EncodeToIds(ReadOnlySpan<Char>, Boolean, Boolean)

Source:
Tokenizer.cs
Source:
Tokenizer.cs
Source:
Tokenizer.cs

Encode le texte d’entrée vers les ID de jeton.

public System.Collections.Generic.IReadOnlyList<int> EncodeToIds(ReadOnlySpan<char> text, bool considerPreTokenization = true, bool considerNormalization = true);
member this.EncodeToIds : ReadOnlySpan<char> * bool * bool -> System.Collections.Generic.IReadOnlyList<int>
Public Function EncodeToIds (text As ReadOnlySpan(Of Char), Optional considerPreTokenization As Boolean = true, Optional considerNormalization As Boolean = true) As IReadOnlyList(Of Integer)

Paramètres

text
ReadOnlySpan<Char>

Texte à encoder.

considerPreTokenization
Boolean

Indiquez s’il faut envisager la pré-tokenisation avant la tokenisation.

considerNormalization
Boolean

Indiquez s’il faut envisager la normalisation avant la tokenisation.

Retours

Liste des ID encodés.

S’applique à