Dual-tower recall-based retrieval methods, systems, devices, and storage media

CN116501837BActive Publication Date: 2026-08-14PING AN TECH (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-04-19
Publication Date
2026-08-14

AI Technical Summary

Technical Problem

[0003]目前主流的基于双塔架构模型的稠密向量召回方法,训练所需要的负样本固定或是负样本和正样本的区分度很大,导致训练过于简单;在模型设计时因为增加了信息交互的信息建模,增加了模型的延迟,进而大大影响了模型最终的检索性能

Benefits of technology

[0039]采用本申请的基于双塔召回的检索方法、系统、设备及存储介质,通过根据给定查询文本,确定给定查询文本的正相关文章以及不相关文章;将正相关文章输入训练好的伪查询模型,得到正相关文章的第一伪查询文本;将不相关文章输入训练好的伪查询模型,得到不相关文章的第二伪查询文本;根据给定查询文本、正相关文章以及第一伪查询文本,构建正样本;根据给定查询文本、正相关文章、不相关文章、第一伪查询文本以及第二伪查询文本,构建负样本;将正样本以及负样本输入双塔召回模型进行迭代训练;将待查询输入训练后的双塔召回模型,得到检索结果。本申请能够通过伪查询构建多个强相关的负样本用于模型的学习,大大提高了模型的检索效率以及准确性。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116501837B_ABST
    Figure CN116501837B_ABST
Patent Text Reader

Abstract

This application provides a dual-tower recall-based retrieval method, system, device, and storage medium, belonging to the fields of data processing technology and digital healthcare. It uses an artificial intelligence model to retrieve medical information needed by users from massive amounts of electronic digital medical records. By identifying positively relevant and irrelevant articles based on a given query text within a medical field, the method inputs these articles into a trained pseudo-query model to obtain a first pseudo-query text of positively relevant articles and a second pseudo-query text of irrelevant articles. Positive and negative samples are then constructed. These positive and negative samples are input into the dual-tower recall model for iterative training. Finally, the query is input into the trained dual-tower recall model to obtain the retrieval results. This application can construct multiple strongly relevant negative samples through pseudo-queries for model learning, significantly improving the model's retrieval efficiency and accuracy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the fields of data processing technology and digital healthcare, specifically relating to a retrieval method, system, device, and storage medium based on dual-tower recall. Background Technology

[0002] Information retrieval has become a crucial channel for users to quickly obtain the information they need in many scenarios. For example, in the medical field, artificial intelligence models can be used to retrieve the necessary medical information from massive amounts of electronic medical records, providing valuable references. Traditional information retrieval primarily relies on keywords, such as semantic retrieval. Current semantic retrieval mainly employs neural network models, including interactive single-tower models and representational dual-tower models.

[0003] Current mainstream dense vector recall methods based on dual-tower architecture models require a fixed number of negative samples for training or a high degree of distinction between negative and positive samples, resulting in overly simplistic training. Furthermore, the addition of information interaction modeling during model design increases model latency, which significantly impacts the final retrieval performance of the model. Summary of the Invention

[0004] The retrieval method, system, device, and storage medium based on dual-tower recall proposed in this invention can construct multiple strongly correlated negative samples through pseudo-queries for model learning, which greatly improves the retrieval efficiency and accuracy of the model.

[0005] According to a first aspect of the embodiments of this application, a retrieval method based on dual-tower recall is provided, comprising:

[0006] Based on the given query text, determine the articles that are positively relevant to the query text and the articles that are irrelevant to the query text;

[0007] Inputting positively relevant articles into the trained pseudo-query model yields the first pseudo-query text of the positively relevant articles; inputting irrelevant articles into the trained pseudo-query model yields the second pseudo-query text of the irrelevant articles.

[0008] Construct positive samples based on the given query text, positively related articles, and the first pseudo-query text; construct negative samples based on the given query text, positively related articles, irrelevant articles, the first pseudo-query text, and the second pseudo-query text.

[0009] Positive and negative samples are input into the dual-tower recall model for iterative training; the query is input into the trained dual-tower recall model to obtain the retrieval results.

[0010] In some embodiments of this application, determining positively relevant articles and irrelevant articles based on a given query text includes:

[0011] Select at least one public dataset;

[0012] Based on at least one public dataset, match a given query text to obtain at least one positively related article and at least one irrelevant article.

[0013] In some embodiments of this application, positive and negative samples are input into the dual-tower recall model for iterative training, including:

[0014] Determine the similarity score between the query text and the pseudo-query text based on the given article;

[0015] The total loss of the dual-tower recall model is calculated based on the vector similarity score, so that the output distribution of the dual-tower recall model fits.

[0016] In some embodiments of this application, a similarity score is determined between the query text and the pseudo-query text based on a given article, including:

[0017] Concatenate special characters into the query text object to obtain the final query text;

[0018] Input the final query text into the query encoder to obtain the first feature vector representation of all characters in the query text;

[0019] By concatenating special characters into the query article object and inputting the concatenated query article into the pseudo query model, at least one pseudo query text is obtained.

[0020] Extract a pseudo-query text and concatenate it with the concatenated query article to obtain the final article text;

[0021] The final article text is input into the article encoder to obtain the second feature vector representation of all characters in the final article text.

[0022] Based on the first feature vector and the second feature vector, the similarity score between the query text and the extracted pseudo-query text is determined by the vector dot product.

[0023] In some embodiments of this application, the pseudo-query model is trained using multiple article texts and multiple query texts corresponding to the articles as training samples; a given article is input into the pseudo-query model to obtain at least one pseudo-query text corresponding to the given article.

[0024] In some embodiments of this application, positive samples are constructed based on a given query text, positively related articles, and a first pseudo-query text, including:

[0025] The positive sample is obtained by combining the given query text, a positively related article, and a first pseudo-query text.

[0026] In some embodiments of this application, negative samples are constructed based on a given query text, positively related articles, irrelevant articles, a first pseudo-query text, and a second pseudo-query text, including:

[0027] A negative sample is obtained by combining a given query text, a positively related article, and a second pseudo-query text.

[0028] Furthermore, a negative sample is obtained by combining a given query text, an irrelevant article, and a second pseudo-query text.

[0029] Furthermore, a negative sample is obtained by combining the given query text, an irrelevant article, and a first pseudo-query text.

[0030] According to a second aspect of the embodiments of this application, a retrieval system based on dual-tower recall is provided, specifically including:

[0031] The article sample unit is used to determine, based on a given query text, articles that are positively relevant to the query text and articles that are irrelevant to the query text.

[0032] The pseudo-query unit is used to input positively related articles into the trained pseudo-query model to obtain the first pseudo-query text of the positively related articles; and to input irrelevant articles into the trained pseudo-query model to obtain the second pseudo-query text of the irrelevant articles.

[0033] The training sample unit is used to construct positive samples based on the given query text, positively related articles, and the first pseudo-query text; and to construct negative samples based on the given query text, positively related articles, irrelevant articles, the first pseudo-query text, and the second pseudo-query text.

[0034] The model retrieval unit is used to input positive and negative samples into the dual-tower recall model for iterative training; and to input the query into the trained dual-tower recall model to obtain the retrieval results.

[0035] According to a third aspect of the embodiments of this application, a retrieval device based on dual-tower recall is provided, comprising:

[0036] Memory: used to store executable instructions; and

[0037] Processor: Used to connect to memory to execute executable instructions to complete the dual-tower recall-based retrieval method.

[0038] According to a fourth aspect of the embodiments of this application, a computer-readable storage medium is provided having a computer program stored thereon; the computer program is executed by a processor to implement a retrieval method based on dual-tower recall.

[0039] This application employs a dual-tower recall-based retrieval method, system, device, and storage medium. Based on a given query text, it identifies positively relevant and irrelevant articles. The positively relevant articles are input into a trained pseudo-query model to obtain a first pseudo-query text containing positively relevant articles. Irrelevant articles are input into the trained pseudo-query model to obtain a second pseudo-query text containing irrelevant articles. Positive samples are constructed based on the given query text, positively relevant articles, and the first pseudo-query text. Negative samples are constructed based on the given query text, positively relevant articles, irrelevant articles, the first pseudo-query text, and the second pseudo-query text. The positive and negative samples are input into the dual-tower recall model for iterative training. Finally, the query is input into the trained dual-tower recall model to obtain the retrieval results. This application can construct multiple strongly relevant negative samples through pseudo-queries for model learning, significantly improving the model's retrieval efficiency and accuracy. Attached Figure Description

[0040] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings:

[0041] Figure 1 The diagram illustrates the steps of a dual-tower recall-based retrieval method according to an embodiment of this application.

[0042] Figure 2 The diagram illustrates the steps of iterative training of the dual-tower recall model according to an embodiment of this application.

[0043] Figure 3 The diagram illustrates the steps for calculating a similarity score according to an embodiment of this application.

[0044] Figure 4 The diagram illustrates the principle of calculating similarity scores according to embodiments of this application;

[0045] Figure 5 The diagram shows a schematic representation of a dual-tower recall-based retrieval system according to an embodiment of this application.

[0046] Figure 6 The diagram shows a structural schematic of a dual-tower recall retrieval device according to an embodiment of this application. Detailed Implementation

[0047] In the process of developing this application, the inventors discovered that in the medical field, artificial intelligence models can be used to retrieve the medical record information needed by users from massive amounts of electronic medical records, which helps to provide users with medical record references. Currently, the mainstream dense vector retrieval methods based on a dual-tower architecture generally explore two aspects to achieve performance requirements:

[0048] a) In terms of model training, the traditional BM25 method is usually used to select more difficult negative samples for training. For a given query, the selected negative samples are always fixed and cannot be learned. This will result in the negative samples required for the final model training not being representative, or the negative samples and positive samples being too easily distinguishable, thus affecting the final performance of the model.

[0049] b) In terms of model design, due to the adoption of the dual-tower architecture, the information interaction in the later stages of the model becomes particularly important. Usually, more complex modules are introduced to enhance the information modeling between the query and the passage. On the one hand, the introduction of these modules increases the latency of the model and puts a great burden on the deployment and inference of the model. On the other hand, the introduction of complex modules cannot be adapted to existing large-scale dense vector retrieval frameworks, such as Faiss and Milvus, which weakens the original advantages of the dual-tower architecture.

[0050] In summary, the existing technical solutions have the following problems: the negative samples required for training are fixed or the distinction between negative and positive samples is very high, resulting in overly simplistic training; the addition of information interaction modeling during model design increases the model's latency, which in turn greatly affects the model's final retrieval performance.

[0051] When acquiring training samples, such as in medical applications, the sample images are medical images. The objects contained in the sample images belong to the type of lesions, that is, the parts of the body where diseases have occurred. Medical images refer to images of internal tissues obtained non-invasively for medical treatment or research, such as images of the stomach, abdomen, heart, knees, and brain. These include images generated by medical instruments such as CT (Computed Tomography), MRI (Magnetic Resonance Imaging), US (ultrasound), X-ray images, electroencephalograms, and optical imaging.

[0052] The data used in this application is medical data, such as personal health records, prescriptions, and examination reports.

[0053] Based on this, this application proposes a multi-view dual-tower dense vector recall method based on pseudo-queries, wherein: a) multiple strongly related negative samples are dynamically constructed through pseudo-queries for model learning; b) for a given article, multiple different perspectives are generated in advance to describe it, no longer relying on the complex modules introduced by the model later due to information interaction.

[0054] Specifically, the dual-tower recall-based retrieval method, system, device, and storage medium of this application determine positively relevant and irrelevant articles based on a given query text; input the positively relevant articles into a trained pseudo-query model to obtain a first pseudo-query text of positively relevant articles; input the irrelevant articles into the trained pseudo-query model to obtain a second pseudo-query text of irrelevant articles; construct positive samples based on the given query text, positively relevant articles, and the first pseudo-query text; construct negative samples based on the given query text, positively relevant articles, irrelevant articles, the first pseudo-query text, and the second pseudo-query text; input the positive and negative samples into the dual-tower recall model for iterative training; input the query to be retrieved into the trained dual-tower recall model to obtain the retrieval results. This application can construct multiple strongly relevant negative samples through pseudo-queries for model learning, greatly improving the retrieval efficiency and accuracy of the model.

[0055] This application provides multiple perspectives for describing the article representation by sampling different pseudo-queries, thereby enhancing and highlighting the core and important information in the article representation.

[0056] Meanwhile, by migrating the complex information interactions in the later stages of the model to the earlier stages, pseudo-queries for all articles can be pre-calculated offline. This greatly reduces the inference latency of the model while ensuring performance, and retains the original advantages of the dual-tower architecture.

[0057] Due to the randomness introduced by the pseudo-query, the composition of negative samples is no longer static, allowing the model to continuously learn new information. Furthermore, in terms of negative sample design, the innovative approach of introducing the negative sample that is "closest" to the given query greatly enhances the model's ability to distinguish between positive and negative samples.

[0058] To make the technical solutions and advantages of the embodiments of this application clearer, the exemplary embodiments of this application will be described in further detail below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not an exhaustive list of all embodiments. It should be noted that, unless otherwise specified, the embodiments and features in the embodiments of this application can be combined with each other.

[0059] Example 1

[0060] Figure 1The diagram illustrates the steps of a dual-tower recall-based retrieval method according to an embodiment of this application. Figure 1 As shown, the dual-tower recall-based retrieval method of this application includes the following steps:

[0061] S1: Based on the given query text, determine the articles that are positively related to the given query text and the articles that are not.

[0062] S2: Input the positively related articles into the trained pseudo-query model to obtain the first pseudo-query text of the positively related articles; input the irrelevant articles into the trained pseudo-query model to obtain the second pseudo-query text of the irrelevant articles.

[0063] S3: Construct positive samples based on the given query text, positively related articles, and the first pseudo-query text; construct negative samples based on the given query text, positively related articles, irrelevant articles, the first pseudo-query text, and the second pseudo-query text.

[0064] S4: Input positive and negative samples into the dual-tower recall model for iterative training; input the query to be searched into the trained dual-tower recall model to obtain the retrieval results.

[0065] This application can construct multiple strongly correlated negative samples through pseudo-queries for model learning, which greatly improves the model's retrieval efficiency and accuracy.

[0066] In practice, S1 determines, based on the given query text, articles that are positively relevant to the query text and articles that are irrelevant, including:

[0067] First, select at least one public dataset; for example, use the public dataset TREC 2022 Passageranking dataset.

[0068] Then, based on at least one public dataset, a given query text is matched to obtain at least one positively related article that is related to the given query text, and at least one irrelevant article that is not related to the given query text.

[0069] In specific digital healthcare scenarios, the dataset refers to medical data, and the query text refers to medical text. Medical data includes personal health records, prescriptions, and examination reports. Medical text can be electronic healthcare records, which are digitized personal health records, including medical records, electrocardiograms, medical images, and other electronic records with archival and future reference value.

[0070] Figure 2 The diagram illustrates the steps of iterative training of the dual-tower recall model according to an embodiment of this application.

[0071] like Figure 2 As shown, in step S4, positive and negative samples are input into the dual-tower recall model for iterative training, including:

[0072] S41: Determine the similarity score between the query text and the pseudo-query text based on the given article; S42: Calculate the total loss of the dual-tower recall model based on the vector similarity score, so that the output distribution of the dual-tower recall model fits.

[0073] Figure 3 The diagram illustrates the steps for calculating a similarity score according to an embodiment of this application. Figure 4 The diagram illustrates the principle flowchart for calculating similarity scores according to embodiments of this application.

[0074] like Figure 3 and Figure 4 As shown, specifically, in S41, based on the query text and the pseudo-query text based on the given article, a similarity score is determined between the query text and the pseudo-query text, including:

[0075] S411: Concatenate special characters into the query text object to obtain the final query text;

[0076] S412: Input the final query text into the query encoder to obtain the first feature vector representation of all characters in the query text;

[0077] S413: Concatenate special characters into the query article object, and input the concatenated query article into the pseudo query model to obtain at least one pseudo query text;

[0078] S414: Extract a pseudo-query text and concatenate it with the concatenated query article to obtain the final article text;

[0079] S415: Input the final article text into the article encoder to obtain the second feature vector representation of all characters in the final article text;

[0080] S416: Based on the first feature vector representation and the second feature vector, determine the similarity score between the query text and the extracted pseudo-query text through the vector dot product.

[0081] The pseudo-query model of S2 is trained using multiple article texts and multiple query texts corresponding to the articles as training samples; a given article is input into the pseudo-query model to obtain at least one pseudo-query text corresponding to the given article.

[0082] Specifically, in S3, positive samples are constructed based on the given query text, a positively related article, and the first pseudo-query text. This includes combining the given query text, a positively related article, and the first pseudo-query text to obtain positive samples.

[0083] Specifically, in S3, negative samples are constructed based on the given query text, positively related articles, irrelevant articles, the first pseudo-query text, and the second pseudo-query text. This includes: combining the given query text, a positively related article, and a second pseudo-query text to obtain a negative sample; combining the given query text, an irrelevant article, and a second pseudo-query text to obtain a negative sample; and combining the given query text, an irrelevant article, and the first pseudo-query text to obtain a negative sample.

[0084] See Figure 4 To further illustrate the dual-tower recall-based retrieval scheme of this application, the following description is provided through specific implementation scenarios.

[0085] Step 1) Let q represent the query text object, q1, q2, q3, q4, q5, ..., qi represent each character in the query text object q sequence, and i is the length of the query text object.

[0086] Step 2) Prepend the special character [CLS] before the query text object to mark the beginning of the query text, and prepend the special character [SEP] after the query text object to mark the end of the query text;

[0087] The final query text will be in the form of [CLS],q1,q2,q3,q4,q5,…,ql,[SEP].

[0088] Step 3) Take the concatenated query text obtained in Step 2) as input and use the query encoder (here, the mainstream BERT model is selected) to obtain the encoded vector representation Eq_ori for all positions.

[0089] Eq_ori=[E[CLS],Eq1,Eq2,Eq3,…,Eql,E[SEP]];

[0090] In Eq_ori, each position is a 768-dimensional vector.

[0091] Step 4) Take out the first vector E[CLS] from Eq_ori obtained in Step 3), normalize it by L2 so that its L2 norm is equal to 1, and denote the result as Eq, which is used as the feature vector representation of the query.

[0092] Step 5) Let d represent the article text object, d1, d2, d3, d4, d5, ..., dn represent each character in the sequence d of the article text object, and n is the length of the article text object.

[0093] Step 6) Prepend the special character [cls] before the text object to mark the beginning of the text, and prepend the special character [SEP] after the text object to mark the end of the text;

[0094] The current text format is A = [cls], d1, d2, d3, d4, d5, ..., dn, [SEP].

[0095] Step 7) Use the result obtained in Step 6) as input to the docTTTTTquery model to obtain the pseudo-query list Pseudo_query_list:

[0096] Pseudo_query_list=docTTTTTquery(A);

[0097] Pseudo_query_list=[qq1,qq2,qq3,…,qq10];

[0098] The docTTTTTTquery model uses a large number of passages and their corresponding queries as training samples. Once trained, the model can predict a list of possible queries for a given passage as input. Details of the docTTTTTTquery model can be found in existing models and will not be elaborated upon here.

[0099] Here, by using the top-k sampling strategy of the docTTTTTquery model itself, and setting k=10, we finally obtain 10 different pseudo-query descriptions corresponding to a given article. Each pseudo-query description qqi can represent a summary or perspective of a given input article A.

[0100] Step 8) Extract each qqi from the pseudo-query list Pseudo_query_list and concatenate it with the article object from Step 5), concatenating the beginning with the special character [cls] and the end with the special character [SEP]; the final article text will be in the form of: [cls], qqi, d1, d2, d3, d4, d5, ..., dn, [SEP].

[0101] Step 9) Take the concatenated article text obtained in Step 8) as input, and use the article encoder to obtain the encoded vector representation Ed_ori for all positions. Here, the article encoder also uses the BERT model.

[0102] Ed_ori=[E[cls],Eqqi,Ed1,Ed2,Ed3,…,Edn].

[0103] Step 10) Take out the first vector E[CLS] from Ed_ori obtained in Step 9), normalize it by L2 so that its L2 norm is equal to 1, and denote the result as Ed.

[0104] Step 11) Calculate the similarity between the vector representation of the query obtained in Step 4) and the vector representation of the article obtained in Step 10); here, the similarity is measured by a simple vector inner product, and the final score is the similarity score of the combination of the given query and the given article and one of the pseudo queries.

[0105] The training phase of the dual-tower recall model will be described in detail below.

[0106] First, using the publicly available TREC 2022 Passage ranking dataset, for a given query q, there exists a positively correlated article d+ and an irrelevant article d-, forming a combination (q, d+, d-). Using steps 5)-7), we can obtain a pseudo-query list qq+ for the positively correlated article d+ and a pseudo-query list qq- for the irrelevant article d-.

[0107] For a given q, the positive sample is constructed as: (q, [qqi+, d+]); that is, the combination of each pseudo-query in the pseudo-query list qq+ of the positively related article d+ and the positively related article d+. The combination form is step 8). For the convenience of subsequent formula derivation, it is simply denoted as (q, d) here. + ).

[0108] Negative samples are constructed in three forms: (q, [qqi-, d+]), (q, [qqi+, d-]), or (q, [qqi-, d-]). That is, they are constructed using a combination of each pseudo-query qqi- from irrelevant articles and d+ from positively relevant articles; or a combination of each pseudo-query qqi+ from positively relevant articles and d- from irrelevant articles; or a combination of each pseudo-query qqi- from irrelevant articles and d- from irrelevant articles. Finally, the sum of all negative samples is abbreviated as qqi-[qqi-, d+]. The first two types of negative samples actually contain some positive sample components, further increasing the learning difficulty of the model.

[0109] During model iterative training, the goal is to maximize the model's score for positive samples and minimize its score for negative samples. Therefore, the following loss function was designed:

[0110]

[0111] Here, s() is the similarity score calculated in step 11) above.

[0112] Make the model applicable to positive samples s(q,d)+ For negative samples s(q,d), the predicted score should be as high as possible, close to 1; for negative samples s(q,d), the predicted score should be as low as possible, close to 0.

[0113] Finally, the stochastic gradient descent (SGD) algorithm and the PyTorch framework were used for modeling and parameter updating.

[0114] Finally, inference phase: For a given query q and article d, calculate the final similarity score for each pseudo-query in the pseudo-query list according to steps 1)-11), and use the highest score as the final similarity score between query q and article d.

[0115] Finally, specifically, the dual-tower recall-based retrieval method of this application involves: determining positively relevant and irrelevant articles based on a given query text; inputting the positively relevant articles into a trained pseudo-query model to obtain the first pseudo-query text of positively relevant articles; inputting the irrelevant articles into the trained pseudo-query model to obtain the second pseudo-query text of irrelevant articles; constructing positive samples based on the given query text, positively relevant articles, and the first pseudo-query text; constructing negative samples based on the given query text, positively relevant articles, irrelevant articles, the first pseudo-query text, and the second pseudo-query text; inputting the positive and negative samples into the dual-tower recall model for iterative training; and inputting the query to be retrieved into the trained dual-tower recall model to obtain the retrieval results. This application can construct multiple strongly relevant negative samples through pseudo-queries for model learning, greatly improving the retrieval efficiency and accuracy of the model.

[0116] This application provides multiple perspectives for describing the article representation by sampling different pseudo-queries, thereby enhancing and highlighting the core and important information in the article representation.

[0117] Meanwhile, by migrating the complex information interactions in the later stages of the model to the earlier stages, pseudo-queries for all articles can be pre-calculated offline. This greatly reduces the inference latency of the model while ensuring performance, and retains the original advantages of the dual-tower architecture.

[0118] Due to the randomness introduced by the pseudo-query, the composition of negative samples is no longer static, allowing the model to continuously learn new information. Furthermore, in terms of negative sample design, the innovative approach of introducing the negative sample that is "closest" to the given query greatly enhances the model's ability to distinguish between positive and negative samples.

[0119] Example 2

[0120] This embodiment provides a retrieval system based on dual-tower recall. For details not disclosed in this embodiment's dual-tower recall retrieval system, please refer to the specific implementation details of the dual-tower recall retrieval methods in other embodiments.

[0121] Figure 5 The diagram shows a schematic of the structure of a dual-tower recall-based retrieval system according to an embodiment of this application.

[0122] like Figure 5 As shown, the dual-tower recall-based retrieval system of this application embodiment specifically includes an article sample unit 10, a pseudo-query unit 20, a training sample unit 30, and a model retrieval unit 40.

[0123] Specifically,

[0124] Article sample unit 10 is used to determine, based on the given query text, articles that are positively related to the query text and articles that are not related to the query text.

[0125] The pseudo-query unit 20 is used to input positively related articles into the trained pseudo-query model to obtain the first pseudo-query text of the positively related articles; and to input irrelevant articles into the trained pseudo-query model to obtain the second pseudo-query text of the irrelevant articles.

[0126] Training sample unit 30 is used to construct positive samples based on a given query text, positively related articles, and a first pseudo-query text; and to construct negative samples based on a given query text, positively related articles, irrelevant articles, a first pseudo-query text, and a second pseudo-query text.

[0127] The model retrieval unit 40 is used to input positive and negative samples into the dual-tower recall model for iterative training; and to input the query into the trained dual-tower recall model to obtain the retrieval results.

[0128] The dual-tower recall retrieval system proposed in this application can construct multiple strongly related negative samples through pseudo-queries for model learning, which greatly improves the retrieval efficiency and accuracy of the model.

[0129] This application provides multiple perspectives for describing the article representation by sampling different pseudo-queries, thereby enhancing and highlighting the core and important information in the article representation.

[0130] Meanwhile, by migrating the complex information interactions in the later stages of the model to the earlier stages, pseudo-queries for all articles can be pre-calculated offline. This greatly reduces the inference latency of the model while ensuring performance, and retains the original advantages of the dual-tower architecture.

[0131] Example 3

[0132] This embodiment provides a retrieval device based on dual-tower recall. For details not disclosed in the dual-tower recall retrieval device of this embodiment, please refer to the specific implementation of the retrieval method or system based on dual-tower recall in other embodiments.

[0133] Figure 6 The diagram shows a structural schematic of a dual-tower recall-based retrieval device 400 according to an embodiment of this application.

[0134] like Figure 6 As shown, the dual-tower recall-based retrieval device 400 includes:

[0135] Memory 402: Used to store executable instructions; and

[0136] Processor 401: Used to connect with memory 402 to execute executable instructions for a dual-tower recall-based retrieval method.

[0137] Those skilled in the art will understand that the illustration Figure 6 This is merely an example of a dual-tower recall-based retrieval device 400 and does not constitute a limitation on the dual-tower recall-based retrieval device 400. It may include more or fewer components than illustrated, or combine certain components, or different components. For example, the dual-tower recall-based retrieval device 400 may also include input / output devices, network access devices, buses, etc.

[0138] The processor 401 (Central Processing Unit, CPU) can also be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor, or processor 401 can be any conventional processor. Processor 401 is the control center of the dual-tower recall retrieval device 400, connecting all parts of the dual-tower recall retrieval device 400 via various interfaces and lines.

[0139] The memory 402 can be used to store computer-readable instructions. The processor 401 implements various functions of the dual-tower recall-based retrieval device 400 by running or executing the computer-readable instructions or modules stored in the memory 402 and by calling the data stored in the memory 402. The memory 402 may mainly include a program storage area and a data storage area. The program storage area may store the operating system, application programs required for at least one function (such as sound playback function, image playback function, etc.), etc.; the data storage area may store data created according to the use of the dual-tower recall-based retrieval device 400, etc. In addition, the memory 402 may include a hard disk, memory, plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, at least one disk storage device, flash memory device, read-only memory (ROM), random access memory (RAM), or other non-volatile / volatile storage devices.

[0140] If the integrated module of the dual-tower recall retrieval device 400 is implemented as a software functional module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments of the present invention can also be implemented by instructing related hardware through computer-readable instructions. These computer-readable instructions can be stored in a computer-readable storage medium, and when executed by a processor, they can implement the steps of the various method embodiments described above.

[0141] Example 4

[0142] This embodiment provides a computer-readable storage medium on which a computer program is stored; the computer program is executed by a processor to implement the dual-tower recall-based retrieval method in other embodiments.

[0143] The dual-tower recall-based retrieval device and storage medium of this application, based on a given query text, determines positively relevant and irrelevant articles for that query text; inputs the positively relevant articles into a trained pseudo-query model to obtain a first pseudo-query text of positively relevant articles; inputs the irrelevant articles into the trained pseudo-query model to obtain a second pseudo-query text of irrelevant articles; constructs positive samples based on the given query text, positively relevant articles, and the first pseudo-query text; constructs negative samples based on the given query text, positively relevant articles, irrelevant articles, the first pseudo-query text, and the second pseudo-query text; inputs the positive and negative samples into the dual-tower recall model for iterative training; and inputs the query to be retrieved into the trained dual-tower recall model to obtain the retrieval results. This application can construct multiple strongly relevant negative samples through pseudo-queries for model learning, greatly improving the retrieval efficiency and accuracy of the model.

[0144] This application provides multiple perspectives for describing the article representation by sampling different pseudo-queries, thereby enhancing and highlighting the core and important information in the article representation.

[0145] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0146] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0147] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0148] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0149] The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. The singular forms “a,” “the,” and “the” used in this invention and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used herein refers to and includes any or all possible combinations of one or more of the associated listed items.

[0150] It should be understood that although the terms first, second, third, etc., may be used in this invention to describe various information, this information should not be limited to these terms. These terms are only used to distinguish information of the same type from one another. For example, first information may also be referred to as second information without departing from the scope of this invention, and similarly, second information may also be referred to as first information. Depending on the context, the word "if" as used herein may be interpreted as "when," "when," or "in response to a determination."

[0151] Although preferred embodiments of this application have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments as well as all changes and modifications falling within the scope of this application.

[0152] Obviously, those skilled in the art can make various modifications and variations to this application without departing from the spirit and scope of this application. Therefore, if such modifications and variations fall within the scope of the claims of this application and their equivalents, this application also intends to include such modifications and variations.

Claims

1. A retrieval method based on dual-tower recall, characterized in that, include: Based on the given query text, determine the articles that are positively relevant to the given query text and the articles that are irrelevant to the given query text; The given query text is obtained by concatenating a first special character before the query text object and a second special character after the query text object; The first special character marks the beginning of the query text, and the second special character marks the end of the query text; Input the positively related articles into the trained pseudo-query model to obtain the first pseudo-query text of the positively related articles; The irrelevant articles are input into the trained pseudo-query model to obtain the second pseudo-query text of the positively related articles; Construct positive samples based on the given query text, positively related articles, and the first pseudo-query text; The first negative sample is obtained by combining the given query text, a positively related article, and a second pseudo-query text. The second negative sample is obtained by combining the given query text, an irrelevant article, and a second pseudo query text. The third negative sample is obtained by combining the given query text, an irrelevant article, and a first pseudo query text. The positive and negative samples are input into the dual-tower recall model for iterative training. Input the query into the trained dual-tower recall model to obtain the retrieval results; The step of inputting the positive and negative samples into the dual-tower recall model for iterative training includes: The query text object is concatenated with special characters to obtain the final query text; the final query text is input into the query encoder to obtain the first feature vector representation corresponding to all characters in the query text; the query article object is concatenated with special characters, and the concatenated query article is input into the pseudo-query model to obtain at least one pseudo-query text; one pseudo-query text is extracted and concatenated with the concatenated query article to obtain the final article text; the final article text is input into the article encoder to obtain the second feature vector representation corresponding to all characters in the final article text; based on the first feature vector representation and the second feature vector, the similarity score between the query text and the extracted pseudo-query text is determined by the vector dot product. The total loss of the dual-tower recall model is calculated based on the vector similarity score, so that the output distribution of the dual-tower recall model is fitted. The loss function of the dual-tower recall model during iterative training is as follows: ; in, To query a text object, For the article text object, For articles with positive correlation, The sum of all negative samples. The similarity score is used; the loss function is applied to make the dual-tower recall model more effective for positive samples. The predicted score is close to 1; for negative samples The score is close to 0.

2. The retrieval method based on dual-tower recall according to claim 1, characterized in that, The step of determining the positively relevant articles and irrelevant articles based on the given query text includes: Select at least one publicly available dataset; the dataset is medical data. Based on the at least one public dataset, the given query text is matched to obtain at least one positively related article and at least one unrelated article; the query text is medical text.

3. The retrieval method based on dual-tower recall according to claim 1, characterized in that, The pseudo-query model is trained using multiple article texts and multiple query texts corresponding to the articles as training samples; when a given article is input into the pseudo-query model, at least one pseudo-query text corresponding to the given article is obtained.

4. The retrieval method based on dual-tower recall according to claim 1, characterized in that, The step of constructing positive samples based on the given query text, positively related articles, and the first pseudo-query text includes: The positive sample is obtained by combining the given query text, a positively related article, and a first pseudo-query text.

5. A retrieval system based on dual-tower recall, characterized in that, Specifically, it includes: The article sample unit is used to determine, based on a given query text, articles that are positively related to the given query text and articles that are irrelevant to the given query text; The given query text is obtained by concatenating a first special character before the query text object and a second special character after the query text object; The first special character marks the beginning of the query text, and the second special character marks the end of the query text; The pseudo-query unit is used to input the positively related articles into the trained pseudo-query model to obtain the first pseudo-query text of the positively related articles; This is used to input the irrelevant articles into the trained pseudo-query model to obtain the second pseudo-query text of the positively related articles; The training sample unit is used to construct positive samples based on the given query text, positively related articles, and the first pseudo-query text; The first negative sample is obtained by combining the given query text, a positively related article, and a second pseudo-query text. The second negative sample is obtained by combining the given query text, an irrelevant article, and a second pseudo query text. The third negative sample is obtained by combining the given query text, an irrelevant article, and a first pseudo query text. The model retrieval unit is used to input the positive and negative samples into the dual-tower recall model for iterative training. Input the query into the trained dual-tower recall model to obtain the retrieval results; The step of inputting the positive and negative samples into the dual-tower recall model for iterative training includes: The query text object is concatenated with special characters to obtain the final query text; the final query text is input into the query encoder to obtain the first feature vector representation corresponding to all characters in the query text; the query article object is concatenated with special characters, and the concatenated query article is input into the pseudo-query model to obtain at least one pseudo-query text; one pseudo-query text is extracted and concatenated with the concatenated query article to obtain the final article text; the final article text is input into the article encoder to obtain the second feature vector representation corresponding to all characters in the final article text; based on the first feature vector representation and the second feature vector, the similarity score between the query text and the extracted pseudo-query text is determined by the vector dot product. The total loss of the dual-tower recall model is calculated based on the vector similarity score, so that the output distribution of the dual-tower recall model is fitted. The loss function of the dual-tower recall model during iterative training is as follows: ; in, To query a text object, For the article text object, For articles with positive correlation, The sum of all negative samples. The similarity score is used; the loss function is applied to make the dual-tower recall model more effective for positive samples. The predicted score is close to 1; for negative samples The score is close to 0.

6. A retrieval device based on dual-tower recall, comprising: Memory: Used to store executable instructions; as well as Processor: for connection to memory to execute executable instructions to perform the dual-tower recall retrieval method as described in any one of claims 1-4.

7. A computer-readable storage medium, characterized in that, It stores a computer program; the computer program is executed by a processor to implement the dual-tower recall-based retrieval method as described in any one of claims 1-4.