A method for constructing a semantic matching model in a multilingual search system

By employing a dual-path architecture of a multilingual adapter network and a unified language semantic matching network, combined with multi-stage training and error sample resampling, the problem of modeling language commonalities and differences in multilingual search systems is solved, thereby improving the semantic matching accuracy and robustness of multilingual search systems, especially in low-resource languages.

CN120687568BActive Publication Date: 2026-03-06TIANJIN UNIV
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202510790767.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-06-13
Publication Date
2026-03-06
Estimated Expiration
2045-06-13

AI Technical Summary

Technical Problem

The semantic matching models of existing multilingual search systems fail to effectively take into account the commonalities and differences of multiple languages, resulting in poor performance in multilingual search scenarios, especially for low-resource languages.

Method used

A dual-path architecture of multilingual adapter network and unified language semantic matching network is adopted. Through multi-stage training and error sample resampling, multilingual encoder and English encoder are combined to model the commonalities and differences of languages ​​respectively, and feature representation is optimized by fusion network.

Benefits of technology

It significantly improves the semantic matching accuracy and robustness of multilingual search systems, especially in low-resource languages, and overcomes the problems of language feature loss and translation errors in traditional methods. It is suitable for search scenarios that require rapid coverage of multiple languages ​​and have limited resources.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120687568B_ABST
    Figure CN120687568B_ABST
Patent Text Reader

Abstract

This invention discloses a semantic matching model and method for constructing a multilingual search system. The semantic matching model includes a multilingual adapter network, a first fully connected network classifier, a unified language semantic matching network, a second fully connected network classifier, a fusion layer, and a third fully connected network classifier. The multilingual adapter network includes a multilingual encoder and an adapter group. The unified language semantic matching network includes an English encoder and a translator. The fusion layer and the third fully connected network classifier constitute a fusion network. The method involves: establishing a relationship between a target label and a first predicted label; establishing a relationship between a target label and a second predicted label; and establishing a relationship between a target label and a final predicted category. As the semantic matching result adopted by the search system, this invention can fully explore the commonalities among multiple languages ​​while taking into account the differences between them, ensuring the accuracy of semantic search.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the technical field of search engines, and in particular relates to a semantic matching model and method for constructing a multilingual search system. Background Technology

[0002] A multilingual search system refers to a system that, in response to a user's search terms (also called a query) in an input box, searches for and identifies relevant results from a candidate set of documents (also called documents) and returns them to the user. The system can use various languages ​​to express both the search term set and the document set. Common search systems include processes such as search intent analysis, search recall, relevance modules, and ranking modules (as follows). Figure 3 The relevance score measures the degree to which the returned results meet the user's query needs and is one of the main performance indicators of a search system.

[0003] The methods for calculating relevance can be divided into two categories: (1) Literal matching. This method was mostly used in early search engines. It analyzes the set of words that make up the query, Q, and the set of words that make up the document, D, and calculates the features such as the same words and the position / order of words between sets Q and D to comprehensively evaluate whether the query and the document are related [Reference 1]; (2) Semantic matching model. With the development of deep learning technology, this method has become popular. It maps the query and the document to a vector semantic space, and then calculates the relevance through a deep semantic matching model to give the judgment [Reference 2, Reference 3]. Furthermore, thanks to pre-training technology [Reference 4], one of the most successful paradigms of semantic matching models today is to fine-tune it using high-quality datasets in the field based on pre-trained open-source models.

[0004] Text matching model

[0005] As a type of text matching model, semantic relevance model has become a core technology for text matching tasks (such as semantic similarity calculation, question-answer pair matching, and information retrieval). Text matching tasks require calculating the relevance score of two texts. In a search system, the two texts correspond to the user's search term (query) and candidate document (document), respectively. The relevance calculation methods can be divided into two categories: (1) Literal matching. This method analyzes the set of constituent words Q of the query and the set of constituent words D of the document. By calculating the same words between sets Q and D, the position / order of word occurrence, and other feature indicators, it comprehensively evaluates whether the query and document are related [Reference 1]. The advantage of this method is that it is simple and highly interpretable. The disadvantage is that it follows the literal word method and cannot solve the problem of words that are different but synonymous or similar; (2) Semantic relevance model. It maps the query and document to the same semantic vector space and then models it through a deep semantic matching model to give the relevance judgment [Reference 2, Reference 3]. This method solves the shortcomings of literal matching and is more friendly to the synonymous and similar relationships of words or sentences. The model effect is generally better than literal matching.

[0006] Pre-training techniques: Typical examples in the field of natural language processing are BERT and GPT. They obtain deep learning models (pre-trained models) through weakly supervised learning on large-scale corpora. For subsequent domain-specific tasks, only fine-tuning (training) of this model using domain-specific data is needed, making it easier to achieve better performance. Among these:

[0007] pre-trained model

[0008] In the field of natural language processing, pre-training techniques have been widely studied in recent years, resulting in a number of pre-trained models, with BERT (Bidirectional Encoder Representations from Transformers) [Reference 5] as a representative. The process of adapting a pre-trained model to a specific domain can be divided into two stages. In the first stage, called the "pre-training" stage, the model obtained is called the "pre-trained model." The pre-trained model acquires general semantic representation capabilities through self-supervised learning on massive amounts of unlabeled data. It is particularly important to note that the model in this stage focuses on general language capabilities and is often trained using publicly available corpora. Many of the resulting models have been open-sourced and can be used directly as base models for downstream tasks. In the second stage, called the "fine-tuning" stage, based on the pre-trained model obtained in the first stage, a better domain model can be obtained by improving and adapting the model and continuously training it under supervision on high-quality domain data. Thanks to the development of pre-training techniques, one of the most successful paradigms of semantic relevance models today is also based on pre-trained open-source models, fine-tuned using high-quality domain (query, document) datasets. Unlike single text scenarios, the input format for the pre-trained model of the text matching (query, document) dataset is "[CLS]query[SEP]document", where [CLS] and [SEP] are custom special characters for the BERT [Reference 5] pre-trained model.

[0009] Multilingual semantic model

[0010] Current multilingual semantic models tend to focus more on the commonalities of languages, neglecting their differences; compared to semantic models for a single language, their performance is often slightly worse. The pre-trained model BERT has single-language versions, such as the English version BERT [Reference 5] and the Chinese version BERT [Reference 6]; it also has open-source versions compatible with multiple languages, such as multi-lingual BERT [Reference 7]. Compared to single-language models, multi-lingual BERT uses massive amounts of unlabeled data from multiple languages ​​in the first stage—pre-training—while the model structure remains largely unchanged. Because it doesn't address the differences between languages, multi-lingual BERT performs poorly in the second stage of domain-specific fine-tuning for a single language. For example, fine-tuning in the English domain often yields worse results than the English version of BERT, and fine-tuning in the Chinese domain often yields worse results than the Chinese version of BERT. To obtain a unified semantic relevance model for multiple languages, (1) fine-tuning based on multi-lingual BERT using multilingual data within the domain can be considered a relatively easy solution, but it will not achieve the same effect as fine-tuning a single-language BERT. (2) Another possible solution is to uniformly translate the multilingual inputs into English or Chinese, and then perform a second-stage fine-tuning based on the English or Chinese version of BERT, but this solution will lose the differences brought about by the linguistic characteristics of different languages. Therefore, a better solution would be to combine the above two solutions.

[0011] In summary, most existing text matching methods are designed for a single language, and those that can handle multiple languages ​​simply aggregate multilingual datasets. They fail to tailor models to the specific characteristics of multilingual search scenarios (the commonalities and differences between languages). Therefore, constructing a semantic matching model that is widely applicable and accurate in a multilingual search system is a pressing technical problem that those skilled in the art must address. Summary of the Invention

[0012] To address the technical problems existing in the prior art, this invention provides a method for constructing a semantic matching model for a multilingual search system. This invention, through a customized multilingual adapter model, can fully exploit the commonalities among multiple languages ​​while also taking into account their differences, thereby improving the interrelationship of matching for each language in the multilingual search system and ensuring the accuracy of semantic search. Furthermore, considering the more in-depth and extensive research on English models, this invention, through a unified language model, facilitates the use of the more performant open-source English model, further enhancing the performance of the multilingual search system.

[0013] To address the problems of the existing technology, the present invention adopts the following technical solution:

[0014] A semantic matching model for constructing a multilingual search system is proposed. The semantic matching model includes a multilingual adapter network, a first fully connected network classifier, a unified language semantic matching network, a second fully connected network classifier, a fusion layer, and a third fully connected network classifier. The multilingual adapter network includes a multilingual encoder and an adapter group. The unified language semantic matching network includes an English encoder and a translator. The fusion layer and the third fully connected network classifier constitute a fusion network.

[0015] The multilingual adapter network obtains first semantic feature representation vectors for multiple languages ​​while preserving the original language types.

[0016] The first fully connected network classifier obtains the first predicted class probability based on the first semantic feature representation vector. With the first prediction label Establish the first prediction label Based on the correspondence with the target label, adjust the multilingual adapter network and the first fully connected network classifier;

[0017] The unified language semantic matching network translates multiple languages ​​into English to obtain a second semantic feature representation vector in the same English semantic space;

[0018] The second fully connected network classifier obtains the second predicted class probability based on the second semantic feature representation vector. With the second prediction label Establish a second prediction label Based on the relationship with the target label, adjust the unified language semantic matching network and the second fully connected network classifier;

[0019] The fusion layer concatenates the first semantic feature representation vector with the second semantic feature representation vector to obtain a third semantic feature representation vector.

[0020] The third fully connected network classifier outputs the final predicted class probability based on the third semantic feature representation vector. With final prediction label Establish final prediction labels Based on the correlation with the target label, adjust the third fully connected network classifier. As a result of semantic matching.

[0021] Furthermore, the process by which the multilingual adapter network obtains the first semantic feature representation vector for multiple languages ​​while preserving the original language type includes:

[0022] The multilingual encoder inputs the character [CLS]query. i [SEP]documenti Encode the data and output a one-dimensional vector representation of A, where [CLS] and [SEP] are custom special characters;

[0023] The adapter group selects the corresponding adapter B according to the language type i, performs a term-by-term product operation with the one-dimensional vector representation A, and outputs a one-dimensional vector representation C. Adapter B is a one-dimensional weight vector with a one-to-one mapping relationship to a certain language type. All elements of this vector are initialized to 1 before training. The specific definition of the term-by-term product operation is as follows.

[0024] For two vectors A = [a1, a2, ..., a...] n ] and B = [b1,b2,…,b n The term-by-term product of A and B yields the first semantic feature representation vector C; that is: [a1b1, a2b2, ..., a n b n ].

[0025] This invention can also be implemented using the following technical solution, including the following steps:

[0026] Step 1: Collect training data in N languages ​​to construct a semantic raw training set; each data point in the semantic raw training set contains features: language identifier, query text, document text, and label;

[0027] Step 2: Train the multilingual adapter network and the first fully connected network classifier based on the original training set using the following loss function;

[0028]

[0029] in, Here, [y1, y2, y3] represents the predicted class probabilities of the first fully connected network classifier, and [y1, y2, y3] represents the class probabilities corresponding to the target label. The following correspondence holds: when label = k, y1, y2, y3, y3, y4, y5, y6, y7, y8, y9, y1, y2, y3, y4, y9, k =1; when label≠k, y k =0, k can only take the values ​​0, 1 or 2; loss1 is the value of the loss function, and the goal of the training process is to make loss1 smaller and smaller;

[0030] Step 3: Using the trained multilingual adapter network, predict the original training set samples and extract each original training result.

[0031] The predicted output of the training set samples is used to construct the first semantic feature representation vector;

[0032] Step 4: Using the trained multilingual adapter network and the first fully connected classifier, predict the original training set samples. Repeat sampling the samples with incorrect predictions at a ratio of 1:2, and sample the samples with correct predictions at a ratio of 1:1 to obtain an improved training set.

[0033] Step 5: Train the unified language semantic matching network and the second fully connected network classifier based on the improved training set and the following loss function;

[0034]

[0035] in, Here, [y1, y2, y3] represents the predicted class probabilities of the second fully connected network classifier, and [y1, y2, y3] represents the class probabilities corresponding to the target label. The following correspondence holds: when label = k, yk = 1; when label ≠ k, yk = 1. k =0, k can only take the values ​​0, 1 or 2; loss2 is the value of the loss function, and the goal of the training process is to make loss2 smaller and smaller;

[0036] Step 6: Using the trained unified language semantic matching network, predict the original training set samples, and extract the prediction output of each original training set sample to construct the second semantic feature representation vector.

[0037] Step 7: Based on steps 3 and 6, each sample in the original training set has a first semantic feature representation vector and a second semantic feature representation vector. The fusion layer concatenates the first and second semantic feature representation vectors and trains the third fully connected classifier according to the following loss function:

[0038]

[0039] in, Here, [y1, y2, y3] represents the predicted class probabilities of the third fully connected network classifier, and [y1, y2, y3] represents the class probabilities corresponding to the target label. The following correspondence holds: when label = k, y1, y2, y3, y3, y4, y5, y6, y7, y8, y9, y1, y2, y3, y4, y9, k =1; when label≠k, y k =0, k can only take the values ​​0, 1 or 2; loss is the value of the loss function, and the goal of the training process is to make the loss smaller and smaller.

[0040] Beneficial effects

[0041] This invention resolves the contradiction between semantic unification and feature preservation in multilingual systems through an adapter + translation dual-path architecture, and significantly improves the ability to handle difficult samples by combining phased progressive training. Compared with traditional solutions, it has breakthrough advantages in low-resource language support, model expansion efficiency, and semantic robustness, and is particularly suitable for search scenarios that require rapid coverage of multiple languages ​​and are resource-constrained. Specifically:

[0042] 1. This invention strikes a balance between unified multilingual modeling and language feature preservation. It employs a multilingual adapter network: the encoder output (A⊙B) is dynamically adjusted via a language-specific adapter B, preserving language features while sharing the backbone network. Unified language semantic space alignment: a translator maps all languages ​​to the English space, leveraging rich pre-training resources in English to address the lack of data for low-resource languages. This invention balances language specificity and cross-lingual consistency, significantly improving performance for low-resource languages; it overcomes the risk of language feature loss due to the sharing of indiscriminate parameters in traditional multilingual models (such as multi-lingual BERT); and it overcomes the technical problem of high maintenance costs associated with independent modeling for each language in traditional monolingual models.

[0043] 2. This invention enhances semantic understanding through dual-path feature fusion, effectively mitigating translation errors. It integrates language-specific expressions with cross-linguistic commonalities, improving the robustness of semantic matching and overcoming the vulnerability of existing single semantic representations to translation bias or language differences.

[0044] This invention employs a phased, progressive training optimization approach:

[0045] Multilingual adapter training (loss1): Focus on modeling the original language.

[0046] English matching network training (loss2): Based on repeated sampling of erroneous samples (1:2 ratio), the ability to handle difficult samples in the translation path is specifically improved.

[0047] Fusion network training (loss): jointly optimize dual-path features.

[0048] Key strategy: Resample erroneous samples to construct an improved training set, achieving progressive learning.

[0049] The above technical solutions significantly improve the model's ability to distinguish between boundary samples and noisy data. They address the issue of existing end-to-end training techniques neglecting difficult samples by employing multi-stage progressive optimization to achieve a better fit for specific objectives. Attached Figure Description

[0050] Figure 1 This is a schematic diagram of the structure of a semantic matching model for constructing a multilingual search system according to the present invention;

[0051] Figure 2This is a flowchart of the semantic matching model training process for a multilingual search system according to the present invention.

[0052] Figure 3 This is a diagram illustrating an embodiment of the semantic matching model of a multilingual search system according to the present invention.

[0053] Figure labeling: ① Multilingual adapter network ② Unified language semantic matching network ③ Fusion network Detailed Implementation

[0054] The following is in conjunction with the appendix Figure 1 ~Attached Figure 2 The present invention is described as follows:

[0055] like Figure 1 As shown, this invention provides a semantic matching model for constructing a multilingual search system; the model can handle multiple known languages, fully exploring the commonalities between languages ​​while preserving their differences. The model structure includes three parts, specifically (1) a customized multilingual adapter network, used to model the differences between multiple languages ​​and preserve the possible differences in the original language expression. mold Commonality (2) Define a unified language semantic matching network by translating the multilingual training set into English and further modeling the semantic commonalities of the multilingual languages ​​in the same English semantic space; (3) Fusion network: fuse the output feature vectors of the customized multilingual adapter network and the defined unified language semantic matching network as the final model result. In addition, a complete training process for the model is proposed. The above (1) mentioned Commonalities of Patterns For example

[0056] (Chinese) query = "watermelon", document = "This is a watermelon combo meal"

[0057] (English) query="apple", document="This is an apple combo meal"

[0058] In the above two (query, document) matching relationships, although the Chinese and English queries are completely different, the Chinese and English document expressions are very similar. The correct discrimination of the relevance of the Chinese (watermelon, this is a watermelon combo meal) is conducive to the discrimination of the English (apple, This is an apple combo meal). Therefore, in the model design concept of the present invention: <1> In model design, a multilingual adapter network is adopted. Specifically, (1) a shared multilingual encoder is used to facilitate the exploration of the commonalities of different languages, and (2) adapters for each language are used to facilitate the retention of language differences. Among them, the adapter is implemented using a linear vector with an initial element of 1, which is conducive to achieving the training goal of small parameter adjustment. The feature recombination of different language types is realized through the element-by-element product operation of the adapter linear vector and the encoder output vector features.

[0059] <2> In model design, a multilingual adapter network and a unified language semantic matching network are adopted simultaneously.

[0060] <3> In the training process, the training order of the three model networks and double resampling based on misrecognized samples are involved. Specific content:

[0061] Dataset. For N (N>2) languages, each language has only one training data. The training data set of the i-th language is denoted by the symbol D i Each training data contains four parts, namely language identifier i, query (search term), document, and label. The data volumes of the training data sets D i and D j can be the same or different. A sample in D i is marked as (language identifier i, query i , document i , label i ). The query i and document i in one data should belong to the same language, which is the i-th language. In the training set, label i is known. In the application stage, label i is unknown and needs to be predicted by the model. The value of label can only be 2, 1, or 0, representing one of high relevance, low relevance, and irrelevance. The value of each label corresponds to a one-dimensional categorical probability vector y, and the corresponding relationship is as follows:

[0062]

[0063] A multilingual adapter network is used to model the differences between multiple languages ​​while preserving the potential commonalities of the original language expressions. This network consists of a multilingual encoder and an adapter group, and is trained and tuned in conjunction with a first fully connected network classifier. The functions and implementations of each part are as follows:

[0064] A multilingual encoder handles input (queries) in different languages. i document i The use of a multilingual encoder with identical, shared parameters facilitates the sharing of commonalities among multiple languages. This invention employs Multi-lingual BERT [Reference 7], specifically a 12-layer or 24-layer transformer architecture [open-source model address: https: / / huggingface.co / google-bert / bert-base-multilingual-cased]. BERT [Reference 5] is a pre-trained model, and Multi-lingual BERT is its multilingual version. Input format [CLS] query i [SEP]document i : This is the fixed input format for the multilingual encoder. The characters [CLS] and [SEP] are custom-defined characters for the multilingual encoder. The subscript i represents the i-th language.

[0065] [CLS] corresponds to the representation vector #1: a 1-dimensional vector of length 768, which is the first column vector of the multilingual encoder output vector.

[0066] An adapter is used for each language to take advantage of the differences between languages; the adapter of this invention is a 1-dimensional vector of length 768, and all elements of the vector are initialized to 1 before training;

[0067] Calculation of the term-by-term product: The calculation process, for two vectors A = [a1, a2, ..., a...] n ] and B = [b1,b2,…,b n The term-by-term product of A and B is [a1b1, a2b2, ..., a...]. n b n ];

[0068] The first fully connected network classifier's function is to predict class probabilities based on the first semantic feature representation vector. This first fully connected network classifier is a one-layer fully connected neural network, and it predicts class probabilities using the following steps. The probability of the corresponding relevance category satisfies and prediction labels The correspondence is as follows:

[0069] if maximum,

[0070] The training of the multilingual adapter network and the first fully connected network classifier is achieved by optimizing the following loss function.

[0071]

[0072] Here, y k See Formula 1 for the definition.

[0073] The Unified Language Semantic Matching Network models the semantic commonalities of multiple languages ​​within the same English semantic space by translating multilingual training sets into English. This network consists of an English encoder and a translator, and is trained and tuned using a second fully connected network classifier. The roles of each component are: translator, handling input (queries) from different languages. i document i After being processed by a translator, it is translated into English (query). en document en This system is designed for use with an English encoder; the English encoder outperforms multilingual encoders but can only process English text; the second fully connected network classifier predicts class probabilities based on the second semantic feature representation vector. The specific implementation is explained below:

[0074] ① Input format: [CLS] query en [SEP]document en : This is the fixed input format for the English encoder. The characters [CLS] and [SEP] are custom-defined characters for the English encoder. The subscript en indicates that it is English.

[0075] ② Translator: Employs the M2M100 model. [Reference 8]

[0076] ③ English encoder: Employs the pre-trained BERT model, which can be a 12-layer or 24-layer transformer structure version [open source model address: https: / / huggingface.co / google-bert].

[0077] ④[CLS] corresponding to representation vector #2: is a 1-dimensional vector of length 768, and is the first column vector of the English encoder output vector. This representation vector serves as the "second semantic feature representation vector" of the unified language semantic matching network output.

[0078] ⑤ Second fully connected network classifier: a 3-layer fully connected neural network.

[0079] ⑥ Predicting category probabilities The probabilities of each correlation category predicted by the second fully connected network classifier satisfy the following conditions:

[0080] and prediction labels The correspondence is as follows:

[0081] if maximum

[0082] The training of the unified language semantic matching network and the second fully connected network classifier is achieved by optimizing the following loss function.

[0083]

[0084] Here, y k The definition is given in Formula 1. The translator cannot be trained.

[0085] The fusion network combines the feature vectors from the multilingual adapter network and the unified language semantic matching network to output the final model result. The fusion network extracts two representation vectors: the first semantic feature representation vector output by the multilingual adapter network and the second semantic feature representation vector output by the unified language semantic matching network. These two vectors are concatenated and then passed through a third fully connected network classifier. The output at this point is the predicted class probability. The probability of the corresponding relevance category satisfies and prediction labels The correspondence is as follows:

[0086] if maximum This will be used as the final predicted category in the actual search system.

[0087] Training the fusion network is achieved by optimizing the following loss function.

[0088]

[0089] like Figure 2 As shown, the training process of this invention is divided into three stages. In the first stage, a multilingual adapter network is trained based on the original training set. In the second stage, samples that the multilingual adapter network cannot correctly identify are resampled (samples are repeated 2 or 3 times), and samples that can be correctly identified are used 1:1 to obtain modified and new training data, which is then used to train a unified language semantic matching network. In the third stage, for each sample in the original training set (excluding samples added due to resampling), the second semantic feature representation vector output by the unified language semantic matching network and the first semantic feature representation vector output by the multilingual adapter network are obtained, and then the fusion network is trained. Specifically, this includes:

[0090] Step 1: Collect training data for N languages. Each data point contains features: language identifier, query text, document text, and label. This training data is denoted as the "original training set".

[0091] Step 2: Train the multilingual adapter network. According to the definition of loss 1 (Formula 2), use the original training set to train the encoder and the first fully connected network classifier of the multilingual adapter network.

[0092] Step 3: Obtain the first semantic feature representation vector: Use the trained multilingual adapter network to predict the original training set samples. The prediction output of each training set sample is recorded as the first semantic feature representation vector and saved for later use.

[0093] Step 4: Resample the samples misidentified by the multilingual adapter network at a 1:2 ratio: Using the trained multilingual adapter network, predict the original training set samples. Resample the samples with incorrect predictions at a 1:2 ratio, and do not resample the correctly identified samples to obtain an "improved training set". This process achieves sample augmentation to some extent.

[0094] Step 5: Train the Unified Language Semantic Matching Network. According to the definition of loss2 (Formula 3), using the improved training set, train the Unified Language Semantic Matching Network and the second fully connected network classifier. The translator needs to remain unchanged [frozen] and not be trained.

[0095] Step 6: Obtain the second semantic feature representation vector from the original training set. Use the trained unified language semantic matching network to predict the original training set samples. The prediction output of each training set sample is recorded as the second semantic feature representation vector and saved for later use.

[0096] Step 7: Train the fusion network. Based on Step 3 and Step 6, each sample in the original training set has a first semantic feature representation vector and a second semantic feature representation vector. Train the fusion network according to the definition of loss3 (Formula 4).

[0097] The prediction of the fusion network involves concatenating the first and second semantic feature representation vectors, and then passing them through a third fully connected network classifier. The output at this point is... (Can only be 0, 1, or 2, corresponding to irrelevant, low relevance, and high relevance respectively) This is the final relevance score used in the search system, and its effective module and system location are as follows: Figure 3 The effective strategy is that the higher the relevance of the result, the smaller its position (earlier). This can be expressed by the formula: position. 高相关 Location 低相关 Location 不相关 .

[0098] Although the present invention has been described above, the present invention is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many modifications under the guidance of the present invention without departing from the spirit of the present invention, and these modifications are all within the protection scope of the present invention.

[0099] Reference List

[0100] [1] Reference 1 He Nan, Zhang Wenbin, Yao Lingling, et al. A method and apparatus for calculating the relevance of text:

[0101] CN104424279B[P]. 2018-11-20.

[0102] [2] Reference 2 Zhu Danxiang. Answer search method, device and related equipment based on semantic index: CN109740077B[P]. 2021-02-12.

[0103] [3] Reference 3 Li Zhenyang, Wu Donghua, Ma Lianyang, et al. A text matching method, device, electronic device and storage medium: CN112182166B[P]. 2023-03-10.

[0104] [4] Reference 4Qiu

[0105] [5] Reference 5Lee J,Toutanova K.Pre-training of deep bidirectionaltransformers for language understanding[J].arxiv preprint arxiv:1810.04805,2018,3(8).

[0106] [6] Reference 6Cui Y, Che W, Liu T, et al. Pre-training with whole word masking for chinese bert[J]. IEEE / ACM Transactions on Audio, Speech, and Language Processing, 2021, 29: 3504-3514.

[0107] [7]Introduction7Pires T,Schlinger E,Garrette D.How multilingual ismultilingual BERT?[J].

[0108] [8]Fan A,Bhosale S,Schwenk H,et al.Beyond English-CentricMultilingual Machine Translation[J].2020.DOI:10.48550 / arXiv.2010.11125.

Claims

1. A method for constructing a semantic matching model in a multi-lingual search system, the method comprising: The semantic matching model comprises a multi-language adapter network, a first fully connected network classifier, a unified language semantic matching network, a second fully connected network classifier, a fusion layer, and a third fully connected network classifier; the multi-language adapter network comprises a multi-language encoder and an adapter group; the unified language semantic matching network comprises an English encoder and a translator; the fusion layer and the third fully connected network classifier constitute a fusion network; wherein: The multi-language adapter network obtains first semantic feature representation vectors of multiple languages while keeping the original language types; The first fully connected network classifier obtains a first predicted class probability according to the first semantic feature representation vector with the first predicted label establishes the first predicted label and the target label label corresponding relationship, adjusts the multilingual adapter network and the first fully connected network classifier; The unified language semantic matching network translates the multiple languages into English to obtain second semantic feature representation vectors in the same English semantic space; The second fully connected network classifier obtains a second predicted class probability according to the second semantic feature representation vector with the second predicted label establishes the second predicted label and the target label label corresponding relationship, adjusts the unified language semantic matching network and the second fully connected network classifier; The fusion layer splices the first semantic feature representation vectors and the second semantic feature representation vectors to obtain third semantic feature representation vectors; The third fully connected network classifier outputs a final prediction class probability according to the third semantic feature representation vector corresponding to the final prediction label establishing a corresponding relationship between the final prediction label and the target label label and adjusting the third fully connected network classifier, as a semantic matching result.

2. The semantic matching model for constructing a multi-lingual search system according to claim 1, wherein: The process of obtaining the first semantic feature representation vectors of multiple languages while keeping the original language types by the multi-language adapter network comprises: The multilingual encoder inputs the character [CLS] query i [SEP] document i is encoded, outputting a one-dimensional vector representation A, where [CLS] and [SEP] are specific defined characters; The adapter group selects a corresponding adapter B according to the language type, performs an item-by-item multiplication operation on a one-dimensional vector representation A to output a one-dimensional vector representation C, the adapter B is a one-dimensional weight vector, and has a one-to-one relationship with a certain language type, and the initialization values of all elements of the vector before training are 1; the item-by-item multiplication operation is specifically defined as follows: For two vectors A = [a1, a2,..., a n ] and B = [b1, b2,..., b n ], the element-wise product of A and B yields a first semantic feature representation vector C; i.e., [a1b1, a2b2,..., a n b n ].

3. A method for training a semantic matching model based on the multilingual search system of claim 1, characterized in that: The method comprises the following steps: Step 1: collecting training data of N languages to construct a semantic original training set; each data in the semantic original training set comprises features: language identification, query text, document text, and label; Step 2: training the multi-language adapter network and the first fully connected network classifier according to the following loss function according to the original training set; wherein, is the predicted class probability of the first fully connected network classifier, [y1, y2, y3] is the class probability corresponding to the target label label, satisfying the correspondence relationship that when label = k, y k = 1; when label ≠ k, y k = 0, k can only take 0, 1 or 2; loss1 is the numerical value of the loss function; Step 3: predicting the original training set samples through the trained multi-language adapter network, and extracting the prediction output of each original training set sample to construct a first semantic feature representation vector; Step 4: predicting the original training set samples through the trained multi-language adapter network and the first fully connected network classifier, repeatedly sampling the samples with incorrect prediction categories at a ratio of 1:2, and sampling the samples with correct prediction categories at a ratio of 1:1 to obtain an improved training set; Step 5: training the unified language semantic matching network and the second fully connected network classifier according to the improved training set according to the following loss function; wherein, is the predicted class probability of the second fully connected network classifier, [y1, y2, y3] is the class probability corresponding to the target label label, satisfying the correspondence relationship that when label = k, y k = 1; when label ≠ k, y k = 0, k can only take 0, 1 or 2; loss2 is the numerical value of the loss function; Step 6: predicting the original training set samples through the trained unified language semantic matching network, and extracting the prediction output of each original training set sample to construct a second semantic feature representation vector; Step 7: based on steps 3 and 6, each sample of the original training set has a first semantic feature representation vector and a second semantic feature representation vector, the fusion layer splices the first and second semantic feature representation vectors, and the third fully connected classifier is trained according to the following loss function: wherein, is the predicted class probability of the third fully connected network classifier, [y1, y2, y3] is the class probability corresponding to the target label label, satisfying the correspondence relationship: when label = k, y k = 1; when label ≠ k, y k = 0, k can only take 0, 1 or 2; loss is the numerical value of the loss function.

Citation Information

Patent Citations

  • A method and device for calculating the relevance of text

    CN104424279B

  • Semantic indexing-based answer search methods, devices, and related equipment

    CN109740077B

  • A text matching method, apparatus, electronic device, and storage medium

    CN112182166B

  • A Multilingual Semantic Matching Method and System Based on Alignment Variational Autoencoder

    CN114936564A

  • Event argument detection method and system based on label sequence consistency modeling

    CN116595407A