A multi-model intelligent routing method, device and medium for a laotian scene

CN123013945APending Publication Date: 2026-10-30BEIJING FACE WALL INTELLIGENT TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611156485.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-31
Publication Date
2026-10-30

AI Technical Summary

Technical Problem

在多语言服务场景中,尤其是针对老挝语等低资源语言,现有路由方案普遍缺乏对低资源语言特异性的感知能力,例如老挝语书写无显式词边界、语料稀缺导致预训练模型词表覆盖不足等低资源语言特性,这些因素使得通用语义编码方法在面向老挝语请求时无法保证提取语义表示的准确性,进而影响路由分类的精度

Benefits of technology

通过确定标准词元序列,使后续的语义编码子模块能够在统一的词元标识序列上执行全局语义建模,将请求从原始的字符序列形式转化为可被Transformer编码器处理的数值化输入形式,标准词元序列的确定过程使得老挝语请求中每个有效字符均可以转换为对应的词元标识,不存在因规则词库未覆盖而被忽略或误匹配的情形,从而在输入层面保证了请求文本的完整性和准确性;通过语义编码子模块中的预训练语言模型Transformer编码器,将请求文本转换为固定维度的语义表示向量,保留词元经过全局语义交互后的综合语义信息,从根源上解决了固定规则方案对老挝语自然语言请求多样性适配能力差的技术问题。同时,语义编码子模块的参数量远小于通用大参数语言模型,其在路由阶段引入的推理延迟和计算资源消耗均处于可接受的范围,不会成为整个服务链路的性能瓶颈;通过多维度分类头子模块中并联的多个独立分类头,在同一语义表示向量上同时执行多个维度的分类预测,保证了多维分类结果之间的解耦性,避免了为每个维度单独部署编码器所带来的计算资源开销,实现了分类精细度与计算效率的兼顾。通过将多个维度的分类标签汇聚为多维度分类标签组合,查询路由规则表,能够从多个目标处理模型中精确选择出与请求各维度属性均匹配的最优模型,实现了基于多维度信息的联合路由决策。解决了现有路由方案因语义理解深度不足和对低资源语言特异性适配能力不足而导致的决策准确性难以保障的技术问题,实现了在老挝语低资源语言场景下多模型路由决策的精细化、准确化和可维护化,在保障各类请求处理质量的同时实现了计算资源的高效利用和响应延迟的有效控制。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123013945A_ABST
    Figure CN123013945A_ABST
Patent Text Reader

Abstract

The embodiment of the specification discloses a multi-model intelligent routing method, device and medium for a Lao language scene, relates to the technical field of intelligent routing, and comprises the following steps: receiving an original natural language request text, determining a standard word sequence corresponding to the original natural language request text, performing global semantic modeling on the standard word sequence through a semantic coding submodule, and determining a semantic representation vector of the original natural language request text; performing multi-dimensional classification prediction on the semantic representation vector through a multi-dimensional classification head submodule, determining a corresponding multi-dimensional classification label combination, querying a pre-set routing rule table according to the multi-dimensional classification label combination, determining a routing target address corresponding to a target processing model, and routing the original natural language request text to the target processing model for reasoning according to the routing target address. The method realizes multi-model fine and accurate routing decision in a Lao language low-resource language scene, and guarantees the processing quality of various requests.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This specification relates to the field of intelligent routing technology, and in particular to a multi-model intelligent routing method, device and medium for Lao language scenarios. Background Technology

[0002] The Lao-language-centric large-scale model service platform, namely the "Laos National Model" service system, needs to simultaneously access and process various types of user requests. These mainly include local knowledge queries based on Lao (involving Lao history, culture, geography, and policies), simple Lao dialogues (general knowledge questions and answers), complex Lao reasoning tasks (deep logical deduction and multi-step analysis), cross-language knowledge questions and answers in both Chinese and English (non-translation cross-language requests), and translation tasks between Lao and other languages.

[0003] In the aforementioned service architecture where multiple request types coexist, routing all requests to a single large-parameter language model presents several problems. First, for low-complexity tasks such as simple dialogues (e.g., everyday knowledge questions) and short text translation, the large-parameter model possesses computational capabilities far exceeding the task's requirements. Routing all such tasks to the large-parameter model would consume significant GPU resources, leading to persistently high inference costs. Furthermore, the general-purpose large-parameter language model's grasp of Lao local culture, history, and other areas is far less comprehensive than that of a Lao localization model (Sovereign LLM) specifically trained and aligned for Lao local knowledge. Routing all Lao local knowledge queries to the general-purpose large-parameter model would result in answers that fail to meet the localization needs of Lao users and pose risks regarding cultural value consistency.

[0004] Existing routing schemes rely on fixed rules based on keywords or regular expressions for route determination, classifying requests through pre-built keyword libraries and matching rules. Another approach delegates routing decisions to large-parameter language models, using prompts to guide the model in classifying user requests by intent and outputting route labels. In multilingual service scenarios, especially for low-resource languages ​​like Lao, existing routing schemes generally lack the ability to perceive the specific characteristics of low-resource languages. For example, Lao writing lacks explicit word boundaries, and the scarcity of corpora leads to insufficient vocabulary coverage in pre-trained models. These factors make it impossible for general semantic encoding methods to guarantee the accuracy of semantic representation extraction when dealing with Lao requests, thus affecting the accuracy of route classification.

[0005] In the process of building a large model service platform for Lao and other multilingual scenarios, the accuracy of routing decisions is difficult to guarantee due to the lack of depth of semantic understanding and adaptability to low-resource language specificity in existing routing schemes. Summary of the Invention

[0006] This specification provides one or more embodiments of a multi-model intelligent routing method, device, and medium for Lao language scenarios, which addresses the following technical problem: In the process of building a large model service platform for Lao and other multilingual scenarios, the accuracy of routing decisions is difficult to guarantee due to the inadequacy of existing routing schemes in terms of semantic understanding depth and adaptability to low-resource language specificity.

[0007] One or more embodiments of this specification employ the following technical solutions: This specification provides one or more embodiments of a multi-model intelligent routing method for Lao language scenarios, applied to an intelligent routing service platform. The intelligent routing service platform deploys a Lao semantic classifier model and multiple target processing models. The Lao semantic classifier model includes a semantic encoding submodule and a multi-dimensional classification head submodule. The method includes: receiving raw natural language request text sent by a user terminal; determining the standard lexical sequence corresponding to the raw natural language request text; performing global semantic modeling on the standard lexical sequence through the semantic encoding submodule to determine the semantic representation vector of the raw natural language request text; performing multi-dimensional classification prediction on the semantic representation vector through the multi-dimensional classification head submodule to determine the corresponding multi-dimensional classification label combination, wherein the multi-dimensional classification label combination includes a language type label, a task type label, and a complexity level label; querying a pre-set routing rule table based on the multi-dimensional classification label combination to determine the routing target address corresponding to the target processing model; and routing the raw natural language request text to the target processing model for inference according to the routing target address.

[0008] This specification provides one or more embodiments of a multi-model intelligent routing device for Lao language scenarios, including: At least one processor; and, A memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, which, when executed by the at least one processor, enables the at least one processor to perform the above-described method.

[0009] This specification provides one or more embodiments of a non-volatile computer storage medium storing computer-executable instructions configured to perform the above-described method.

[0010] The above-described at least one technical solution adopted in the embodiments of this specification can achieve the following beneficial effects: By defining a standard lexical sequence, the subsequent semantic encoding submodule can perform global semantic modeling on a unified lexical identifier sequence, transforming the request from a raw character sequence into a numerical input form that can be processed by the Transformer encoder. The process of defining the standard lexical sequence ensures that each valid character in the Lao request can be converted into a corresponding lexical identifier, eliminating situations where characters are ignored or mismatched due to the rule lexicon not being covered, thus guaranteeing the integrity and accuracy of the request text at the input level. Through the pre-trained language model Transformer encoder in the semantic encoding submodule, the request text is converted into a fixed-dimensional semantic representation vector, preserving the comprehensive semantic information of the lexical after global semantic interaction, fundamentally solving the technical problem of the poor adaptability of the fixed rule scheme to the diversity of Lao natural language requests. Meanwhile, the semantic encoding submodule has a much smaller parameter count than general large-parameter language models. The inference latency and computational resource consumption introduced during the routing phase are within acceptable limits and will not become a performance bottleneck for the entire service chain. By using multiple independent classification heads in parallel within the multi-dimensional classification head submodule, multi-dimensional classification predictions are performed simultaneously on the same semantic representation vector, ensuring decoupling between multi-dimensional classification results and avoiding the computational resource overhead of deploying a separate encoder for each dimension. This achieves a balance between classification precision and computational efficiency. By aggregating multi-dimensional classification labels into a multi-dimensional classification label combination and querying the routing rule table, the optimal model matching all dimensions of the request can be accurately selected from multiple target processing models, realizing joint routing decisions based on multi-dimensional information. This solves the technical problem of insufficient semantic understanding depth and inadequate adaptation to low-resource language specificities in existing routing schemes, leading to difficulty in guaranteeing decision accuracy. It achieves refined, accurate, and maintainable multi-model routing decisions in the low-resource language scenario of Lao, ensuring the quality of various request processing while achieving efficient utilization of computational resources and effective control of response latency. Attached Figure Description

[0011] To more clearly illustrate the technical solutions in the embodiments or prior art of this specification, the drawings used in the description of the embodiments or prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this specification. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort. In the drawings: Figure 1 A flowchart illustrating a multi-model intelligent routing method for Lao language scenarios provided in the embodiments of this specification; Figure 2 A flowchart illustrating another multi-model intelligent routing method for Lao language scenarios provided in the embodiments of this specification; Figure 3 This is a schematic diagram of the structure of a multi-model intelligent routing device for Lao language scenarios, provided as an embodiment of this specification. Detailed Implementation

[0012] To enable those skilled in the art to better understand the technical solutions in this specification, the technical solutions in the embodiments of this specification will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this specification, and not all embodiments. Based on the embodiments of this specification, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of this specification.

[0013] This specification provides a multi-model intelligent routing method for Lao language scenarios. It should be noted that the execution subject in this specification can be a server or any device with data processing capabilities. Figure 1 This is a flowchart illustrating a multi-model intelligent routing method for Lao language scenarios provided in an embodiment of this specification, as shown below. Figure 1 As shown, the main steps include the following: Step S101: Receive the original natural language request text sent by the user terminal, determine the standard lexical sequence corresponding to the original natural language request text, and perform global semantic modeling on the standard lexical sequence through the semantic encoding submodule to determine the semantic representation vector of the original natural language request text.

[0014] In one embodiment of this specification, the method described herein is applied to an intelligent routing service platform, which may also be referred to as a large model service platform. The intelligent routing service platform deploys a Lao semantic classifier model and multiple target processing models. The Lao semantic classifier model includes a request preprocessing submodule, a semantic encoding submodule (also referred to as a lightweight semantic encoding submodule), a multi-dimensional classification head submodule, and a routing decision submodule. The request preprocessing submodule receives the original user request text from the access gateway, performs Unicode normalization, tokenization based on the Lao extended vocabulary, and sequence length adaptation, outputting a fixed-format token sequence to the lightweight semantic encoding submodule. The lightweight semantic encoding submodule integrates a lightweight pre-trained language model, which is a small-parameter Transformer encoder architecture, fine-tuned with Lao and multilingual classification annotation data. It receives the token sequence, performs global semantic modeling through a multi-head self-attention mechanism, extracts the [CLS] position hidden state vector h, and passes it to the multi-dimensional classification head submodule. The multi-dimensional classification head submodule consists of multiple parallel linear classification heads. In one example, it contains three parallel linear classification heads, which respectively receive semantic vector h for language type recognition classification, task type classification, and request complexity evaluation. The output labels of each classification head are aggregated into a multi-dimensional classification label combination, which is then passed to the routing decision submodule. The routing decision submodule receives the multi-dimensional classification label combination, queries the routing rule table stored in the classifier training support layer, and outputs the routing target instruction to the model management and scheduling platform.

[0015] It should be noted that the specific type and function of the target processing model here can be determined according to the actual needs of the large model service platform, including at least a Lao localization large model, a Lao translation model, and a general large parameter language model. Among them, the Lao localization large model is used to handle Lao local knowledge query and cultural value alignment tasks, the Lao translation model is used to handle translation tasks between Lao and other languages, and the general large parameter language model is used to handle complex tasks such as deep reasoning, general knowledge question answering, and cross-language understanding.

[0016] In one embodiment of this specification, the intelligent routing service platform further includes an access gateway, a model management and scheduling platform, and a classifier training support layer. The access gateway receives raw natural language requests submitted by users, performs security checks on the raw natural language requests (including basic violation content identification and request frequency limiting), maintains a request queue, and sequentially transmits the raw natural language request texts that pass the security checks to the Lao semantic classifier model. The model management and scheduling platform receives routing target instructions from the classifier model, performs load balancing scheduling of the corresponding target model (selecting the service instance with the lowest current load), and is responsible for the registration management of model services (maintaining each model service endpoint), billing and metering (billing based on the computing resources used), and operation monitoring (real-time monitoring of the health status of each model service). Multiple target processing models are deployed in parallel under the model management and scheduling platform. Each target model receives the routed user request, performs inference, and returns the result. The classifier training support layer stores two types of resources: Lao multilingual classification and annotation corpus and routing rule table configuration. The Lao multilingual classification and annotation corpus is used as supervised fine-tuning training data for the classifier model, and the routing rule table configuration is queried by the routing decision submodule to define the mapping relationship between classification label combinations and the target model.

[0017] Lao is a continuous writing language without spaces, meaning there are no explicit delimiters between words in the text. Furthermore, Lao is a typical low-resource language with limited publicly available text data. This results in most pre-trained language models having severely inadequate vocabulary coverage for Lao, with many words not pre-registered and identified as out-of-vocabulary (OV) words. In this situation, directly using a conventional lexicalization process to input the Lao request text into the semantic encoding submodule maps a large number of OV words to uniform unknown lexical identifiers without carrying any semantic information. This prevents the encoder from extracting effective semantic features from these locations, leading to semantic bias in the semantic representation vector of the request text due to the lack of key semantic information.

[0018] Based on this, in one embodiment of this specification, when the pre-trained language model processes natural language input, it first needs to convert the original text into a discrete word identifier sequence defined in the model's vocabulary. The preprocessing module receives the original natural language request text sent by the user terminal and determines the standard word sequence corresponding to the original natural language request text. The specific implementation process is as follows: The first step is to perform encoding normalization on the original natural language request text to generate a normalized request text. Lao characters have multiple equivalent encoding representations in the Unicode standard. For example, some vowel and tone marks can be represented as independent combination characters or as pre-combined characters formed by combining with consonant letters. These different encoding forms visually present the same text but belong to different code point sequences at the binary level. Encoding normalization converts all characters in the input text into the normalized form defined by the Unicode standard, ensuring that semantically identical Lao text generates the same byte sequence under any input conditions, thereby eliminating differences in lexicalization results caused by encoding inconsistencies.

[0019] The second step involves inputting the normalized request text into the semantic encoding submodule. Using the vocabulary of a pre-trained language model pre-defined within this submodule, the normalized request text is lexicalized to generate a sequence of lexical identifiers. The specific implementation process of this step is as follows: When the language of the normalized request text is Lao, standard lexicalization is performed on the normalized request text according to the vocabulary of the pre-trained language model. This process determines whether there are any unregistered characters in the normalized request text that meet preset requirements. These unregistered characters are those whose corresponding token identifiers cannot be found in the vocabulary. Specifically, after normalization, the normalized request text is input into the semantic encoding submodule. The semantic encoding submodule is the functional unit in the Lao semantic classifier model responsible for converting text into numerical semantic representations. It internally encapsulates the Transformer encoder structure of the pre-trained language model and receives the vocabulary of that pre-trained language model. The semantic encoding submodule performs standard lexicalization on the normalized request text according to the preset vocabulary of the pre-trained language model. Lexicalization refers to the process of dividing the input character sequence into several tokens according to the predefined mapping relationship in the vocabulary and outputting the token identifier (Token ID) corresponding to each token. A token is the basic semantic unit for the pre-trained language model to process text, and the token identifier is a unique numerical number assigned to each token in the vocabulary. During standard lexicalization, the character sequence corresponding to the input normalized request text is segmented into several lexical units based on the pre-stored mapping relationship between lexical units and character sequences in the vocabulary, and the corresponding lexical identifier sequence, i.e., the first lexical identifier sequence, is output. The vocabulary is a set of mapping relationships between character sequences and lexical identifiers pre-constructed by the pre-trained language model before training, limiting the range of all character sequences that the model can directly process. For characters not present in the vocabulary, the model cannot assign a corresponding lexical identifier. After standard lexicalization, it is determined whether there are any out-of-vocabulary characters in the normalized request text that cannot be found in the vocabulary. Out-of-vocabulary characters are characters whose corresponding lexical identifiers cannot be found in the vocabulary of the currently used pre-trained language model.

[0020] If the unregistered character does not exist, the first token identifier sequence generated by the standard tokenization process is used to determine the token identifier sequence. In this case, each character in the character sequence is mapped to a valid token identifier.

[0021] If the missing character is found, the normalization request text is matched against syllable entries in a pre-stored Lao syllable dictionary using a preset longest string matching algorithm. The matching process begins at the start of the normalization request text and matches the longest syllable. Successfully matched syllables are used as syllable units in the syllable sequence until all characters in the normalization request text have been matched. The normalization request text is then segmented into syllable sequences based on syllable boundaries. It should be noted that the syllable dictionary refers to a pre-constructed dictionary data structure that stores a set of standard Lao syllable entries, with each syllable entry containing the standard spelling of one syllable. The longest string matching algorithm is a matching strategy that starts from the current position of the string to be matched and searches for and matches the longest syllable entry in the dictionary. That is, starting from the beginning of the normalized request text, it attempts to match the longest syllable entry at each position, and includes the successfully matched syllable as a syllable unit into the syllable sequence. Then it moves to the next unmatched position to continue matching until all characters of the normalized request text have been matched. This completely segments the normalized request text into a syllable sequence according to the syllable boundaries. Here, the syllable sequence refers to the ordered set of all syllable units obtained after segmenting the normalized request text according to the syllable boundaries and arranged in the original order.

[0022] Each syllable in the syllable sequence is subjected to character-level lexicalization to generate a second lexical identifier sequence. During the character-level lexicalization process, a syllable is broken down into its individual characters, and each character is assigned a corresponding character-level lexical identifier to generate a sequence of multiple character-level lexical identifiers arranged in the order of characters within the syllable, which is the second lexical identifier sequence.

[0023] The lexical identifiers corresponding to the unregistered character in the first lexical identifier sequence are replaced with the corresponding character-level lexical identifiers in the second lexical identifier sequence to generate a multi-granularity fused lexical identifier sequence to determine the lexical identifier sequence. The positions of the lexical identifiers corresponding to the unregistered character in the first lexical identifier sequence are identified one by one, and the lexical identifier at that position is extracted and replaced with the character-level lexical identifier in the second lexical identifier sequence corresponding to the unregistered character's position in the original text. After the replacement operation is completed, a sequence is generated by rearranging the lexical identifiers of all non-unregistered characters in the first lexical identifier sequence and the character-level lexical identifiers corresponding to all unregistered characters in the second lexical identifier sequence according to the original order of the characters in the original text; this is the multi-granularity fused lexical identifier sequence.

[0024] The third step involves adapting the sequence length of the token identifier sequence to generate a standard token sequence of a preset fixed length. The maximum input length specified by the pre-trained language model is obtained. This maximum input length is the maximum number of tokens that the Transformer encoder of the pre-trained language model can process in one forward propagation. Its value is determined by the network structure parameters of the pre-trained language model, specifically equal to the maximum number of positional encodings that the input layer of the Transformer encoder can accommodate. The actual length of the current token identifier sequence is obtained, i.e., the total number of token identifiers contained in the sequence. The actual length is compared with the maximum input length. If the actual length is less than the maximum input length, preset padding token identifiers are added to the end of the token identifier sequence until the length of the padded sequence equals the maximum input length, generating the standard token sequence. The padding token identifiers are token identifiers corresponding to special tokens specifically used as placeholders in the vocabulary of the pre-trained language model. These tokens are ignored by the masking mechanism in subsequent attention calculations and do not participate in semantic modeling, thus ensuring that the padding positions do not interfere with the semantic representation of the standard token sequence. If the actual length is greater than the maximum input length, then the sequence is truncated starting from the beginning of the token identifier sequence. The first N consecutive token identifiers starting from the first token identifier are retained, and the remaining part is discarded. Here, N is equal to the maximum input length, and the truncated sequence is used as the standard token sequence. It should be noted that, for the multi-dimensional classification routing task of Lao request text, the core intent of the request, key action words (such as analysis, translation, query), domain qualifiers (such as those involving culture, policy, and life), and language type indicators are usually located at the beginning of the sentence. This is determined by the subject-verb-object (SVO) basic word order and topic-priority language type features of Lao. Modifiers, adverbial clauses, or supplementary information located at the end of the sentence contribute relatively little to the classification decision. Therefore, truncating the tail will not lead to classification. In addition, the multi-head self-attention mechanism in the Transformer encoder performs interactive calculation of attention weights between the word at each position and all other positions in the sequence when calculating the output representation at each position. Words located near the beginning of the sequence can gather information from all positions in the entire sequence through attention weights. Therefore, in the prefix part that is retained after the truncation operation, the final encoded representation of each word has indirectly carried some semantic information of the discarded tail part through the attention mechanism, further reducing the degree of information loss caused by directly truncating the tail.

[0025] If the actual length equals the maximum input length, the token identifier sequence is directly used as the standard token sequence. After the above processing, a standard token sequence of preset fixed length is generated. The preset fixed length is equal to the maximum input length. The standard token sequence refers to the fixed-length token identifier sequence generated after tokenization and sequence length adaptation. Each position in the standard token sequence has a fixed position index, which can correspond one-to-one with the position encoding in the Transformer encoder.

[0026] The request preprocessing submodule preprocesses the raw natural language request text sent by the user terminal to obtain the standard word sequence corresponding to the raw natural language request text. Then, the semantic encoding submodule performs global semantic modeling on the standard word sequence to determine the semantic representation vector of the raw natural language request text. The semantic encoding submodule internally encapsulates a Transformer encoder for a pre-trained language model. The Transformer encoder consists of multiple stacked Transformer encoding layers, each containing a multi-head self-attention sublayer and a feedforward neural network sublayer. First, by querying the word embedding matrix of the pre-trained language model, each word identifier in the standard word sequence is converted into a corresponding initial embedding vector. Each row of the word embedding matrix stores the dense vector representation of the corresponding word. After completing the initial embedding vector conversion, the semantic encoding submodule obtains the positional encoding matrix of the pre-trained language model. The number of rows in this positional encoding matrix is ​​consistent with the maximum input length of the Transformer encoder, and each row stores the positional encoding vector corresponding to the absolute position. The semantic encoding submodule adds the initial embedding vector at each position in the standard word sequence element-wise to the positional encoding vector in the corresponding row of the positional encoding matrix to generate an encoded input vector carrying absolute position information. The first encoding layer of the Transformer encoder receives the encoded input vector sequence. For each query position in the sequence, a multi-head self-attention sublayer calculates the attention weight distribution between that position and all key positions in the sequence. This attention weight distribution reflects the semantic association strength between positions in the sequence. Then, based on this attention weight distribution, the value vectors of all positions in the sequence are weighted and summed to generate the self-attention output vector for that query position. The multi-head self-attention sublayer performs the above attention calculation process separately through multiple parallel attention heads. Each attention head uses an independent trainable projection parameter matrix to project the encoded input vector into query vector, key vector, and value vector, respectively. The self-attention output vectors output by each attention head are concatenated and linearly transformed through the output projection matrix to generate the intermediate representation vector sequence of the encoding layer. The feedforward neural network sublayer independently performs two consecutive linear transformations on each position vector in this intermediate representation vector sequence, and sets a non-linear activation function between the two linear transformations for mapping, generating the output representation vector sequence of the encoding layer. Each subsequent coding layer uses the output representation vector sequence of the previous coding layer as input, repeating the above multi-head self-attention calculation and feedforward neural network mapping process. The calculation of each coding layer establishes bidirectional semantic dependencies between positions across the entire sequence. After layer-by-layer processing through all coding layers, the semantic coding submodule obtains the hidden state vector corresponding to each position in the standard lexical sequence. The hidden state vector is a deep representation after multi-layer semantic interaction modeling.The semantic encoding submodule extracts the hidden state vector corresponding to a specific marker position from the hidden state vector sequence as the semantic representation vector of the original natural language request text. The specific marker position corresponds to the position of a special word in the standard word sequence that is used to aggregate the semantic information of the whole sequence as specified by the pre-trained language model.

[0027] By introducing out-of-vocabulary (OV) character detection, each OV character is precisely located based on the standard lexicalization results. Then, the text is segmented into a syllable sequence using the longest string matching algorithm combined with a Lao syllable dictionary. Each syllable is then processed with character-level lexicalization. Finally, the character-level lexical identifiers are precisely replaced with the corresponding empty positions in the first lexical identifier sequence according to their positions. This ensures that every character in the normalized request text can obtain a valid lexical identifier, and there are no cases where OV words are discarded or merged into meaningless placeholders. The semantic encoding submodule can perform global semantic modeling based on the complete lexical identifier sequence, and the extracted semantic representation vector completely preserves all the semantic information of the original request. Meanwhile, the high-quality, high-semantic-density lexical identifiers generated by standard lexicalization are retained in the registered words. In the unregistered words, the minimum effective representation is obtained through step-by-step backtracking at the syllable and character levels. After fusion according to the original order of characters in the original text, the semantic encoding submodule can simultaneously utilize the encoding advantages of standard lexicalization and the coverage advantages of character-level backtracking, avoiding the semantic information breakage that inevitably occurs due to insufficient vocabulary coverage in low-resource language scenarios caused by single-granularity lexicalization.

[0028] Step S102: Through the multi-dimensional classification head sub-module, perform multi-dimensional classification prediction on the semantic representation vector to determine the corresponding multi-dimensional classification label combination.

[0029] In one embodiment of this specification, the multi-dimensional classification head submodule includes multiple classification heads connected in parallel. The number of classification heads is related to the number of classification labels. In one example, the multi-dimensional classification label combination includes language type label, task type label, and complexity level label, with each classification label corresponding to one classification head.

[0030] The multi-dimensional classification head module performs multi-dimensional classification prediction on the semantic representation vector to determine the corresponding multi-dimensional classification label combination. This is achieved in the following way: The semantic representation vector is linearly transformed by each classification head and mapped using a preset normalized exponential function to determine the probability distribution of the original natural language request text in the corresponding label type dimension. This label type dimension includes language type, task type, and complexity level dimensions. Specifically, the weight matrix stored within each classification head is multiplied with the semantic representation vector to obtain an intermediate vector. Then, the bias vector of each classification head is added element-wise with this intermediate vector to obtain a score vector. The dimension of this score vector equals the total number of preset classification label categories. The value in each dimension represents the degree of unnormalized matching between the semantic representation vector and the corresponding classification label category. The score vector is input into the preset normalized exponential function (Softmax function) through the classification head. The normalized exponential function performs exponential and normalization operations on the values ​​of each dimension in the score vector, outputting a probability distribution. Each dimension in the probability distribution corresponds to a preset classification label category, and the value in that dimension represents the predicted probability that the original natural language request text belongs to that category.

[0031] For each probability distribution, the label type corresponding to the highest probability value is used to determine the category label for each dimension of that label type, thus generating the multi-dimensional category label combination. After each category head outputs a probability distribution, it determines the preset category label category corresponding to the dimension with the largest value from all dimensions of that probability distribution, and uses the category label corresponding to that preset category label category as the category label. The category labels obtained from each category head are then aggregated to generate the multi-dimensional category label combination.

[0032] The following section uses three category headers as examples to illustrate the specific implementation process: The semantic representation vector is input into three parallel classification heads: a first classification head, a second classification head, and a third classification head. These three classification heads are structurally independent, with no parameter sharing or information transfer between them. Each classification head independently performs classification prediction on the same semantic representation vector. The first classification head is used for classification prediction along the language type dimension. It outputs a first probability distribution, where each dimension corresponds to a preset language type category, and the value in that dimension represents the predicted probability that the original natural language request text belongs to that category, thus determining the corresponding language type label.

[0033] The second classification head is used for classification prediction on the task type dimension. Similarly, the second classification head outputs a second probability distribution. Each dimension of the second probability distribution corresponds to a preset task type category, and the value on that dimension represents the predicted probability that the original natural language request text belongs to that category, thus determining the corresponding task type label.

[0034] The third classification head is used for classification prediction along the complexity level dimension. It outputs a third probability distribution, where each dimension corresponds to a preset complexity level category, and the numerical value in that dimension represents the predicted probability that the original natural language request text belongs to that category, thus determining the corresponding complexity level label. The language type label, task type label, and complexity level label are then combined to generate a multi-dimensional classification label combination.

[0035] It should be noted that the weight matrices in the multiple classification heads are independent of each other. The first weight matrix in the first classification head has a dimension equal to the total number of preset language type categories multiplied by the dimension of the semantic representation vector; the second weight matrix in the second classification head has a dimension equal to the total number of preset task type categories multiplied by the dimension of the semantic representation vector; and the third weight matrix in the third classification head has a dimension equal to the total number of preset complexity level categories multiplied by the dimension of the semantic representation vector. All weight matrices originate from the classifier model's training process. During model training, a training dataset with multi-dimensional classification labels is obtained. Each sample in this training dataset contains a request text and its corresponding language type label, task type label, and complexity level label. This training dataset is input into the classifier model to be trained. The prediction results of each classification head are calculated through forward propagation, and the gradient of the loss function relative to each weight matrix is ​​calculated through backpropagation. The gradient descent optimization algorithm is used to iteratively update the values ​​of each weight matrix along the gradient direction until the loss function converges. The initial values ​​of each weight matrix are generated by the server before training begins according to a preset initialization strategy, which involves randomly sampling values ​​from a normal distribution to fill the matrix elements. Through the above training process, the three weight matrices learn the discriminative feature mapping parameters required for their respective classification tasks.

[0036] Furthermore, the bias vectors in the multiple classification heads are all different. In the first classification head, the dimension of the first bias vector is the same as the dimension of the first score vector, equal to the preset total number of language type categories. In the second classification head, the dimension of the second bias vector is the same as the dimension of the second score vector, equal to the preset total number of task type categories. In the third classification head, the dimension of the third bias vector is the same as the dimension of the third score vector, equal to the preset total number of complexity level categories. Each bias vector originates from the training process of the classifier model. During the training phase, the gradient of the loss function with respect to each bias vector is calculated using the backpropagation algorithm. The gradient descent optimization algorithm is then used to iteratively update the values ​​of each bias vector along the gradient direction until the loss function converges. The initial values ​​of each bias vector are generated by the server before training begins according to a preset initialization strategy, which initializes each element of the bias vector to zero. Through the above training process, the three bias vectors learn the bias adjustment parameters required for their respective classification tasks.

[0037] Before the training phases of the first, second, and third classification heads, the total number of language type categories, task type categories, and complexity level categories are pre-defined. The total number of language type categories is determined based on the number of languages ​​the intelligent routing service platform needs to support. For example, it includes Lao, Chinese, English, mixed language, and other language categories. This category represents the language type of the original natural language request text. The mixed language category indicates that the original natural language request text contains characters or words from two or more languages. The other language categories indicate that the language type of the original natural language request text does not belong to any of the above Lao, Chinese, English, or mixed language categories. In this example, the total number of categories in the pre-defined complete set of language type categories is fixed at 5.

[0038] The total number of task type categories is determined based on the number of task types the intelligent routing service platform needs to distinguish. In one example, the complete set of preset task type categories includes at least the following categories: Local Knowledge Query, General Dialogue, Translation Task, Deep Reasoning, and Other Task Categories. Specifically, the Local Knowledge Query category indicates that the original natural language request text involves knowledge queries related to various fields in Laos; the General Dialogue category indicates that the original natural language request text involves everyday common sense, general information consultation, or open-ended casual conversation; the Translation Task category indicates that the original natural language request text contains instructions or requirements to convert one natural language into another; the Deep Reasoning category indicates that the original natural language request text requires multi-step logical deduction, complex mathematical calculations, or cross-domain knowledge synthesis analysis; and the Other Task Categories indicate that the original natural language request text does not belong to any of the above Local Knowledge Query, General Dialogue, Translation Task, or Deep Reasoning categories. These five categories constitute the complete set of preset task type categories, and the total number of categories in this set is fixed at 5.

[0039] The total number of complexity level categories is determined based on the number of complexity levels required by the intelligent routing service platform. In one example, the complete set of preset complexity level categories includes simple, medium, and complex categories. Simple categories indicate that the processing of the original natural language request text can be completed based solely on fact retrieval or shallow language understanding; medium categories indicate that the processing of the original natural language request text requires a certain degree of information integration, logical connection, or multi-step reasoning; complex categories indicate that the processing of the original natural language request text requires long-chain reasoning, deep logical inference, or large-scale knowledge synthesis. In this example, the total number of categories in the complete set of preset complexity level categories is 3.

[0040] Before the training phase begins, the dimension of the semantic representation vector is obtained. This dimension is determined by the hidden layer dimension of the Transformer encoder of the pre-trained language model in the semantic encoding submodule. This hidden layer dimension is an inherent network structure parameter of the pre-trained language model.

[0041] The dimensions of each weight matrix are determined according to the following rules. For any classifier head, the number of rows in the weight matrix of that classifier head is equal to the total number of preset categories corresponding to that classifier head, and the number of columns in the weight matrix of that classifier head is equal to the dimension of the semantic representation vector; each row of the weight matrix corresponds to a preset category, and each column corresponds to a dimension of the semantic representation vector; the weight matrix linearly maps the semantic representation vector from the semantic space to the category score space. In the example above, the number of rows in the first weight matrix of the first classifier head is equal to the total number of preset language type categories (5), and the number of columns in the first weight matrix is ​​equal to the dimension of the semantic representation vector; the number of rows in the second weight matrix of the second classifier head is equal to the total number of preset task type categories (5), and the number of columns in the second weight matrix is ​​equal to the dimension of the semantic representation vector; the number of rows in the third weight matrix of the third classifier head is equal to the total number of preset complexity level categories (3), and the number of columns in the third weight matrix is ​​equal to the dimension of the semantic representation vector. Before training begins, each element of each weight matrix is ​​assigned an initial value. During training, each element of each weight matrix is ​​iteratively updated using the backpropagation algorithm until the loss function converges.

[0042] When the first classification head introduces text system feature enhancement, the dimension of the first enhanced feature vector equals the sum of the dimension of the semantic representation vector and the dimension of the text system feature sub-vector. The number of columns in the first weight matrix is ​​updated accordingly to the dimension of the first enhanced feature vector, while the number of rows in the first weight matrix remains unchanged at the preset total number of language type categories (5). When the second classification head introduces syntactic structure feature enhancement, the dimension of the second enhanced feature vector equals the sum of the dimension of the semantic representation vector and the dimension of the syntactic structure feature sub-vector. The number of columns in the second weight matrix is ​​updated accordingly to the dimension of the second enhanced feature vector, while the number of rows in the second weight matrix remains unchanged at the preset total number of task type categories (5). When the third classification head introduces syntactic feature enhancement, the dimension of the third enhanced feature vector equals the sum of the dimension of the semantic representation vector and the dimension of the syntactic feature sub-vector. The number of columns in the third weight matrix is ​​updated accordingly to the dimension of the third enhanced feature vector, while the number of rows in the third weight matrix remains unchanged at the preset total number of complexity level categories (3).

[0043] After the above configuration, the total number of preset language type categories is 5, the total number of preset task type categories is 5, and the total number of preset complexity level categories is 3. The number of rows in each weight matrix is ​​equal to the total number of the corresponding preset categories, and the number of columns in each weight matrix is ​​equal to the dimension of the corresponding input vector. Based on the complete set of categories set by the intelligent routing service platform and the hidden layer dimension of the semantic encoding submodule, the dimension of each weight matrix can be uniquely determined, and the parameters of each weight matrix are optimized according to the standard neural network training process. Building upon the standard classification process performed by the multiple classification heads, feature enhancement of the semantic representation vector is introduced to improve the accuracy of language type recognition, task type recognition, and complexity level recognition in the Lao language scenario.

[0044] First, based on language type identification using the first classification head, discriminative features based on characters specific to the Lao script system are introduced. Lao is a phonetic script, and its character set includes specific tone and vowel symbols. These symbols have unique combinations and frequency distributions that distinguish Lao from other scripts. Therefore, the first classification head is used to perform a character-level scan of the normalized request text, counting the number of characters belonging to the Lao-specific character set. It should be noted that the Lao-specific character set includes Lao consonants, vowels, tone symbols, and other special symbols. The count of Lao-specific characters is divided by the total number of characters in the normalized request text to obtain the Lao-specific character density feature value. Simultaneously, the number of characters belonging to the Thai-specific character set in the normalized request text is counted, and the Thai-specific character density feature value is calculated. Since Lao and Thai have high similarity in glyphs and both originate from the same ancient script system, character-level density statistics alone are insufficient to reliably distinguish between Lao and Thai requests. Therefore, the co-occurrence pattern features of Lao-specific and Thai-specific characters in the normalized request text are extracted using the first classification header. These co-occurrence pattern features represent the degree of mixing between the two script types by statistically analyzing whether multiple consecutive characters in the normalized request text simultaneously contain both Lao-specific and Thai-specific characters. The co-occurrence pattern features characterize the degree of mixing between Lao-specific and Thai-specific characters within a local area of ​​the text in the normalized request text. The following steps are used to extract these co-occurrence pattern features: The first step is to set a preset sliding window length, which is in characters and represents the number of consecutive characters examined simultaneously in the normalized request text. In one example, the sliding window length is set to a preset fixed value, which is greater than or equal to two.

[0045] The second step is to start from the beginning character position of the normalized request text, slide the window sequentially with a step size of one character, and extract a continuous character segment with a length equal to the length of the sliding window starting from the current position at each window position, as the character sequence to be analyzed in the current window.

[0046] The third step is to perform the following judgment operations on the character sequence to be analyzed in each window: count the number of characters in the character sequence to be analyzed that belong to the Lao-specific character set and the number of characters that belong to the Thai-specific character set; if the number of Lao-specific characters and the number of Thai-specific characters are both greater than zero, then mark the window as a mixed window; otherwise, mark it as a non-mixed window.

[0047] The fourth step involves counting the number of windows marked as mixed windows across all windows. This mixed window count is then divided by the total number of windows in the normalized request text to calculate the co-occurrence pattern feature value. This feature value, expressed as a ratio, represents the degree of mixing between Lao-specific and Thai-specific characters in the normalized request text. This co-occurrence pattern feature value is then arranged in a preset order along with the Lao-specific character density feature values ​​and the Thai-specific character density feature values ​​to generate a three-dimensional character system feature sub-vector.

[0048] The Lao-specific character density feature values, Thai-specific character density feature values, and co-occurrence pattern feature values ​​are arranged in a preset order to generate a three-dimensional character system feature sub-vector. The character system feature sub-vector is then concatenated with the semantic representation vector along the vector dimension to generate the first enhanced feature vector. A first classification head is used to perform a linear transformation on the first enhanced feature vector, and a preset normalized exponential function is applied to determine the probability distribution of the original natural language request text along the corresponding tag type dimension, thus obtaining the language type label.

[0049] The first classifier, based on standard linear classification, introduces three dimensions of script system features: Lao-specific character density, Thai-specific character density, and co-occurrence patterns of both. These feature vectors are then concatenated with the semantic representation vector before reclassification and prediction. This allows language type recognition to make a comprehensive judgment based on both deep semantic information and surface-level script morphology features. For language pairs like Lao and Thai, which have similar glyphs and semantic coding spaces, pure semantic differentiation is difficult. However, the introduction of script system features allows the classifier to capture subtle differences in the use of specific characters at the character level, significantly improving the accuracy of language type recognition.

[0050] Building upon task type identification using the second classification head, discriminative features based on Lao grammatical structure are introduced. Lao is an isolating language, relying on word order and function words as the fundamental means of expressing grammatical meaning. In sentences, the subject precedes the predicate, the object and complement follow the verb, and modifiers of nouns follow the noun. In actual Lao usage, different task types exhibit significant pattern differences in word order structure and function word usage. Local knowledge query requests often contain specific interrogative words and noun phrases pointing to Lao local culture, history, geography, and policies; translation requests typically contain explicit translation instruction verbs and name identifiers for the source and target languages; general dialogue requests have relatively simple sentence structures and low frequency of function word usage; and deep reasoning requests generally have longer sentences containing multiple clauses and complex modification relationships. The second classification head is used to perform part-of-speech tagging on the normalized request text, obtaining the part-of-speech tag for each word in the normalized request text to generate a part-of-speech tag sequence. Based on the part-of-speech tag sequence, function words in the normalized request text are identified, the total frequency of occurrence of function words in the normalized request text is counted, and the function word density feature value is calculated to represent the frequency of use of grammatical function words in the request text. Verbs in the normalized request text are identified using the second classification head based on the part-of-speech tag sequence, the total frequency of occurrence of verbs in the normalized request text is counted, and the position index of each verb in the text is obtained. The arithmetic mean of all verb position indices is calculated, and the arithmetic mean is used to determine the position feature value of the verb distribution center, which is used to represent the positional distribution pattern of the core action in the sentence. It should be noted that the verb position index refers to the position number of each verb in the normalized request text within the part-of-speech tag sequence. After part-of-speech tagging of the normalized request text, a part-of-speech tag sequence corresponding to each word in the normalized request text is obtained. This part-of-speech tag sequence is arranged according to the original order of the words in the normalized request text, and the position number of each part-of-speech tag in the sequence increases sequentially from the starting number. The starting number is a preset non-negative integer. In one example, the starting number is set to 1, meaning the position index of the first part-of-speech tag in the part-of-speech tag sequence is 1, the position index of the second part-of-speech tag is 2, and so on. Verbs in the normalized request text are identified based on the part-of-speech tag sequence. Each part-of-speech tag in the sequence is traversed. When the value of a part-of-speech tag belongs to a preset set of verb tags, the word corresponding to that tag is marked as a verb, and the position number of the verb's part-of-speech tag in the part-of-speech tag sequence is obtained as the verb's position index. The total number of words marked as verbs in the normalized request text is counted as the total number of verb occurrences. The verb position indices of all verbs are summed to obtain the sum of verb position indices. This sum is divided by the total number of verb occurrences to calculate the arithmetic mean of all verb position indices. This arithmetic mean is used as the feature value of the verb distribution center position.For example, if the normalized request text, after part-of-speech tagging, yields a sequence containing five part-of-speech tags, two of which are identified as verbs with position indices 1 and 4 respectively, then the sum of the verb position indices is 5, the total number of verb occurrences is 2, and the arithmetic mean is 2.5. This arithmetic mean represents the central position of the verb's distribution in the sentence in numerical form.

[0051] The second classification head identifies nouns in the standardized request text based on the part-of-speech tag sequence. The total frequency of each noun in the standardized request text is counted, and the total frequency is divided by the total number of words in the standardized request text to calculate the noun proportion feature value. This noun proportion feature value represents the density of entity information carriers in the request. The function word density feature value, verb distribution center position feature value, and noun proportion feature value are arranged in a preset order to generate a three-dimensional grammatical structure feature sub-vector. The second classification head concatenates this grammatical structure feature sub-vector with the semantic representation vector in the vector dimension to generate a second enhanced feature vector. The second classification head performs a linear transformation on the second enhanced feature vector and maps it using a preset normalized exponential function to determine the probability distribution of the original natural language request text in the corresponding tag type dimension, thus obtaining the task type tag.

[0052] The second classification head, based on standard linear classification, introduces three dimensions of grammatical structure features: function word density, verb distribution center position, and noun proportion. These feature sub-vectors are then concatenated with the semantic representation vector for re-classification prediction. This allows task type classification to be comprehensively judged based on both deep semantic information and shallow syntactic structure features. As an isolated language, Lao exhibits discernible regularities in word order patterns and function word usage across different task types. The introduction of grammatical structure features enables the classifier to perceive these structural differences that are not easily reflected in pure semantic vectors, thereby improving the accuracy of task type classification.

[0053] Building upon task type identification using the third classification head, a Lao syntax structure complexity feature is introduced. Specifically, when the label type dimension is a complexity level dimension, a linear transformation is performed on the semantic representation vector using each classification head, and a pre-defined normalized exponential function is used to map the probability distribution of the original natural language request text along the corresponding label type dimension. This includes: Dependency parsing is performed on the normalized request text to generate a dependency relation set. Based on this set, a dependency tree is constructed with the core predicate as the root node. It should be noted that dependency parsing refers to analyzing the binary dependency relations between words in a sentence according to dependency grammar theory, identifying the core word (head word) that each word depends on, and labeling the type of dependency relation, thereby generating the dependency relation set for the entire sentence. Each entry in the dependency relation set includes a dependent word, a head word, and an identifier for the dependency relation type between them. The dependency tree is constructed based on the dependency relation set with the core predicate as the root node. The core predicate is the only word in the sentence that does not depend on any other word; all other words are directly or indirectly connected to this root node through dependency relations.

[0054] Calculate the number of edges in the longest path from the root node to the farthest leaf node of the dependency tree, and use this number of edges to determine the depth feature value of the dependency syntax tree. It should be noted that the depth feature value of the dependency syntax tree reflects the length of the dependency chain between words in the sentence and represents the nesting depth of the sentence in terms of syntactic structure.

[0055] Obtain the word position index of each word in the normalized request text, and the head word position index of the corresponding head word in the dependency tree. Determine the dependency arc length of each word by the absolute value of the difference between the word position index of each word and the head word position index of the corresponding head word. The dependency arc length reflects the linear distance between the dependent word and its head word in the text, representing the working memory span required for the word to be maintained during syntactic parsing. Sum the dependency arc lengths of all words in the normalized request text and divide by the total number of words to calculate the arithmetic mean of the dependency arc lengths of multiple words in the normalized request text. Use this arithmetic mean to determine the average dependency arc length feature value, which reflects the average working memory burden required for the entire sentence during syntactic parsing.

[0056] Phrase structure analysis was performed on the normalized request text to identify noun phrases and verb phrases. Phrase structure analysis involves decomposing the sentence into nested phrase structure levels according to phrase structure grammar rules, identifying various phrase components and their internal relationships. After phrase structure analysis, all noun phrases and verb phrases in the normalized request text were identified. Noun phrases are phrase structure units with nouns as their core components, and verb phrases are phrase structure units with verbs as their core components. The number of phrase modifiers within each noun phrase and verb phrase was counted, and the maximum number of all phrase modifiers was used to determine the modification chain length feature value. Modifiers are subordinate components that are attached to the core component, limiting, describing, or supplementing its meaning. The maximum number of modifiers from all noun phrases and verb phrases was selected as the modification chain length feature value. The modification chain length feature value reflects the highest concentration of information density in the request text, representing the parsing depth required for the most complex phrase structure unit in the sentence.

[0057] Syntactic feature sub-vectors in the semantic representation vector are determined using the dependency syntax tree depth feature value, the average dependency arc length feature value, and the modification chain length feature value. These feature values ​​are then arranged in a preset order to generate a three-dimensional syntactic feature sub-vector, with each dimension corresponding to one of the three syntactic features. This syntactic feature sub-vector is concatenated with the semantic representation vector along its vector dimension to generate an enhanced feature vector. The values ​​of each dimension of the syntactic feature sub-vector are then appended sequentially to the end of the semantic representation vector to generate an enhanced feature vector with expanded dimensions. This enhanced feature vector simultaneously contains global semantic information and syntactic structural complexity information of the original request text. A linear transformation is applied to this enhanced feature vector, and it is mapped using a preset normalized exponential function to determine the probability distribution of the original natural language request text at each preset complexity level, thus obtaining the task type label.

[0058] By introducing the depth of the dependency parsing tree and the average dependency arc length features extracted from dependency parsing into the third classification head, the nesting depth and working memory span of Lao requests during the syntactic parsing process can be directly quantified, enabling complexity assessment to perceive the depth of syntactic structure. By extracting the modification chain length feature through phrase structure analysis, the linguistic characteristics of multi-layered nesting of modifiers within Lao noun phrases and verb phrases can be precisely targeted, allowing complexity assessment to accurately identify requests whose overall parsing difficulty is increased due to the high complexity of individual phrase structures. Combining the above syntactic features into syntactic feature sub-vectors and concatenating them with semantic representation vectors ensures that the prediction of complexity level is based on both global semantic understanding and syntactic structure parsing, complementing each other. This prevents requests with complex structures but simple semantics from being underestimated due to ignoring syntactic information, and vice versa.

[0059] It should be noted that after introducing feature enhancement of the semantic representation vector, the dimension of the weight matrix in each classifier has undergone an adaptive change. The number of columns in the weight matrix of each classifier is no longer equal to the dimension of the original semantic representation vector, but equal to the dimension of its respective enhanced feature vector.

[0060] In the multi-model intelligent routing service platform, the Lao language localization model is a dedicated model trained and aligned specifically with Lao local culture, history, and other aspects of Lao culture. When dealing with topics related to high cultural sensitivity in Laos, it can generate responses that are consistent with Lao local understanding at the level of cultural values. While the general-purpose large-parameter language model has advantages in reasoning ability and knowledge coverage, it is far inferior to the Lao language localization model in terms of its grasp of Lao local cultural knowledge and alignment with cultural values. In the actual operation of the service platform, there are many high-cultural sensitivity requests that appear simple on the surface but actually involve core areas of Lao culture. These requests may be expressed in short sentences or simple sentence structures. If routing decisions are made solely based on language type labels, task type labels, and complexity level labels, the complexity level assessment result will be simple, and the task type may be classified as general dialogue, ultimately being routed to the general-purpose large-parameter language model for processing. This results in the returned responses being biased or incorrect at the level of Lao cultural values.

[0061] In one embodiment of this specification, the multi-dimensional classification label combination also includes a cultural sensitivity label. In addition to the original first, second, and third classification heads, a parallel fourth classification head is also included, which is a pre-trained cultural sensitivity classifier.

[0062] The semantic representation vector is input into a pre-trained cultural sensitivity classifier. The classifier performs a linear transformation on the semantic representation vector and then maps it through a preset normalized exponential function to determine the probability distribution of the original natural language request text at each preset cultural sensitivity level. The cultural sensitivity label is determined by the label corresponding to the cultural sensitivity level with the highest probability value in the probability distribution.

[0063] The weight matrix stored internally by the cultural sensitivity classifier is multiplied with the semantic representation vector to obtain an intermediate vector. Then, the bias vector is added element-wise with this intermediate vector to obtain a score vector. The dimension of the score vector equals the total number of preset cultural sensitivity levels. The value in each dimension represents the unnormalized matching degree between the semantic representation vector and the corresponding cultural sensitivity level category. This score vector is input into a normalization exponential function, which performs exponential and normalization operations on the values ​​of each dimension, outputting a probability distribution. Each dimension in this probability distribution corresponds to a preset cultural sensitivity level category, and the value in that dimension represents the predicted probability that the original natural language request text belongs to that category. After the probability distribution is output by the fourth classification head, the preset cultural sensitivity level category corresponding to the dimension with the largest value is determined from all dimensions of this probability distribution. The classification label corresponding to this preset cultural sensitivity level category is used as the cultural sensitivity label.

[0064] During the training phase, the data source for the weight matrix and bias vector of the fourth classification head (cultural sensitivity classifier) ​​is the same as that of other classification heads, originating from the supervised training process of the classifier model. A training dataset labeled with cultural sensitivity tags is obtained. Each sample in the training dataset includes a request text and its corresponding cultural sensitivity tag. The cultural sensitivity tags are labeled by annotators according to pre-defined labeling criteria, which define specific topics related to cultural sensitivity. Requests involving Lao local cultural identity, historical heritage, and ethnic traditions are labeled as having a high level of cultural sensitivity. The training dataset is input into the classifier model to be trained. The prediction results of the fourth classification head are calculated through forward propagation, and the gradient of the loss function with respect to the weight matrix and bias vector is calculated through backpropagation. The gradient descent optimization algorithm is used to iteratively update the values ​​of the weight matrix and bias vector along the gradient direction until the loss function converges, resulting in the trained fourth classification head.

[0065] For the specific application scenario of the Lao language large-scale model service platform, safeguarding cultural sovereignty is as important as optimizing computing resources. The inability to distinguish between ordinary requests and culturally sensitive requests will lead to culturally sensitive requests being routed to the general large-parameter language model due to their complexity assessment being too simple, resulting in responses that are biased in terms of Lao cultural values. This specification's embodiment addresses this by adding a fourth classification header to independently output cultural sensitivity labels, enabling it to perceive the cultural attributes of requests.

[0066] Step S103: Based on the combination of multi-dimensional classification labels, query the pre-set routing rule table to determine the routing target address corresponding to the target processing model, and route the original natural language request text to the target processing model for inference according to the routing target address.

[0067] In one embodiment of this specification, the target processing model includes a general large-parameter language model, a Lao localization large model, and a Lao translation model. It should be noted that in the actual deployment of the Lao large model service platform, in addition to the above three target processing models, various other types of dedicated models can be deployed according to business needs to further enrich service capabilities and optimize resource scheduling efficiency.

[0068] Obtain the multi-dimensional classification label combination output by the multi-dimensional classification head module, including language type label, task type label, complexity level label, and cultural sensitivity label. Combine the above four-dimensional classification labels into a structured query key according to a preset order. The query key format is a composite key structure including four label fields, where the first field is the language type label, the second field is the task type label, the third field is the complexity level label, and the fourth field is the cultural sensitivity label.

[0069] The system reads a pre-configured routing rule table, which is stored as a configuration file on the server's storage. Independent of the classifier model's weight parameters, this table can be dynamically loaded and updated by the server without retraining or updating the classifier model. Each record in the routing rule table includes a query key field and a destination address field. The query key field stores a complete set of four-dimensional classification labels, and the destination address field stores the network address of the target processing model corresponding to that set of classification labels. Logically, the routing rule table is implemented as a key-value pair mapping structure, where the key is the four-dimensional classification label combination, and the value is the corresponding destination address. Example routing rule rules are as follows: When the multi-dimensional classification head module outputs the language type label as Lao, the task type label as local knowledge query, the complexity level label as arbitrary level, and the cultural sensitivity label as high cultural sensitivity level, the routing rule table is queried, and the routing target address corresponding to this combination of classification labels is the service endpoint of the Lao localization model. In actual deployment, the Lao localization model corresponds to a national-level model that has been specifically trained and aligned with Lao local culture, history, and other cultural aspects, such as the Lao National LLM. This model is the first national-level model in ASEAN that does not use a common language, and it performs excellently in Chinese, Lao, and English translation and mutual translation, Lao language understanding and content generation, cultural relevance, and local adaptability.

[0070] When the language type label is Lao, the task type label is translation task, the complexity level label is arbitrary, and the cultural sensitivity label is low cultural sensitivity, the matched routing target address is the service endpoint of the Lao translation model. In practical deployments, the Lao translation model can correspond to specialized models optimized for translation tasks between Lao and other languages, such as the T5 translation model based on the Transformer architecture, the iFlytek Spark ASEAN Multilingual LLM optimized for ASEAN languages, or the Sailor2 multilingual model based on the Qwen 2.5 architecture for continuous pre-training to support 15 languages ​​including Lao.

[0071] When the language type label is non-Lao (such as Chinese or English), the task type label is general dialogue or deep reasoning, the complexity level label is complex, and the cultural sensitivity label is low cultural sensitivity, the server matches the service endpoint of the general large parameter language model. In practical deployments, the general large parameter language model can correspond to a large parameter model with powerful reasoning capabilities and broad knowledge coverage, such as Llama-SEA-LION-v3-8B-IT or Gemma-SEA-LION-v3-9B-IT, as well as the SeaLLMs series of models.

[0072] When the cultural sensitivity label is set to "high cultural sensitivity," the original natural language request text is routed to the target processing model address corresponding to the pre-defined Lao localization big data model. In other words, during the routing decision phase, the cultural sensitivity label is independent of the other three dimensions and is a mandatory constraint. When the label is at a high level of cultural sensitivity, the conventional routing logic for language type, task type, and complexity level labels is ignored, and the request is forcibly routed to the Lao localization big data model for processing. This mandatory routing rule ensures that all requests involving core Lao cultural topics are processed by a dedicated model trained with Lao local cultural alignment, thus guaranteeing the correctness and security of the Lao big data model service platform at the cultural value level from a system architecture perspective.

[0073] An exact match query is performed on the routing rule table using the structured query key. If the exact match query succeeds, the routing destination address stored in the routing destination address field is extracted and used as the output address for this routing decision. If the exact match query fails, meaning there is no record in the routing rule table that exactly matches the current structured query key, a default routing destination address is determined according to a preset default routing strategy. This default routing strategy routes the request to a preset default target processing model address when no exact match rule exists. The default target processing model is a model with general processing capabilities, capable of handling any type of request to ensure uninterrupted service. During the query of the routing rule table, the value of the cultural sensitivity label is checked first. When the cultural sensitivity label is a high cultural sensitivity level label, a forced match is performed on the cultural sensitivity request-specific record in the routing rule table. The query key in this special record uses the high cultural sensitivity level label as the fourth field and matches any label value from the other three dimensions using wildcards. The corresponding routing destination address is the network address of the Lao language localization model. This forced matching logic is independent of the values ​​of the language type label, task type label, and complexity level label, ensuring that any request judged as having a high cultural sensitivity level by the fourth category header is not subject to the constraints of regular routing rules.

[0074] After determining the target routing address, the original natural language request text is encapsulated into a network request message conforming to the target model's service interface protocol according to that target routing address. This message is then sent to the service endpoint of the target processing model pointed to by the target routing address via network communication protocols. Upon receiving the request message, the target processing model performs inference processing, generates a response result, receives the response result returned by the target processing model, and sends it to the user terminal.

[0075] By setting up a routing rule table and storing the four-dimensional classification label combinations as the query key field and the corresponding model network address as the routing destination address field, the training and inference tasks of the classifier model are completely decoupled from the configuration and maintenance tasks of the routing strategy. Updates to both are independent and do not affect each other. When the model service architecture changes, such as adding a target processing model, replacing an old model service, adjusting the load balancing strategy of model instances, or switching deployment environments, only the routing destination address field in the routing rule table configuration file needs to be modified. There is no need to retrain the classifier model, improving operational efficiency and system stability when dealing with model deployment changes and routing strategy adjustments.

[0076] The Lao semantic classifier model in the embodiments of this specification includes a semantic encoding submodule built based on a Transformer encoder of a pre-trained language model and a multi-dimensional classification head submodule containing multiple parallel classification heads. The semantic encoding submodule contains the vast majority of parameters in the entire model, while the multi-dimensional classification head submodule has relatively fewer parameters. Under standard supervised training, large-scale Lao training data labeled with language type, task type, and complexity level labels is required, and all parameters of both the semantic encoding submodule and the multi-dimensional classification head submodule must be updated simultaneously using the backpropagation algorithm. However, Lao is a typical low-resource language, and publicly available high-quality multi-dimensional classification annotation data is extremely scarce. Obtaining large-scale annotation data requires significant manpower and time costs, and the language proficiency and classification judgment standards of the annotators are often insufficient to meet the training requirements on a large scale. If training is conducted using only limited Lao language labeled data, the hundreds of millions of parameters in the semantic encoding submodule will not converge sufficiently due to insufficient training samples. The multi-dimensional classification head submodule will also struggle to learn reliable classification decision boundaries due to a lack of adequate supervision signals. Consequently, the classification accuracy of the entire classifier model on Lao language requests will not meet the requirements of actual deployment.

[0077] To address the problem of insufficient training due to scarce labeled data, prior to step S101, this embodiment utilizes abundant labeled data from high-resource languages ​​with phonetic similarity to Lao. The classifier model is pre-trained using cross-lingual knowledge transfer, enabling the multi-dimensional classification head module to first learn cross-lingual shared classification decision-making capabilities on high-resource language data. Then, all parameters are jointly fine-tuned using a small-scale Lao labeled data, thereby achieving efficient training of the classifier model in low-resource language scenarios. The specific implementation process is as follows: The first step is to obtain the first labeled dataset for the first language, which is a high-resource language with phonetic similarity to Lao. In one example, the first language is Thai. Thai and Lao both belong to the Tai-Kadai language family, and they have a high degree of similarity in pronunciation, as well as similar phonological structures and tonal systems. Thai is a high-resource language with a large number of publicly available labeled datasets, including multi-dimensional classification labeled with language type, task type, complexity level, and cultural sensitivity labels. Next, a classifier model to be trained is constructed. This classifier model has the same structure as the deployment phase, including a semantic encoding submodule built based on a Transformer encoder of a pre-trained language model and a multi-dimensional classification head submodule containing multiple parallel classification heads. It should be noted that the pre-trained language model has been pre-trained on a general large-scale corpus, and its parameters possess general language understanding and semantic modeling capabilities.

[0078] The second step is to perform unified Romanization encoding and transcribing on the first language text in the first labeled dataset to generate a first language Romanized text sequence. Unified Romanization encoding and transcribing refers to converting each character or character combination in the Thai text into the corresponding Latin letter sequence according to the preset phoneme-to-Latin letter mapping rules. This conversion rule is independent of the original Thai writing system and is based entirely on the phoneme composition of the pronunciation, so that texts with similar pronunciations but different writing systems tend to be consistent after Romanization. After unified Romanization encoding and transcribing, a first language Romanized text sequence is generated, and each element in the Romanized text sequence corresponds to the Romanized representation of a Thai text.

[0079] The third step involves using the Romanized first-language text sequence and its corresponding first-language annotations as training samples to perform the first stage of supervised training on the multi-dimensional classification head module of the classifier model to be trained. Simultaneously, the original parameters of the semantic encoding submodule are frozen, thus determining the intermediate classifier model after the first stage of training. Specifically, in the first stage of training, all the original parameters of the semantic encoding submodule are frozen. That is, during the forward propagation calculation of the loss function and the backpropagation calculation of the gradient, the weight matrix and bias vector of each layer in the semantic encoding submodule do not participate in gradient updates, and their parameter values ​​remain at the original values ​​of the pre-trained language model. Only the Romanized text sequence from the training samples is input into the semantic encoding submodule, which encodes it into a semantic representation vector. The multi-dimensional classification head module then outputs the predicted multi-dimensional classification label combination based on this semantic representation vector. The prediction results are compared with the corresponding first-language annotations. The sum of the loss functions of each classifier in the multi-dimensional classification head submodule is calculated. The gradient of the loss function with respect to each weight matrix and bias vector in the multi-dimensional classification head submodule is calculated using the backpropagation algorithm. The gradient descent optimization algorithm is used to iteratively update all trainable parameters in the multi-dimensional classification head submodule along the gradient direction until the loss function converges. After the first stage of training, the intermediate classifier model is determined. The parameters of the semantic encoding submodule in the intermediate classifier model are completely consistent with the original parameters of the semantic encoding submodule in the classifier model to be trained. The parameters of the multi-dimensional classification head submodule have been optimized based on Thai annotation data.

[0080] The fourth step involves obtaining a second Lao-annotated dataset, smaller than the first. Each sample in this dataset includes Lao text and its corresponding language type label, task type label, complexity level label, and cultural sensitivity label. Then, the Lao text in this second-annotated dataset is transcribed using the unified Romanization encoding, which converts the Lao text into the corresponding Latin letter sequence according to the same phoneme-to-Latin letter mapping rules, generating a Lao Romanized text sequence.

[0081] The fifth step involves using the Lao Romanized text sequence and its corresponding second-language annotations as training samples. A second phase of joint supervised fine-tuning training is then performed on the semantic encoding submodule and the multi-dimensional classification head submodule of the intermediate classifier model to determine the completed Lao semantic classifier model. Specifically, in the second phase of training, the original parameters of the semantic encoding submodule are unfrozen, meaning all parameters in both the semantic encoding submodule and the multi-dimensional classification head submodule participate in gradient updates. The Romanized text sequence from the training samples is input into the semantic encoding submodule of the intermediate classifier model, which encodes it into a semantic representation vector. The multi-dimensional classification head submodule outputs the predicted multi-dimensional classification label combination based on this semantic representation vector. The prediction results are compared with the corresponding second-language annotations, and the sum of the loss functions of each classification head is calculated. The gradient of the loss function with respect to all trainable parameters in the semantic encoding submodule and the multi-dimensional classification head submodule is calculated using the backpropagation algorithm. The gradient descent optimization algorithm is then used to iteratively update all parameters along the gradient direction until the loss function converges. In the second stage of training, since the Romanized Lao text and the Romanized Thai text share the same Latin alphabet representation space, the classification decision boundary of the multi-dimensional classification head module, which has already been trained on Thai data, can be directly transferred to the Lao task. The semantic encoding submodule only needs to adapt to the specificities of Lao in terms of vocabulary distribution and expression habits during joint fine-tuning, without needing to learn the classification task itself from scratch. After the second stage of training, the trained Lao semantic classifier model is determined.

[0082] Through the two-stage transfer training described above, the Lao semantic classifier model can achieve a high classification accuracy by making full use of the rich annotation data of the high-resource language Thai, even when Lao annotation data is extremely limited. This fundamentally solves the technical problem of insufficient training data for classifier models in low-resource language scenarios.

[0083] In the actual operation of the multi-model intelligent routing service platform, some requests may be routed to a general-purpose large-parameter language model due to deviations in the classification labels output by the classification header. The training corpus of the general-purpose large-parameter language model is primarily English and Chinese, and its understanding of Lao local culture, history, and sensitivity to culturally related topics is far less than that of a specially trained and aligned Lao localization model. When the classifier model routes highly culturally sensitive requests to the general-purpose large-parameter language model due to classification errors, the response returned by the model may contain biases, errors, or inconsistencies at the level of cultural values, negatively impacting the localization needs of Lao users.

[0084] Therefore, in the embodiments of this specification, when the target processing model corresponding to the routing target address is a general large parameter language model, the method further includes: First, the response result returned by the general large-parameter language model is obtained to evaluate the cultural alignment quality of the response result and determine its cultural alignment quality score. Specifically, the original natural language request text and the response result returned by the general large-parameter language model are input into a pre-trained cultural alignment quality discriminator. This discriminator is independent of the Lao semantic classifier model and is a specially trained binary classification neural network model. Its input includes a concatenated sequence of request and response texts, and its output is a continuous numerical value within a preset range. This numerical value represents the degree of alignment between the response result and the local Lao cultural cognition at the level of cultural values.

[0085] It should be noted that the culture alignment quality discriminator is a binary classification neural network model based on a Transformer encoder. Its structure, from the input layer to the output layer, includes an input embedding layer, a positional encoding layer, a Transformer encoder, a pooling layer, a fully connected layer, and an output layer. The input embedding layer receives a concatenated sequence of the original natural language request text and the response text returned by a general large-parameter language model. This concatenated sequence combines the two texts into a single complete character sequence, with the request text preceding the response text, and inserts a predefined separator between the two texts. The input embedding layer converts each character in the concatenated sequence into a corresponding initial embedding vector, the dimension of which is determined by the network structure parameters of the culture alignment quality discriminator. The positional encoding layer generates a corresponding positional encoding vector for each position in the concatenated sequence and performs element-wise addition of the initial embedding vector for each position with the corresponding positional encoding vector to generate an encoded input vector carrying positional information. The Transformer encoder consists of multiple stacked Transformer encoding layers. Each encoding layer contains a multi-head self-attention sub-layer and a feedforward neural network sub-layer. The Transformer encoder receives a sequence of encoded input vectors and establishes bidirectional semantic dependencies between positions across the entire sequence through a multi-head self-attention mechanism. After processing by multiple encoding layers, it outputs the hidden state vector corresponding to each position in the concatenated sequence. Pooling layers perform pooling operations on the hidden state vectors at all positions output by the Transformer encoder. The pooling operation is either mean pooling or max pooling, aggregating the hidden state vectors at all positions into a fixed-dimensional sequence representation vector. Fully connected layers perform a linear transformation on the sequence representation vector, mapping it to a feature space of a preset dimension. The output layer performs a linear transformation on the output of the fully connected layer, mapping the feature space vector to a two-dimensional output vector. The two dimensions of the two-dimensional output vector correspond to the two categories of high cultural alignment quality and low cultural alignment quality, respectively. The output layer inputs the two-dimensional output vector into a normalized exponential function, which transforms the two-dimensional output vector into a two-dimensional probability distribution. The two values ​​in the two-dimensional probability distribution represent the probability that the input sample belongs to the high cultural alignment quality category and the probability that it belongs to the low cultural alignment quality category, respectively.

[0086] All trainable parameters of the cultural alignment quality discriminator are obtained through supervised learning on a pre-labeled training dataset. After training, the cultural alignment quality discriminator can output a corresponding two-dimensional probability distribution for any concatenated sequence of input request and response texts. The probability value corresponding to the high cultural alignment quality category in this two-dimensional probability distribution is used as the cultural alignment quality score.

[0087] The training data for the cultural alignment quality discriminator comes from the response results generated by the Lao localization model and the general large-parameter language model on the same set of test requests. The test requests are selected and constructed by annotators according to pre-defined test set construction criteria, ensuring that the test requests cover various culture-related topics that the Lao language model service platform may encounter in actual operation. For each test request, the annotators compare the response results generated by the Lao localization model and the general large-parameter language model in pairs. Based on pre-defined cultural alignment quality evaluation criteria, they independently determine the degree of alignment between each response result and Lao local cultural perception at the cultural value level, and assign a corresponding cultural alignment quality score to each response result. This cultural alignment quality score is a non-binary continuous numerical value or a graded numerical value, with a value range within a pre-defined interval. A higher value indicates a higher cultural alignment quality of the response result. The annotation criteria clearly specify the specific dimensions of evaluation, including whether the response content accurately reflects the generally accepted perceptions in Lao local cultural fields, whether the response content contains statements that contradict Lao local cultural perceptions, and whether the response content maintains an appropriate stance and uses standard terminology when dealing with core cultural topics.

[0088] During the above annotation process, not all responses generated by the general large parameter language model (GML) were labeled with low cultural alignment quality scores. When the test request involved content consistent with the distribution of the GML's training corpus and did not involve core topics of Lao local culture—for example, requests asking about general scientific knowledge, mathematical calculations, or general facts not specific to Laos—the GML's response scores were similar to those of the Lao localization model in the cultural alignment quality dimension. The GML was only labeled with low cultural alignment quality scores when it involved core topics such as Lao local culture and history, and when its training corpus lacked corresponding knowledge or contained errors.

[0089] Based on the labeled training data, a training dataset containing a large number of positive and negative samples is constructed. Positive samples are responses labeled with high cultural alignment quality scores (regardless of whether they originate from a large-scale Lao localization model or a general large-parameter language model), while negative samples are responses labeled with low cultural alignment quality scores. Using this training dataset, a cultural alignment quality discriminator is trained through supervised learning, learning the discriminative mapping relationship from the concatenated sequence of request and response texts as input to the cultural alignment quality score output. After training, the cultural alignment quality discriminator can output continuous numerical values ​​representing the cultural alignment quality level for any input request and response.

[0090] Second, the cultural alignment quality score is compared with a preset quality threshold. If the cultural alignment quality score is not less than the preset quality threshold, it indicates that the response returned by the general large parameter language model meets the requirements in terms of cultural alignment quality, and the routing process ends. When the cultural alignment quality score is lower than the preset quality threshold, the semantic representation vector of the original natural language request text is associated with the corresponding negative sample label and stored in the negative sample pool. The negative sample pool is a pre-allocated storage area in the server storage medium used to accumulate and store the semantic representation vectors of requests judged to have low cultural alignment quality.

[0091] Third, according to a preset sampling period, negative samples are periodically sampled from the negative sample pool to construct an incremental training dataset after mixing the negative samples with positive samples. This incremental training dataset is then used to perform incremental fine-tuning training on the Lao semantic classifier model to update its parameters. Specifically, the preset sampling period is a fixed time interval. At the end of each sampling period, a preset number of negative samples are randomly sampled from the negative sample pool, and the same number of positive samples are sampled from the positive sample pool. The positive sample pool stores the semantic representation vectors of requests routed to the Lao localization model with cultural alignment quality scores higher than a preset quality threshold. After mixing the sampled negative and positive samples, an incremental training dataset is constructed. Each sample in the incremental training dataset includes a semantic representation vector and its corresponding cultural alignment quality label. This incremental training dataset is then used to perform incremental fine-tuning training on the multi-dimensional classification head submodule of the Lao semantic classifier model. During incremental fine-tuning training, the semantic representation vector is input into the multi-dimensional classification head submodule of the Lao semantic classifier model, but only the forward and backward propagation computation paths of the fourth classification head are activated. The fourth classification head outputs the predicted probability distribution of cultural sensitivity labels, and the loss function value between the predicted probability distribution and the cultural alignment quality label is calculated. The gradient of the loss function with respect to the weight matrix and bias vector of the fourth classification head is calculated using the backpropagation algorithm. The values ​​of the weight matrix and bias vector of the fourth classification head are updated along the gradient direction using the gradient descent optimization algorithm. During this process, the weight matrices and bias vectors of the first, second, and third classification heads do not participate in the forward propagation calculation, loss function calculation, or backpropagation gradient calculation; their parameter values ​​remain unchanged during incremental fine-tuning training. This process is iteratively executed until the loss function on the incremental training dataset converges, completing this round of incremental fine-tuning training. After incremental fine-tuning training is completed, the sampled negative samples are removed from the negative sample pool to avoid overfitting caused by resampling, and the positive sample pool is updated to prepare data for the next sampling period of incremental training.

[0092] The above-described at least one technical solution adopted in the embodiments of this specification can achieve the following beneficial effects: By defining a standard lexical sequence, the subsequent semantic encoding submodule can perform global semantic modeling on a unified lexical identifier sequence, transforming the request from a raw character sequence into a numerical input form that can be processed by the Transformer encoder. The process of defining the standard lexical sequence ensures that each valid character in the Lao request can be converted into a corresponding lexical identifier, eliminating situations where characters are ignored or mismatched due to the rule lexicon not being covered, thus guaranteeing the integrity and accuracy of the request text at the input level. Through the pre-trained language model Transformer encoder in the semantic encoding submodule, the request text is converted into a fixed-dimensional semantic representation vector, preserving the comprehensive semantic information of the lexical after global semantic interaction, fundamentally solving the technical problem of the poor adaptability of the fixed rule scheme to the diversity of Lao natural language requests. Meanwhile, the semantic encoding submodule has a much smaller parameter count than general large-parameter language models. The inference latency and computational resource consumption introduced during the routing phase are within acceptable limits and will not become a performance bottleneck for the entire service chain. By using multiple independent classification heads in parallel within the multi-dimensional classification head submodule, multi-dimensional classification predictions are performed simultaneously on the same semantic representation vector, ensuring decoupling between multi-dimensional classification results and avoiding the computational resource overhead of deploying a separate encoder for each dimension. This achieves a balance between classification precision and computational efficiency. By aggregating multi-dimensional classification labels into a multi-dimensional classification label combination and querying the routing rule table, the optimal model matching all dimensions of the request can be accurately selected from multiple target processing models, realizing joint routing decisions based on multi-dimensional information. This solves the technical problem of insufficient semantic understanding depth and inadequate adaptation to low-resource language specificities in existing routing schemes, leading to difficulty in guaranteeing decision accuracy. It achieves refined, accurate, and maintainable multi-model routing decisions in the low-resource language scenario of Lao, ensuring the quality of various request processing while achieving efficient utilization of computational resources and effective control of response latency.

[0093] Figure 2 A flowchart illustrating another multi-model intelligent routing method for Lao language scenarios provided in the embodiments of this specification is shown below. Figure 2As shown, firstly, the system receives the user's original natural language request text, performs Unicode encoding normalization, and then performs tokenization according to the vocabulary of the pre-trained language model on which the classifier model is based, converting the text into a token ID sequence. Sequences exceeding the model's maximum input length are truncated, and sequences shorter than the maximum length are padded, generating a fixed-format token sequence which is then fed into the lightweight semantic encoding submodule. Next, the token sequence is input into the lightweight pre-trained language model (this model is fine-tuned from a small-parameter pre-trained language model on Lao and multilingual semantic classification annotation data). Global semantic modeling is performed on the input sequence using the Transformer encoder's multi-head self-attention mechanism, extracting the hidden state vector h corresponding to the [CLS] marker position as the semantic representation of the request text. The multi-dimensional classification head submodule contains three parallel linear classification heads, each receiving a semantic representation vector h and performing independent classification predictions: Classification head one performs request language type identification, outputting the classification probability distribution for Lao / Chinese / English / mixed languages / other languages; Classification head two performs task type classification, outputting the classification probability distribution for local knowledge query / general dialogue / translation task / deep reasoning / others; Classification head three performs request complexity evaluation, outputting the classification probability distribution for simple / medium / complex tasks. Each classification head takes the label corresponding to the highest probability as the classification result for its dimension, and these are aggregated to generate a multi-dimensional classification label combination. The routing decision submodule, based on the multi-dimensional classification label combination output from the above steps, queries a pre-set routing rule table to determine the routing target for this request: requests with Lao language type and task type of local knowledge query are routed to the Lao localization model; requests with Lao language type and task type of translation are routed to the Lao translation model; and requests with Chinese / English language type and complex task type are routed to the general large-parameter language model.

[0094] This specification also provides an embodiment of a multi-model intelligent routing device for Lao language scenarios, such as... Figure 3 As shown, the device includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform the above-described method.

[0095] This specification also provides a non-volatile computer storage medium storing computer-executable instructions configured to perform the above-described method.

[0096] The various embodiments in this specification are described in a progressive manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the embodiments of apparatus, devices, and non-volatile computer storage media are basically similar to the method embodiments, so the descriptions are relatively simple; relevant parts can be referred to the descriptions of the method embodiments.

[0097] The above description is merely one or more embodiments of this specification and is not intended to limit this specification. Various modifications and variations can be made to the one or more embodiments of this specification by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principle of one or more embodiments of this specification should be included within the scope of the claims of this specification.

Claims

1. A multi-model intelligent routing method for Lao-language scenarios, characterized in that, The method is applied to an intelligent routing service platform, which deploys a Lao semantic classifier model and multiple target processing models. The Lao semantic classifier model includes a semantic encoding submodule and a multi-dimensional classification head submodule. The method includes: Receive the original natural language request text sent by the user terminal, determine the standard lexical sequence corresponding to the original natural language request text, and perform global semantic modeling on the standard lexical sequence through the semantic encoding submodule to determine the semantic representation vector of the original natural language request text; The multi-dimensional classification head module performs multi-dimensional classification prediction on the semantic representation vector to determine the corresponding multi-dimensional classification label combination, wherein the multi-dimensional classification label combination includes language type label, task type label and complexity level label; Based on the multi-dimensional classification label combination, a pre-set routing rule table is queried to determine the routing target address corresponding to the target processing model, and the original natural language request text is routed to the target processing model for inference according to the routing target address.

2. The multi-model intelligent routing method for Lao language scenarios according to claim 1, characterized in that, Determining the standard lexical sequence corresponding to the original natural language request text specifically includes: The original natural language request text is encoded and normalized to generate a normalized request text; The normalized request text is input into the semantic encoding submodule. The normalized request text is then processed by word tokenization using the vocabulary of the pre-trained language model in the semantic encoding submodule, generating a word token sequence. The sequence length of the lexical identifier sequence is adapted to generate a standard lexical sequence of a preset fixed length.

3. The multi-model intelligent routing method for Lao language scenarios according to claim 2, characterized in that, The normalized request text is lexicalized using the vocabulary of the pre-trained language model preset in the semantic encoding submodule to generate a lexical identifier sequence, specifically including: When the language type of the normalized request text is Lao, the normalized request text is processed by standardizing the lexicon according to the vocabulary of the pre-trained language model, and it is determined whether there are any unregistered characters in the normalized request text that meet the preset requirements. The unregistered characters that meet the preset requirements are characters whose corresponding lexicon identifiers cannot be found in the vocabulary. If the unregistered character does not exist, the first token identifier sequence generated by the standard tokenization process is used to determine the token identifier sequence; If the unregistered characters exist, the normalized request text will be matched with the syllable entries in the pre-stored Lao syllable dictionary according to the preset longest string matching algorithm; Starting from the beginning of the normalized request text, the longest syllable is matched sequentially. The successfully matched syllables are used as syllable units in the syllable sequence until all characters of the normalized request text have been matched. The normalized request text is then divided into syllable sequences according to syllable boundaries. Each syllable in the syllable sequence is subjected to character-level lexicalization to generate a second lexical identifier sequence; The lexical identifiers corresponding to the unregistered characters in the first lexical identifier sequence are replaced with the corresponding character-level lexical identifiers in the second lexical identifier sequence to generate a multi-granularity fused lexical identifier sequence, thereby determining the lexical identifier sequence.

4. The multi-model intelligent routing method for Lao language scenarios according to claim 1, characterized in that, The multi-dimensional classification head submodule includes multiple classification heads connected in parallel. Through this submodule, multi-dimensional classification prediction is performed on the semantic representation vector to determine the corresponding multi-dimensional classification label combination. Specifically, this includes: The semantic representation vector is linearly transformed by each classification head, and the probability distribution of the original natural language request text in the corresponding tag type dimension is determined by mapping through a preset normalized exponential function. The tag type dimension includes language type dimension, task type dimension and complexity level dimension. Based on the label type corresponding to the highest probability value in each probability distribution, determine the classification label corresponding to each label type dimension to generate the multi-dimensional classification label combination.

5. A multi-model intelligent routing method for Lao language scenarios according to claim 4, characterized in that, The semantic representation vector is linearly transformed using each classification head, and the probability distribution of the original natural language request text in the corresponding tag type dimension is determined by mapping using a preset normalized exponential function. Specifically, this includes: When the tag type dimension is the complexity level dimension, dependency parsing is performed on the normalized request text to generate a dependency relation set, and a dependency tree with the core predicate as the root node is constructed based on the dependency relation set. Calculate the number of edges in the longest path from the root node to the farthest leaf node of the dependency tree, and use the number of edges to determine the depth feature value of the dependency syntax tree; Obtain the word position index of each word in the normalized request text, and the head word position index of the head word corresponding to each word in the dependency tree; The dependency arc length of a word is determined by the absolute value of the difference between the word position index of each word and the head word position index of the head word. The arithmetic mean of the dependency arc lengths of multiple words in the normalized request text is calculated, and the average dependency arc length feature value is determined by the arithmetic mean. Phrase structure analysis is performed on the normalized request text to identify noun phrases and verb phrases in the normalized request text; The number of phrase modifiers within the internal modifiers of each noun phrase and verb phrase is counted, and the maximum value of the number of all phrase modifiers is used to determine the modification chain length feature value; The syntactic feature sub-vectors in the semantic representation vector are determined by the dependency syntax tree depth feature value, the average dependency arc length feature value, and the modification chain length feature value. The syntactic feature vector is concatenated with the semantic representation vector to generate an enhanced feature vector. The enhanced feature vector is then linearly transformed and mapped using a preset normalization exponential function to determine the probability distribution of the original natural language request text at each preset complexity level.

6. The multi-model intelligent routing method for Lao language scenarios according to claim 1, characterized in that, The method further includes: Obtain the first labeled dataset for the first language, which is a high-resource language with phonetic similarity to Lao; Construct a classifier model to be trained, wherein the classifier model to be trained includes a semantic encoding submodule constructed based on a Transformer encoder of a pre-trained language model and a multi-dimensional classification head submodule containing multiple classification heads in parallel; The first language text in the first labeled dataset is transcribed using unified Romanization encoding to generate a sequence of first language Romanized text. Using the first language Romanized text sequence and the corresponding first language annotation label as training samples, the first stage of supervised training is performed on the multi-dimensional classification head sub-module in the classifier model to be trained, while keeping the original parameters of the semantic encoding sub-module frozen, and the intermediate classifier model after the first stage of training is determined. Obtain the second labeled dataset of Lao, and perform unified Romanization encoding on the Lao text in the second labeled dataset to generate a Lao Romanized text sequence. Using the Lao Romanized text sequence and the corresponding second language annotation labels as training samples, the semantic encoding submodule and the multi-dimensional classification head submodule of the intermediate classifier model are subjected to a second stage of joint supervised fine-tuning training to determine the Lao semantic classifier model after training.

7. The multi-model intelligent routing method for Lao language scenarios according to claim 1, characterized in that, The multi-dimensional classification label combination also includes cultural sensitivity labels, and the method further includes: The semantic representation vector is input into a pre-trained cultural sensitivity classifier. After the cultural sensitivity classifier performs a linear transformation on the semantic representation vector, it is mapped by a preset normalized exponential function to determine the probability distribution of the original natural language request text at each preset cultural sensitivity level. The cultural sensitivity label is determined by the label corresponding to the cultural sensitivity level with the highest probability value in the probability distribution. When the cultural sensitivity label is high cultural sensitivity, the original natural language request text is routed to the target processing model address corresponding to the preset Lao localization big model.

8. The multi-model intelligent routing method for Lao language scenarios according to claim 1, characterized in that, The target processing model includes a general large-parameter language model, a Lao localization large-parameter model, and a Lao translation model. When the target processing model corresponding to the routing target address is a general large-parameter language model, the method further includes: Obtain the response results returned by the general large parameter language model, evaluate the cultural alignment quality of the response results, and determine the cultural alignment quality score of the response results; The cultural alignment quality score is compared with a preset quality threshold. When the cultural alignment quality score is lower than the preset quality threshold, the semantic representation vector of the original natural language request text is associated with the corresponding negative sample label and stored in the negative sample pool. According to a preset sampling period, negative samples are periodically sampled from the negative sample pool to construct an incremental training dataset by mixing the negative samples with positive samples. The Lao semantic classifier model is incrementally fine-tuned using the incremental training dataset to update the parameters of the Lao semantic classifier model.

9. A multi-model intelligent routing device for Lao-language scenarios, characterized in that, The device includes: At least one processor; and, A memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the method as described in any one of claims 1-8.

10. A non-volatile computer storage medium storing computer-executable instructions, characterized in that, The computer-executable instructions are configured to perform the method as described in any one of claims 1-8.