init(locale:identifier:version:builder:)
Constructs a data container using a builder
Declaration
convenience init(locale: Locale, identifier: String, version: String, @SFCustomLanguageModelData.DataInsertableBuilder builder: () -> any DataInsertable)Parameters
- locale:
The region and language of the training data (must match with the locale used to construct the
SFSpeechRecognizerlater) - identifier:
Used to uniquely identify the resulting language model on the device where it will be processed
- version:
Used to distinguish different versions of the language model on the device where it will be processed
- builder:
A DataInsertableBuilder object that yields DataInsertable objects
Discussion
The SFCustomLanguageModelData class accumulates language model training and custom vocabulary data, both associated with a specified locale. This initializer creates an object that is initially populated using the provided builder.