Non-autoregressive System 1 decision engine. Typed choice, score and yes/no decisions over any text in a single forward pass, in 100+ languages, with a router that picks the right checkpoint per request.
Python calibrationclassificationdecision-modelhuggingfacejevmodernbertmultilingualnlppythonpytorchroutingtyped-decisionszero-shot
// Code generated by laya-go/scripts/gen_tables.py --lang cpp from laya/lang.py; DO NOT EDIT.
//
// Regenerate with: python laya-go/scripts/gen_tables.py --lang cpp
inline constexpr const char* k_script_names[] = {"greek", "cyrillic", "armenian", "hebrew", "arabic", "devanagari", "bengali", "gurmukhi", "gujarati", "oriya", "tamil", "telugu", "kannada", "malayalam", "sinhala", "thai", "lao", "tibetan", "myanmar", "georgian", "ethiopic", "khmer", "hangul", "kana", "han"};
inline constexpr uint32_t k_script_lookup[] = {
880, 1023, 1024, 1327, 1328, 1423, 1424, 1535, 1536, 1791, 1872, 1919, 2208, 2303, 2304, 2431,
2432, 2559, 2560, 2687, 2688, 2815, 2816, 2943, 2944, 3071, 3072, 3199, 3200, 3327, 3328, 3455,
3456, 3583, 3584, 3711, 3712, 3839, 3840, 4095, 4096, 4255, 4256, 4351, 4352, 4607, 4608, 4991,
6016, 6143, 7936, 8191, 11744, 11775, 12352, 12447, 12448, 12543, 12592, 12687, 12784, 12799,
13312, 19903, 19968, 40959, 42560, 42655, 43232, 43263, 44032, 55215, 63744, 64255, 64336,
65023, 65136, 65279,
};
inline constexpr uint8_t k_script_lookup_index[] = {
0, 1, 2, 3, 4, 4, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 22, 20, 21, 0, 1,
23, 23, 22, 23, 24, 24, 1, 5, 22, 24, 4, 4,
};
inline constexpr uint32_t k_script_max_code_point = 0xfeff;
inline constexpr const char* k_stop_0[] = {
"after", "already", "always", "and", "any", "are", "aren", "as", "at", "be", "because", "been",
"before", "being", "between", "both", "but", "can", "could", "couldn", "didn", "didnt", "does",
"doesn", "doesnt", "doing", "done", "dont", "down", "during", "each", "ever", "every", "few",
"for", "from", "has", "hasn", "have", "haven", "havent", "here", "him", "his", "how", "i",
"if", "in", "into", "is", "isn", "isnt", "it", "ive", "many", "might", "much", "must", "never",
"nor", "not", "of", "on", "only", "onto", "our", "please", "shall", "she", "should", "some",
"than", "that", "thats", "the", "their", "them", "then", "there", "these", "they", "this",
"those", "through", "to", "too", "until", "very", "was", "wasn", "wasnt", "we", "were",
"weren", "what", "whats", "when", "where", "which", "while", "who", "whom", "why", "will",
"with", "within", "without", "won", "wont", "would", "wouldn", "yet", "you", "your", "youre",
"yours",
};
inline constexpr const char* k_stop_1[] = {
"alors", "au", "aux", "avec", "bien", "bonjour", "ce", "ces", "cette", "comment", "dans",
"des", "deux", "dois", "doit", "donc", "du", "elle", "elles", "est", "et", "fait", "fois",
"il", "ils", "je", "jour", "jours", "la", "le", "les", "ma", "mais", "merci", "mes", "mois",
"mon", "nous", "ont", "ou", "pas", "peut", "peux", "plus", "pour", "pourquoi", "quand", "que",
"qui", "sa", "ses", "sont", "sur", "ta", "tes", "ton", "tous", "tout", "toute", "trois",
"très", "tu", "une", "veut", "veux", "vous", "être",
};
inline constexpr const char* k_stop_2[] = {
"aber", "auch", "auf", "aus", "bei", "bitte", "das", "dem", "den", "der", "dich", "die",
"diese", "diesen", "dieser", "dieses", "dir", "ein", "eine", "einem", "einen", "einer", "für",
"gibt", "habe", "haben", "heute", "ich", "im", "in", "ist", "jetzt", "kann", "kannst", "mein",
"meine", "meinem", "meinen", "meiner", "mich", "mir", "mit", "nach", "nicht", "noch", "oder",
"sich", "sind", "und", "uns", "von", "wann", "was", "welche", "werden", "wie", "wir", "wird",
"wo", "wurde", "zu", "zum", "zur",
};
inline constexpr const char* k_stop_3[] = {
"al", "algo", "aquí", "aunque", "como", "con", "cuando", "del", "donde", "dos", "el", "entre",
"es", "esa", "ese", "eso", "esta", "este", "esto", "está", "fue", "fueron", "gracias", "han",
"hay", "hemos", "hoy", "la", "las", "le", "les", "lo", "los", "mi", "muy", "más", "nada",
"necesito", "ni", "nos", "para", "pero", "por", "porque", "puede", "pueden", "que", "quiero",
"se", "ser", "sobre", "son", "su", "sus", "también", "tengo", "tiene", "tienen", "todo",
"tres", "tu", "un", "una", "y", "ya",
};
inline constexpr const char* k_stop_4[] = {
"agora", "ainda", "alguem", "alguém", "ali", "antes", "ao", "aos", "aqui", "as", "até", "boa",
"cadê", "com", "como", "consigo", "da", "das", "depois", "deu", "do", "dois", "dos", "e", "em",
"entao", "então", "era", "esta", "estamos", "estava", "este", "estou", "está", "eu", "ficou",
"fiz", "foi", "gostaria", "hoje", "isso", "isto", "ja", "já", "mais", "mas", "meu", "meus",
"minha", "minhas", "muito", "na", "nada", "nao", "nas", "nenhum", "nenhuma", "ninguem",
"ninguém", "noite", "nos", "nossa", "nosso", "não", "o", "obrigada", "obrigado", "olá", "onde",
"ontem", "os", "para", "pela", "pelo", "pode", "podem", "por", "porque", "pra", "preciso",
"quando", "que", "quero", "sao", "se", "ser", "seu", "sou", "sua", "são", "tambem", "também",
"tarde", "tem", "tenho", "três", "tudo", "tá", "um", "uma", "vc", "vcs", "voce", "voces",
"você", "vocês", "é",
};
inline constexpr const char* k_stop_5[] = {
"abbiamo", "adesso", "agli", "alla", "alle", "anche", "ancora", "avete", "che", "ci", "ciao",
"col", "come", "con", "da", "dagli", "dal", "dalla", "dallo", "degli", "dei", "del", "della",
"delle", "dello", "deve", "devo", "devono", "di", "dove", "e", "ed", "era", "fra", "già",
"gli", "grazie", "ha", "hai", "hanno", "ho", "ieri", "il", "la", "le", "lo", "mai", "mi",
"mia", "mio", "molto", "ne", "negli", "nel", "nell", "nella", "non", "o", "oggi", "per",
"perche", "più", "poco", "quando", "questa", "questo", "scusa", "sempre", "si", "sono",
"stata", "stato", "su", "sua", "sul", "sulla", "sulle", "tra", "tuo", "un", "una", "uno",
"voglio", "vorrei", "è",
};
inline constexpr const char* k_stop_6[] = {
"aan", "dat", "deze", "door", "een", "het", "is", "maar", "met", "naar", "niet", "ook", "op",
"te", "van", "voor", "worden", "wordt", "zijn",
};
inline constexpr const char* k_stop_7[] = {
"appen", "aterbetala", "aterbetalning", "att", "behover", "behöver", "blivit", "debiterade",
"dessa", "detta", "faktura", "fel", "från", "får", "ganger", "gång", "gånger", "gör", "göra",
"hittar", "hjalp", "hjalpa", "hjälp", "hjälpa", "här", "installningarna", "installningen",
"inställningarna", "inställningen", "inte", "jag", "kommer", "kraschar", "kvittot", "losenord",
"lösenord", "mig", "min", "mitt", "måste", "nar", "när", "nästa", "och", "också", "om",
"oppnar", "paket", "ska", "skicka", "skulle", "sparningen", "spårningen", "säger", "till",
"tva", "två", "upp", "uppdaterats", "utan", "vi", "vill", "är", "återbetala", "återbetalning",
"öppnar",
};
inline constexpr const char* k_stop_8[] = {
"aceasta", "această", "acest", "acesta", "acum", "ale", "care", "dar", "din", "după", "este",
"foarte", "fost", "fără", "lui", "mi", "nu", "pentru", "până", "sunt", "să", "trebuie",
"vreau", "vă", "în", "și", "ți",
};
inline constexpr const char* k_stop_9[] = {
"abar", "ajke", "akhon", "amader", "amake", "amar", "ami", "amra", "apnake", "apnar", "apnara",
"apni", "ar", "asbe", "bhai", "bhalo", "bolte", "bolun", "chai", "chaina", "dhonnobad",
"dilam", "dite", "diye", "diyechi", "dorkar", "duibar", "ei", "eita", "ekbar", "ekhon",
"ekhono", "ekta", "ferot", "geche", "gese", "hobe", "hocche", "hoise", "hoye", "hoyeche",
"hoyni", "jabe", "jodi", "jonno", "kalke", "keno", "keu", "kharap", "khub", "ki", "kibhabe",
"kichu", "kintu", "kivabe", "kobe", "kokhon", "korbo", "korchi", "kore", "koreche", "korechi",
"koren", "korlam", "korsi", "korte", "korun", "kothay", "koto", "lagbe", "moddhe", "nai",
"niye", "oi", "oita", "onek", "ota", "pabo", "paini", "parben", "parbo", "parchi", "parchina",
"peyechi", "sathe", "shathe", "shob", "shomossa", "somossa", "tader", "tahole", "taka",
"theke", "tomake", "tomar", "tomra", "tumi", "valo",
};
inline constexpr const char* k_stop_10[] = {
"amma", "ancaq", "artiq", "artıq", "bir", "biz", "bu", "cox", "daha", "deyil", "də", "eger",
"görə", "həm", "hər", "ile", "ilə", "isə", "kimi", "lakin", "mən", "nə", "olan", "olmasa",
"olub", "onlar", "siz", "sonra", "sən", "ucun", "var", "ve", "və", "yalniz", "yalnız", "yox",
"yoxdur", "çox", "üçün", "əgər",
};
struct StopSpec { const char* code; const char* const* words; size_t count; };
// In lang.py declaration order: the language that wins a tied score is the first listed.
inline constexpr StopSpec k_stop_lists[] = {
{"en", k_stop_0, 116},
{"fr", k_stop_1, 67},
{"de", k_stop_2, 63},
{"es", k_stop_3, 65},
{"pt", k_stop_4, 107},
{"it", k_stop_5, 85},
{"nl", k_stop_6, 19},
{"sv", k_stop_7, 66},
{"ro", k_stop_8, 27},
{"bn", k_stop_9, 98},
{"az", k_stop_10, 40},
};
inline constexpr const char* k_short_swedish[] = {
"abonnemanget", "aterbetalning", "atkomst", "behover", "behöver", "betalningen", "fakturan",
"felmeddelande", "glomt", "glömt", "inloggningen", "installningen", "inställningen", "kvitto",
"kvittot", "losenord", "lösenord", "sparningen", "spårningen", "återbetalning", "åtkomst",
};
inline constexpr const char* k_shared[] = {
"as", "como", "con", "da", "das", "del", "dois", "dos", "e", "era", "esta", "este", "está",
"får", "hej", "il", "in", "is", "ja", "jo", "kommer", "la", "le", "les", "lo", "mais", "mi",
"mig", "min", "nada", "nej", "nos", "o", "om", "para", "por", "porque", "quando", "que", "se",
"ser", "skulle", "su", "sua", "tack", "tu", "un", "una", "vi", "was",
};
inline constexpr const char* k_nordic_overlap[] = {
"får", "hej", "ja", "jo", "kommer", "mig", "min", "nej", "om", "skulle", "tack", "vi",
};
inline constexpr const char* k_en_only[] = {
"after", "already", "always", "and", "any", "are", "aren", "at", "be", "because", "been",
"before", "being", "between", "both", "but", "can", "could", "couldn", "didn", "didnt", "does",
"doesn", "doesnt", "doing", "done", "dont", "down", "during", "each", "ever", "every", "few",
"for", "from", "has", "hasn", "have", "haven", "havent", "here", "him", "his", "how", "i",
"if", "into", "isn", "isnt", "it", "ive", "many", "might", "much", "must", "never", "nor",
"not", "of", "on", "only", "onto", "our", "please", "shall", "she", "should", "some", "than",
"that", "thats", "the", "their", "them", "then", "there", "these", "they", "this", "those",
"through", "to", "too", "until", "very", "wasn", "wasnt", "we", "were", "weren", "what",
"whats", "when", "where", "which", "while", "who", "whom", "why", "will", "with", "within",
"without", "won", "wont", "would", "wouldn", "yet", "you", "your", "youre", "yours",
};
inline constexpr const char* k_en_collision[] = {
"care", "come", "do", "im", "per", "plus", "son", "todo",
};
inline constexpr uint32_t k_non_en_diacritics[] = {
223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 241, 242,
243, 244, 245, 246, 248, 249, 250, 251, 252, 253, 255, 257, 259, 261, 263, 269, 271, 273, 275,
281, 283, 287, 291, 299, 305, 311, 316, 322, 324, 326, 328, 337, 339, 345, 347, 351, 353, 355,
357, 363, 367, 369, 378, 380, 382, 417, 432, 537, 539, 601, 7841, 7843, 7845, 7847, 7849, 7851,
7853, 7855, 7857, 7859, 7861, 7863, 7865, 7867, 7869, 7871, 7873, 7875, 7877, 7879, 7881, 7883,
7885, 7887, 7889, 7891, 7893, 7895, 7897, 7899, 7901, 7903, 7905, 7907, 7909, 7911, 7913, 7915,
7917, 7919, 7921, 7923, 7925, 7927, 7929,
};
inline constexpr double k_non_en_diacritic_rate = 0.02;
inline constexpr double k_english_rescue_diacritic_rate = 0.06;
inline constexpr double k_non_latin_fraction = 0.2;
inline constexpr double k_non_latin_min_fraction = 0.1;
inline constexpr int k_non_latin_min_letters = 10;