Udostępnij przez


BertTokenizer.CreateAsync Method

Definition

Overloads

CreateAsync(Stream, BertOptions, CancellationToken)

Create a new instance of the BertTokenizer class asynchronously.

CreateAsync(String, BertOptions, CancellationToken)

Create a new instance of the BertTokenizer class asynchronously.

CreateAsync(Stream, BertOptions, CancellationToken)

Source:
BertTokenizer.cs
Source:
BertTokenizer.cs
Source:
BertTokenizer.cs

Create a new instance of the BertTokenizer class asynchronously.

public static System.Threading.Tasks.Task<Microsoft.ML.Tokenizers.BertTokenizer> CreateAsync(System.IO.Stream vocabStream, Microsoft.ML.Tokenizers.BertOptions? options = default, System.Threading.CancellationToken cancellationToken = default);
static member CreateAsync : System.IO.Stream * Microsoft.ML.Tokenizers.BertOptions * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.ML.Tokenizers.BertTokenizer>
Public Shared Function CreateAsync (vocabStream As Stream, Optional options As BertOptions = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Task(Of BertTokenizer)

Parameters

vocabStream
Stream

The stream containing the vocabulary file.

options
BertOptions

The options to use for the Bert tokenizer.

cancellationToken
CancellationToken

The cancellation token.

Returns

A task that represents the asynchronous creation of the BertTokenizer.

Remarks

When creating the tokenizer, ensure that the vocabulary stream is sourced from a trusted provider.

Applies to

CreateAsync(String, BertOptions, CancellationToken)

Source:
BertTokenizer.cs
Source:
BertTokenizer.cs
Source:
BertTokenizer.cs

Create a new instance of the BertTokenizer class asynchronously.

public static System.Threading.Tasks.Task<Microsoft.ML.Tokenizers.BertTokenizer> CreateAsync(string vocabFilePath, Microsoft.ML.Tokenizers.BertOptions? options = default, System.Threading.CancellationToken cancellationToken = default);
static member CreateAsync : string * Microsoft.ML.Tokenizers.BertOptions * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.ML.Tokenizers.BertTokenizer>
Public Shared Function CreateAsync (vocabFilePath As String, Optional options As BertOptions = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Task(Of BertTokenizer)

Parameters

vocabFilePath
String

The path to the vocabulary file.

options
BertOptions

The options to use for the Bert tokenizer.

cancellationToken
CancellationToken

The cancellation token.

Returns

A task that represents the asynchronous creation of the BertTokenizer.

Remarks

When creating the tokenizer, ensure that the vocabulary file is sourced from a trusted provider.

Applies to