Semantic matching model and method for constructing multi-language search system

Through the 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, and the accuracy and robustness of semantic matching are improved, especially in resource-constrained environments.

CN120687568AActive Publication Date: 2025-09-23TIANJIN UNIV
View PDF 7 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

Existing multilingual semantic matching models cannot effectively balance the commonalities and differences of languages ​​when handling multilingual search scenarios, resulting in the model's performance in some languages ​​being inferior to that of single-language models. The translation process may also lose language characteristics, making it difficult to quickly expand and improve the accuracy of semantic matching in resource-constrained environments.

Method used

It adopts a dual-path architecture of a multilingual adapter network and a unified language semantic matching network. Through multi-stage training and error sample resampling, it models the differences and commonalities of languages ​​respectively, and maps different languages ​​into the English semantic space through a translator. Combined with the rich pre-training resources of English, it finally optimizes the feature representation through a fusion network.

Benefits of technology

It significantly improves the semantic matching accuracy and robustness of multilingual search systems, especially in low-resource language environments. It overcomes the language feature loss and translation error problems of traditional models and improves the model's ability to discriminate boundary samples and noise data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120687568A_ABST
    Figure CN120687568A_ABST
Patent Text Reader

Abstract

The invention discloses a semantic matching model and method for constructing a multi-language search system. The semantic matching model comprises a multi-language adapter network, a first full-connection network classifier, a unified language semantic matching network, a second full-connection network classifier, a fusion layer and a third full-connection 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 full-connection network classifier form a fusion network; wherein the relationship between the target label and the first prediction label is established; establishing a relationship between the target label and a second prediction label; establishing a relationship between the target label and the final prediction category; as a semantic matching result adopted and used by a search system, the method can fully mine generality among multiple languages, considers difference among the multiple languages, and ensures semantic search accuracy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present 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 Art

[0002] A multilingual search system is a system that searches for and identifies relevant results from a candidate set of documents (also called documents) for the search term (also called query) entered by the user in the input box. The system uses a variety of expression languages ​​for the search term set and document set. Common search systems include search intent analysis, search recall, relevance module, ranking module, and other processes (see below). Figure 3 ), where the relevance score measures the extent to which the returned results meet the user's query requirements and is one of the main performance indicators of the search system.

[0003] The calculation methods of relevance can be divided into two categories: (1) literal matching. This method was mostly used in early search engines. It analyzes the query word set Q and the document word set D, calculates the common words between sets Q and D, the position / order of word appearance, and other feature indicators, and comprehensively evaluates whether the query and document are relevant [Reference 1]; (2) semantic matching model. With the development of deep learning technology, this method has become popular. It maps the query and document into a vector semantic space, and then calculates the relevance through a deep semantic matching model [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 the pre-trained open source model using high-quality datasets in the field.

[0004] Text matching model

[0005] As a type of text matching model, the semantic relevance model has become the 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 scores of two texts. In the search system, the two texts correspond to the user's search term (query) and the candidate document (document). The calculation methods of relevance can be divided into two categories: (1) literal matching. This method analyzes the query's word set Q and the document's word set D, and calculates the same words between sets Q and D, the position / order of word appearance, and other feature indicators to comprehensively evaluate whether the query and document are related [Reference 1]. The advantages of this type of method are simplicity and strong interpretability. The disadvantage is that it cannot solve the problem of different words but synonymous or similar words by using the literal word method; (2) semantic relevance model. It maps the query and document to the same semantic vector space, and then uses a deep semantic matching model to model and give a relevance judgment [Reference 2, Reference 3]. This type of method solves the shortcomings of literal matching and is more friendly to synonymous and similar relationships between words or sentences. The model effect is generally better than literal matching.

[0006] Pre-training technology: Typical examples in the field of natural language processing include BERT and GPT. They use weakly supervised learning on large-scale corpora to obtain deep learning models (pre-training models). Subsequently, for specific domain tasks, further training (fine-tuning) using domain data based on this model is sufficient, making it easier to achieve better performance. Among them:

[0007] Pre-trained models

[0008] In the field of natural language processing, pre-training technology has been widely researched in recent years, resulting in the emergence of a number of pre-trained models, exemplified by BERT (Bidirectional Encoder Representations from Transformers) [Reference 5]. The process of adapting a pre-trained model to a specific domain can be divided into two stages. In the first stage, known as "pre-training," the resulting model is called a "pre-trained model." Pre-trained models acquire general semantic representation capabilities through self-supervised learning from massive amounts of unlabeled data. Of particular note, models in this stage focus on general language capabilities and are often trained using publicly available corpora. Many of the resulting models have been open-sourced and can be directly used as foundational models for downstream tasks. In the second stage, known as "fine-tuning," the pre-trained model from the first stage is refined and adapted, and continuously trained on high-quality supervised domain data to achieve even more effective domain models. Thanks to advances in pre-training technology, one of the most successful paradigms for semantic relevance models today is fine-tuning pre-trained open-source models using high-quality domain (query, document) datasets. Different from the single text scenario, the input format of the pre-trained model corresponding to the text matching (query, document) dataset is "[CLS]query[SEP]document", where [CLS] and [SEP] are custom special characters of the BERT [Reference 5] pre-trained model.

[0009] Multilingual semantic model

[0010] Current multilingual semantic modeling tends to focus on language commonalities while ignoring language differences. Compared to semantic models trained on a single language, the results are often slightly inferior. The pre-trained BERT model has single-language versions, such as English BERT [Reference 5] and Chinese BERT [Reference 6]; open-source versions compatible with multiple languages ​​have also been released, such as multi-lingual BERT [Reference 7]. Compared to single-language models, multi-lingual BERT utilizes massive amounts of unlabeled data in multiple languages ​​in its first stage—pre-training—without substantial changes to the model structure. Because this lacks consideration of multilingual differences, multi-lingual BERT performs poorly when fine-tuned in a single language during its second stage. For example, fine-tuning in the English domain often yields lower results than BERT in the English version, and fine-tuning in the Chinese domain often yields lower results than BERT in the Chinese version. In order to obtain a unified multilingual semantic relevance model, (1) fine-tuning the domain multilingual data based on multi-lingual BERT can be considered a relatively easy solution, but the effect will be inferior to the fine-tuning of single-language BERT. (2) Another possible solution is to uniformly translate the multilingual input into English or Chinese, and then perform the second stage of fine-tuning based on the English or Chinese version of BERT, but this solution will lose the differences brought by the linguistic characteristics of different languages. Therefore, a better solution should be to combine the above two solutions.

[0011] In summary, most existing text matching methods target a single language, and the few that can handle multiple languages ​​simply stack multilingual datasets. These methods fail to tailor models to the specific characteristics of multilingual search (language similarities and differences). Therefore, building a semantic matching model for a broad and accurate multilingual search system is an urgent technical challenge facing those skilled in the art. Summary of the Invention

[0012] To address the technical issues existing in the prior art, the present invention provides a method for constructing a semantic matching model for a multilingual search system. By customizing a multilingual adapter model, the present invention fully exploits the commonalities between multiple languages ​​while simultaneously accounting for their differences, improving the reciprocity of language matching within the multilingual search system and ensuring semantic search accuracy. Furthermore, given the deeper and more extensive research on English models, the present invention unifies the language model, facilitating the utilization of open-source, higher-performance English models, further enhancing the performance of the multilingual search system.

[0013] In order to solve the problems of the prior art, the present invention adopts the following technical solutions:

[0014] A method for constructing a semantic matching model in a multilingual search system, the semantic matching model comprising 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 comprises a multilingual 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:

[0015] The multilingual adapter network obtains a first semantic feature representation vector for the multiple languages ​​while maintaining the original language type;

[0016] The first fully connected network classifier obtains a first predicted category probability according to the first semantic feature representation vector With the first predicted label Establish the first prediction label Adjusting the multilingual adapter network and the first fully connected network classifier according to the relationship with the target label label;

[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 a second predicted category probability according to the second semantic feature representation vector With the second predicted label Building the second prediction label and the target label label, adjusting the unified language semantic matching network and the second fully connected network classifier;

[0019] The fusion layer concatenates the first semantic feature representation vector and 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 category probability according to the third semantic feature representation vector and the final predicted label Building the final predicted labels And the corresponding relationship between the target label label, adjust the third fully connected network classifier, As a semantic matching result.

[0021] Furthermore, the multilingual adapter network obtains a first semantic feature representation vector for multiple languages ​​while maintaining the original language type, including:

[0022] The multi-language encoder input character [CLS] query i [SEP]documenti Encode and output a one-dimensional vector representation 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. The adapter B is a one-dimensional weight vector that has a one-to-one mapping relationship with a certain type of language. All elements of the vector are initialized to 1 before training. The term-by-term product operation is specifically defined as follows:

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

[0025] The present invention can also be implemented by the following technical solution: comprising the following steps:

[0026] Step 1: Collect training data in N languages ​​to construct a semantic original training set. Each data in the semantic original 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 according to the following loss function;

[0028]

[0029] in, is the predicted category probability of the first fully connected network classifier, [y1,y2,y3] is the category probability corresponding to the target label label, and when label=k, y k =1; when label≠k, y k =0, k can only be 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: Use the trained multilingual adapter network to predict the original training set samples and extract each original training

[0031] The prediction output of the training set samples constructs the first semantic feature representation vector;

[0032] Step 4: Use the trained multilingual adapter network and the first fully connected classifier to predict the original training set samples. Repeat sampling of samples with incorrect prediction categories at a ratio of 1:2 and sampling of samples with correct prediction categories 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 according to the improved training set and the following loss function;

[0034]

[0035] in, is the predicted category probability of the second fully connected network classifier, [y1,y2,y3] is the category probability corresponding to the target label label, satisfying the corresponding relationship when label=k, yk=1; when label≠k, y k =0, k can only be 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: Use the trained unified language semantic matching network to predict the original training set samples, extract the prediction output of each original training set sample to construct a 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 semantic feature representation vector and the second semantic feature representation vector, and trains a third fully connected classifier according to the following loss function:

[0038]

[0039] in, is the predicted category probability of the third fully connected network classifier, [y1,y2,y3] is the category probability corresponding to the target label label, and the corresponding relationship is satisfied when label=k, y k =1; when label≠k, y k =0, k can only be 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 solves the contradiction between multilingual semantic unification and feature preservation through the 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. The present invention achieves a balance between unified multi-language modeling and language feature retention, using a multi-language adapter network: dynamically adjusting the encoder output (A⊙B) through a language-specific adapter B, retaining language features while sharing the backbone network. Unified language semantic space alignment: mapping all languages ​​to the English space through a translator, and utilizing the rich pre-training resources of English to solve the problem of insufficient data for low-resource languages. The present invention takes into account both language specificity and cross-language consistency, significantly improving the performance of low-resource languages; overcoming the problem that traditional multi-lingual models (such as multi-lingual BERT) share indifferent parameters that may lead to loss of language features; and overcoming the technical problem that traditional monolingual models require independent modeling for each language, resulting in high maintenance costs.

[0043] 2. The present invention enhances semantic understanding through dual-path feature fusion to effectively alleviate translation errors, integrate language-specific expressions with cross-language commonalities, improve the robustness of semantic matching, and overcome the existing technology where single semantic representation is easily affected by translation bias or language differences.

[0044] The present invention adopts phased progressive training optimization:

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

[0046] English Matching Network Training (loss2): Based on repeated sampling of error samples (1:2 ratio), the translation path's ability to handle difficult samples is specifically improved.

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

[0048] Key strategy: Resampling of error samples to construct an improved training set and achieve progressive learning.

[0049] The above technical solution significantly improves the model's ability to distinguish boundary samples and noisy data. This solves the problem that existing end-to-end training tends to ignore difficult samples, and achieves better fit for specific targets through multi-stage progressive optimization. BRIEF DESCRIPTION OF THE DRAWINGS

[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 semantic matching model training for a multilingual search system of the present invention. Figure 3 This is a diagram illustrating an embodiment of a semantic matching model of a multilingual search system according to the present invention.

[0052] Explanation of reference numerals: ① Multi-language adapter network ② Unified language semantic matching network ③ Fusion network DETAILED DESCRIPTION

[0053] The following is combined with Figure 1 ~Attached Figure 2 The present invention is described as follows:

[0054] like Figure 1 As shown, the present invention provides a semantic matching model for building a multilingual search system; the model can process multiple known languages, fully explore the commonalities between languages, and retain the differences. The model structure includes three parts, specifically (1) a customized multilingual adapter network for modeling the differences between multiple languages ​​and retaining the possible differences in the original language expression. mold Commonality ; (2) Define a unified language semantic matching network, translate the multi-language training set into English, and further model the semantic commonalities of multiple languages ​​in the same English semantic space; (3) Fusion network, fuse the output feature vectors of the above-mentioned customized multi-language adapter network and the defined unified language semantic matching network as the final model result. In addition, a complete training process of the model is proposed. Pattern commonality , for example

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

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

[0057] In the two (query, document) matching relationships above, although the Chinese and English queries are completely different, the Chinese and English document expressions are very similar. The correct identification of the relevance of the Chinese (watermelon, This is a watermelon combo meal) is beneficial to the identification of the English (apple, This is an apple combo meal). Therefore, the model design concept of the present invention is: <1> In terms of model design, the multilingual adapter network uses (1) a shared multilingual encoder to facilitate the exploration of commonalities between different languages, and (2) adapters for each language to facilitate the preservation of language differences. 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 adjustments. The feature reorganization of different language types is achieved by performing a term-by-term product operation on the adapter linear vector and the encoder output vector features.

[0058] <2> In terms of model design, a multilingual adapter network and a unified language semantic matching network are used.

[0059] <3> The training process, the training order of the three model networks, and the 2x resampling based on the recognition error samples.

[0060] Dataset, for N (N>2) languages, there is only one training data for each language, and the training data set of the i-th language is symbolized by D i Indicates that each training data contains 4 parts, namely language identifier i, query (search term), document (document), label (label). The training data set D of two languages i and D j The amount of data can be the same or different, D i A sample is labeled as (language identifier i, query i ,document i ,label i ), a query in a data i and document i The language should be the same, all are the i-th language. In the training set, label i It is known that in the application phase, label i It is the unknown output that needs to be predicted by the model. The label value can only be 2, 1, or 0, representing high correlation, low correlation, or no correlation. Each label value corresponds to a one-dimensional class probability vector y, and the corresponding relationship is as follows:

[0061]

[0062] The multilingual adapter network is used to model the differences between multiple languages ​​while preserving the underlying commonalities expressed in the original languages. This network consists of two parts: a multilingual encoder and an adapter group. This network is trained and adjusted in conjunction with the first fully connected network classifier. The functions and implementation of each part are as follows:

[0063] Multilingual encoders for different language inputs (query i ,document i ) through the same, shared-parameter multilingual encoder, facilitating the commonality of multiple languages; the multilingual encoder of the present invention uses Multi-lingual BERT [Reference 7], which uses a 12-layer or 24-layer transformer structure [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 : is the fixed input format of the multilingual encoder. The characters [CLS] and [SEP] are custom specific characters of the multilingual encoder. The subscript i represents the i-th language.

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

[0065] Adapter, for each language, a corresponding adapter is used to facilitate the differences between different languages; the adapter of the present invention is a 1-dimensional vector of length = 768, and all elements of the vector are initialized to 1 before training;

[0066] Calculation of item-by-item product: 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 ];

[0067] The first fully connected network classifier: Its function is to predict the category probability based on the first semantic feature representation vector. The first fully connected network classifier is a 1-layer fully connected neural network, which uses the following steps to predict the category probability The probability of the corresponding correlation category satisfies and predicted labels The corresponding relationship is as follows:

[0068] if maximum,

[0069] The multilingual adapter network and the first fully connected network classifier are trained by optimizing the following loss function:

[0070]

[0071] Here, y k See formula 1 for definition.

[0072] The unified language semantic matching network, by translating multi-language training sets into English, further models the semantic commonalities of multiple languages ​​in the same English semantic space; this network consists of two parts, the English encoder and the translator, combined with the second fully connected network classifier to achieve the training adjustment of the network. The role of each part: translator, different language input (query i ,document i ) is translated into English (query en ,document en ), which facilitates the use of an English encoder; the English encoder, which outperforms the multilingual encoder and can only process English text; the second fully connected network classifier predicts the category probability based on the second semantic feature representation vector. The specific implementation is described as follows:

[0073] ① Input format [CLS]query en [SEP]document en : is the fixed input format of the English encoder. The characters [CLS] and [SEP] are custom specific characters of the English encoder. The subscript en represents English.

[0074] ②Translator: Using the M2M100 model. [Reference 8]

[0075] English encoder: This uses the pre-trained BERT model, which can be a 12-layer or 24-layer transformer architecture [open source model address: https: / / huggingface.co / google-bert].

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

[0077] ⑤The second fully connected network classifier: a 3-layer fully connected neural network.

[0078] ⑥Predicted category probability The probability of each correlation category predicted by the second fully connected network classifier satisfies

[0079] and predicted labels The corresponding relationship is as follows

[0080] if maximum

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

[0082]

[0083] Here, y k See Equation 1 for definition. The translator cannot be trained.

[0084] The fusion network fuses the feature vectors generated by the multilingual adapter network and the unified language semantic matching network, and outputs 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 the third fully connected network classifier. The output at this point is the predicted category probability. is the probability of the corresponding correlation category, satisfying and predicted labels The corresponding relationship is as follows

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

[0086] The training of the fusion network is achieved by optimizing the following loss function:

[0087]

[0088] like Figure 2 As shown, the training process of the present invention is divided into three stages of training. In the first stage, the multilingual adapter network is trained based on the original training set. In the second stage, the samples that the multilingual adapter network cannot correctly recognize are resampled (the samples are repeated 2 or 3 times), and the samples that can be correctly recognized are adopted 1:1 to obtain modified, new training data and train the unified language semantic matching network. In the third stage, for each sample in the original training set (excluding the newly added samples 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. The specific contents include:

[0089] Step 1: Collect training data in N languages. Each data entry contains the following features: language identifier, query text, document text, and label. This training data is referred to as the "original training set."

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

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

[0092] Step 4: Resample samples incorrectly identified by the multilingual adapter network at a 1:2 ratio: Using the trained multilingual adapter network, perform predictions on the original training set samples. Resample samples with incorrectly predicted categories at a 1:2 ratio, while samples with correct classification are not resampled, to obtain an "improved training set." This process achieves a certain degree of sample augmentation.

[0093] Step 5: Train the unified language semantic matching network. According to the definition of loss2 (Formula 3), use the improved training set to train the unified language semantic matching network and the second fully connected network classifier. The translator needs to remain unchanged (frozen) and not trained.

[0094] Step 6: Original training set, obtain the second semantic feature representation vector. Use the trained unified language semantic matching network to predict the original training set samples. The predicted output of each training set sample is recorded as the second semantic feature representation vector and saved for future use.

[0095] Step 7: Train the fusion network. 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. According to the definition of loss3 (Formula 4), the fusion network is trained.

[0096] Fusion network prediction: The first semantic feature representation vector and the second semantic feature representation vector are concatenated and then passed through the third fully connected network classifier. The output at this time is (can only be 0, 1 or 2, corresponding to irrelevant, low relevant, and high relevant respectively) is the relevance score finally used in the search system. The module and system location where it takes effect are as follows: Figure 3 , the effective strategy is that the higher the correlation of the result, the smaller the position (front), and the formula can be expressed as position 高相关 <Location 低相关 <Location 不相关 .

[0097] Although the present invention has been described above, the present invention is not limited to the above-mentioned specific embodiments. The above-mentioned specific embodiments are merely illustrative and not restrictive. Under the guidance of the present invention, ordinary technicians in this field can make many variations without departing from the purpose of the present invention, and these are all protected by the present invention.

[0098] Reference List

[0099] [1] Reference 1 Henan, Zhang Wenbin, Yao Lingling, et al. A method and device for calculating the relevance of text:

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

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

[0102] [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.

[0103] [4] Reference 4Qiu

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

[0105] [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.

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

[0107] [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 semantic matching model for building a multilingual search system, characterized by: 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; wherein: The multilingual adapter network obtains a first semantic feature representation vector for the multiple languages ​​while maintaining the original language type; The first fully connected network classifier obtains a first predicted category probability according to the first semantic feature representation vector With the first predicted label Establish the first prediction label Adjusting the multilingual adapter network and the first fully connected network classifier according to the relationship with the target label label; 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; The second fully connected network classifier obtains a second predicted category probability according to the second semantic feature representation vector With the second predicted label Building the second prediction label and the target label label, adjusting the unified language semantic matching network and the second fully connected network classifier; The fusion layer concatenates the first semantic feature representation vector and the second semantic feature representation vector to obtain a third semantic feature representation vector; The third fully connected network classifier outputs the final predicted category probability according to the third semantic feature representation vector and the final predicted label Building the final predicted labels And the corresponding relationship between the target label label, adjust the third fully connected network classifier, As a semantic matching result.

2. The method for constructing a semantic matching model in a multilingual search system according to claim 1, characterized in that: The multilingual adapter network obtains a first semantic feature representation vector for multiple languages ​​while maintaining the original language type, including: The multi-language encoder input character [CLS] query i [SEP]document i Encode and output a one-dimensional vector representation A, where [CLS] and [SEP] are specifically defined characters; The adapter group selects the corresponding adapter B according to the language type, performs a term-by-term product operation with the one-dimensional vector representation A, and outputs a one-dimensional vector representation C. The adapter B is a one-dimensional weight vector that has a one-to-one relationship with a specific language type. All elements of the vector are initialized to 1 before training. The term-by-term product operation is specifically defined as follows: For two vectors A=[a1,a2,…,a n ] and B=[b1,b2,…,b n ], the first semantic feature representation vector C is obtained by calculating the item-by-item product of A and B; that is: [a1b1, a2b2,…, a n b n ].

3. A method for training a semantic matching model in a multilingual search system according to claim 1, characterized in that: The steps include: Step 1: Collect training data in N languages ​​to construct a semantic original training set. Each data in the semantic original training set contains features: language identifier, query text, document text, and label. Step 2: Train the multilingual adapter network and the first fully connected network classifier based on the original training set according to the following loss function; in, is the predicted category probability of the first fully connected network classifier, [y1,y2,y3] is the category probability corresponding to the target label label, and when label=k, y k =1; when label≠k, y k =0, k can only be 0, 1 or 2; loss1 is the value of the loss function; Step 3: Use the trained multilingual adapter network to predict the original training set samples, extract the prediction output of each original training set sample to construct the first semantic feature representation vector; Step 4: Use the trained multilingual adapter network and the first fully connected network classifier to predict the original training set samples. Repeat sampling of samples with incorrect prediction categories at a ratio of 1:2 and sampling of samples with correct prediction categories at a ratio of 1:1 to obtain an improved training set. Step 5: Train the unified language semantic matching network and the second fully connected network classifier according to the improved training set and the following loss function; in, is the predicted category probability of the second fully connected network classifier, [y1,y2,y3] is the category probability corresponding to the target label label, and when label=k, y k =1; when label≠k, y k =0, k can only be 0, 1 or 2; loss2 is the value of the loss function; Step 6: Use the trained unified language semantic matching network to predict the original training set samples, extract 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 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 a third fully connected classifier according to the following loss function: in, is the predicted category probability of the third fully connected network classifier, [y1,y2,y3] is the category probability corresponding to the target label label, and the corresponding relationship is satisfied when label=k, y k =1; when label≠k, y k =0, k can only be 0, 1 or 2; loss is the 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