Langue

CodeGenTokenizer.EncodeToIds Méthode

Définition

Surcharges

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

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

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

Encode le texte d’entrée dans les ID de jetons.

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

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

EncodeToIds(String, ReadOnlySpan<Char>, EncodeSettings)

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

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

Encode le texte d’entrée dans les ID de jetons.

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

Source:
CodeGenTokenizer.cs
Source:
CodeGenTokenizer.cs
Source:
CodeGenTokenizer.cs

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

public System.Collections.Generic.IReadOnlyList<int> EncodeToIds(string text, int maxTokenCount, bool addPrefixSpace, bool addBeginningOfSentence, bool addEndOfSentence, out string? normalizedText, out int charsConsumed, bool considerPreTokenization = true, bool considerNormalization = true);
override this.EncodeToIds : string * int * bool * bool * bool * string * int * bool * bool -> System.Collections.Generic.IReadOnlyList<int>
Public Function EncodeToIds (text As String, maxTokenCount As Integer, addPrefixSpace As Boolean, addBeginningOfSentence As Boolean, addEndOfSentence As Boolean, 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

Texte à encoder.

maxTokenCount
Int32

Nombre maximal de jetons à encoder.

addPrefixSpace
Boolean

Indiquez s’il faut inclure un espace de début avant d’encoder le texte.

addBeginningOfSentence
Boolean

Indiquez s’il faut inclure le début du jeton de phrase dans l’encodage.

addEndOfSentence
Boolean

Indiquez s’il faut inclure la fin du jeton de phrase dans l’encodage.

normalizedText
String

Si la normalisation du tokenizer est activée, le texte d’entrée est représenté sous sa forme de normalisation ; sinon, il s’agit de null.

charsConsumed
Int32

Longueur 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, Boolean, Boolean, Boolean, Boolean, Boolean)

Source:
CodeGenTokenizer.cs
Source:
CodeGenTokenizer.cs
Source:
CodeGenTokenizer.cs

Encode le texte d’entrée dans les ID de jetons.

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

Paramètres

text
String

Texte à encoder.

addPrefixSpace
Boolean

Indiquez s’il faut inclure un espace de début avant d’encoder le texte.

addBeginningOfSentence
Boolean

Indiquez s’il faut inclure le début du jeton de phrase dans l’encodage.

addEndOfSentence
Boolean

Indiquez s’il faut inclure la fin du jeton de phrase dans l’encodage.

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, Boolean, Boolean, Boolean, String, Int32, Boolean, Boolean)

Source:
CodeGenTokenizer.cs
Source:
CodeGenTokenizer.cs
Source:
CodeGenTokenizer.cs

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

public System.Collections.Generic.IReadOnlyList<int> EncodeToIds(ReadOnlySpan<char> text, int maxTokenCount, bool addPrefixSpace, bool addBeginningOfSentence, bool addEndOfSentence, out string? normalizedText, out int charsConsumed, bool considerPreTokenization = true, bool considerNormalization = true);
override this.EncodeToIds : ReadOnlySpan<char> * int * bool * bool * bool * string * int * bool * bool -> System.Collections.Generic.IReadOnlyList<int>
Public Function EncodeToIds (text As ReadOnlySpan(Of Char), maxTokenCount As Integer, addPrefixSpace As Boolean, addBeginningOfSentence As Boolean, addEndOfSentence As Boolean, 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.

addPrefixSpace
Boolean

Indiquez s’il faut inclure un espace de début avant d’encoder le texte.

addBeginningOfSentence
Boolean

Indiquez s’il faut inclure le début du jeton de phrase dans l’encodage.

addEndOfSentence
Boolean

Indiquez s’il faut inclure la fin du jeton de phrase dans l’encodage.

normalizedText
String

Si la normalisation du tokenizer est activée, le texte d’entrée est représenté sous sa forme de normalisation ; sinon, il s’agit de null.

charsConsumed
Int32

Longueur 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:
CodeGenTokenizer.cs
Source:
CodeGenTokenizer.cs
Source:
CodeGenTokenizer.cs

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

protected override Microsoft.ML.Tokenizers.EncodeResults<int> EncodeToIds(string? text, ReadOnlySpan<char> textSpan, Microsoft.ML.Tokenizers.EncodeSettings settings);
override this.EncodeToIds : string * ReadOnlySpan<char> * Microsoft.ML.Tokenizers.EncodeSettings -> Microsoft.ML.Tokenizers.EncodeResults<int>
Protected Overrides 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.

S’applique à

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

Source:
CodeGenTokenizer.cs
Source:
CodeGenTokenizer.cs
Source:
CodeGenTokenizer.cs

Encode le texte d’entrée dans les ID de jetons.

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

Paramètres

text
ReadOnlySpan<Char>

Texte à encoder.

addPrefixSpace
Boolean

Indiquez s’il faut inclure un espace de début avant d’encoder le texte.

addBeginningOfSentence
Boolean

Indiquez s’il faut inclure le début du jeton de phrase dans l’encodage.

addEndOfSentence
Boolean

Indiquez s’il faut inclure la fin du jeton de phrase dans l’encodage.

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 à