The result of running fastText language identification on a piece of text.
Fields
languageis the BCP-47 language subtag fastText reports — typically a two-letter ISO 639-1 code ("en","fr","zh"), occasionally three-letter ISO 639-3 ("als","yue").confidenceis the probability fastText assigns to the top-1 label, in[0.0, 1.0].scriptis the dominant Unicode script of the input as detected byText.Language.Classifier.Fasttext.ScriptDetector. One of the script atoms documented there.alternativesis the rest of the top-K predictions (excluding the top-1), each a{language, probability}pair. May be empty whenk == 1was requested.textis the original input. Kept on the struct so a downstreamText.Language.Classifier.Fasttext.Locale.resolve/2call can use it to disambiguate Hans/Hant or other script-derived locale information.
Summary
Types
@type t() :: %Text.Language.Classifier.Fasttext.Detection{ alternatives: [alternative()], confidence: float(), language: String.t(), script: Text.Language.Classifier.Fasttext.ScriptDetector.script(), text: String.t() }