AI-generated Key Takeaways
-
LanguageIdentificationOptionsallows customization of language identification processes within ML Kit. -
The main parameter is
confidenceThreshold, dictating the minimum confidence level for language identification results. -
A higher
confidenceThresholdleads to more precise results but might miss some potential languages. -
Use the designated initializer
init(confidenceThreshold:)to create an instance ofLanguageIdentificationOptionswith your desired confidence level.
LanguageIdentificationOptions
class LanguageIdentificationOptions : NSObjectOptions for LanguageIdentification.
-
The confidence threshold for language identification. The identified languages will have a confidence higher or equal to the confidence threshold. The value should be between 0 and 1. If an invalid value is set, the default value is used instead. The default value for identifying the main language is
DefaultIdentifyLanguageConfidenceThresholdand for identifying possible languages isDefaultIdentifyPossibleLanguagesConfidenceThreshold.Declaration
Swift
var confidenceThreshold: Float { get } -
Creates a new instance of language identification options with the given confidence threshold.
Declaration
Swift
init(confidenceThreshold: Float)Parameters
confidenceThresholdThe confidence threshold for language identification.
Return Value
A new instance of
LanguageIdentificationOptionswith the given confidence threshold. -
Unavailable. Use
init(confidenceThreshold:)instead.