Search recall method and device, equipment and medium

By generating word vectors for search information and candidate resources, and utilizing multi-domain attribute information to calculate relevance, the problem of insufficient search recall accuracy in existing technologies is solved, achieving more efficient and accurate search recall.

CN121658671APending Publication Date: 2026-03-13TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-10
Publication Date
2026-03-13

AI Technical Summary

Technical Problem

In existing technologies, the accuracy of search and recall is poor and cannot be effectively improved.

Method used

By generating word vectors for search information and candidate resources, and utilizing multi-domain attribute information to calculate relevance, target candidate resources are selected to improve recall accuracy.

Benefits of technology

It improves the accuracy and efficiency of search recall, enhances the fine granularity of relevance calculation, and makes up for the problem of incomplete attribute information acquisition.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121658671A_ABST
    Figure CN121658671A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses a search recall method and device, equipment and a medium. The method comprises the steps that if search information is received, a first word vector corresponding to the search information is generated, a second word vector corresponding to each candidate resource is obtained, and the second word vectors of the same candidate resource are obtained based on multi-domain attribute information of the same candidate resource; the method comprises the following steps: searching search information of a plurality of candidate resources, calculating based on a first word vector and a second word vector corresponding to each candidate resource to obtain correlation between the search information and each candidate resource, and selecting a target candidate resource from the plurality of candidate resources based on the correlation to obtain a search recall result corresponding to the search information. According to the technical scheme, the search recall accuracy is high.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and more specifically, to a search and recall method, a search and recall device, an electronic device, and a computer-readable medium. Background Technology

[0002] With the continuous development of computer technology, the performance of search engines is also constantly being optimized. The front end of a search engine receives the search information entered by the user and displays the search results corresponding to the search information. The back end of the search engine retrieves the target resource corresponding to the search information from multiple candidate resources based on the search information passed in by the front end, so as to obtain the search results corresponding to the search information and return them to the front end.

[0003] Two common approaches to search recall are employed in related technologies. Specifically, approach one is semantic-based search recall, which primarily involves matching search information with candidate resources based on semantic relevance. Approach two is inverted index-based search recall, which primarily involves matching search information with candidate resources based on lexical relevance. Both approaches exhibit relatively poor accuracy in search recall.

[0004] Therefore, improving the accuracy of search recall is an urgent problem to be solved. Summary of the Invention

[0005] The embodiments of this application provide a search and recall method, apparatus, device, and medium with high search and recall accuracy.

[0006] In a first aspect, embodiments of this application provide a search retrieval method, the method comprising: if search information is received, generating a first word vector corresponding to the search information, and obtaining a second word vector corresponding to each candidate resource, wherein the second word vector of the same candidate resource is obtained based on the multi-domain attribute information of the same candidate resource; calculating the correlation between the search information and each candidate resource based on the first word vector and the second word vector corresponding to each candidate resource; and selecting a target candidate resource from multiple candidate resources based on the correlation to obtain a search retrieval result corresponding to the search information.

[0007] Secondly, embodiments of this application provide a search retrieval device, the device comprising: a generation and acquisition module configured to, upon receiving search information, generate a first word vector corresponding to the search information and acquire a second word vector corresponding to each candidate resource, wherein the second word vector of the same candidate resource is obtained based on the multi-domain attribute information of the same candidate resource; a calculation module configured to perform calculations based on the first word vector and the second word vector corresponding to each candidate resource to obtain the correlation between the search information and each candidate resource; and a selection module configured to select a target candidate resource from multiple candidate resources based on the correlation to obtain the search retrieval result corresponding to the search information.

[0008] In one embodiment of this application, based on the aforementioned scheme, there are multiple first word vectors, and multiple second word vectors corresponding to each candidate resource; the calculation module is specifically configured to: for each first word vector, calculate the similarity between the first word vector and each second word vector in the same candidate resource, and use the maximum similarity as the similarity reference information corresponding to the first word vector; based on the similarity reference information corresponding to the multiple first word vectors respectively, obtain the relevance between the search information and the same candidate resource.

[0009] In one embodiment of this application, based on the foregoing scheme, the calculation module is further configured to: perform an average calculation on the similarity reference information corresponding to the multiple first word vectors respectively to obtain an average similarity; and use the average similarity as the correlation between the search information and the same candidate resource.

[0010] In one embodiment of this application, based on the foregoing scheme, the generation and acquisition module is specifically configured to: acquire a second word vector corresponding to each candidate resource from the candidate resource library; correspondingly, the multi-domain attribute information includes document title and document content, and the device further includes a storage module configured to: acquire the document title and document content corresponding to each candidate resource; obtain the second word vector corresponding to each candidate resource based on the document title and document content corresponding to each candidate resource; and store the second word vector corresponding to each candidate resource in the candidate resource library.

[0011] In one embodiment of this application, based on the foregoing scheme, the storage module is specifically configured to: perform word segmentation on the document title corresponding to each candidate resource to obtain a first candidate word corresponding to the document title, and perform word segmentation on the document content corresponding to each candidate resource to obtain a second candidate word corresponding to the document content; generate a first candidate word vector of the first candidate word based on the context of the first candidate word, and generate a second candidate word vector of the second candidate word based on the context of the second candidate word; and combine the first candidate word vector and the second candidate word vector corresponding to the same candidate resource to obtain a second word vector corresponding to the same candidate resource.

[0012] In one embodiment of this application, based on the foregoing scheme, the storage module is further configured to: extract key information from the document content corresponding to each candidate resource; and perform word segmentation on the key information corresponding to each candidate resource to obtain a second candidate word corresponding to the key information.

[0013] In one embodiment of this application, based on the aforementioned scheme, a first word vector corresponding to the search information is generated through a recall model, and a second word vector corresponding to each candidate resource is obtained. The correlation between the search information and each candidate resource is calculated based on the first word vector and the second word vector corresponding to each candidate resource. A target candidate resource is selected from multiple candidate resources based on the correlation to obtain the search recall result corresponding to the search information. The device further includes a training module configured to: acquire search sample information and candidate sample resources; input the search sample information and the candidate sample resources into a model to be trained; generate a first sample word vector corresponding to the search sample information through the model to be trained; generate a second sample word vector corresponding to the candidate sample resource based on the multi-domain sample attribute information of the candidate sample resource; calculate the sample correlation between the search sample information and the candidate sample resource based on the first sample word vector and the second sample word vector; construct a loss based on the first sample word vector, the second sample word vector, and the sample correlation; and train the model to be trained based on the loss to obtain the recall model.

[0014] In one embodiment of this application, based on the aforementioned scheme, the recall model includes a contrast learning module and a similarity calculation module; the contrast learning module is used to generate a first word vector corresponding to the search information and obtain a second word vector corresponding to each candidate resource; wherein, the contrast learning module is trained based on the first sample word vector and the second sample word vector; the similarity calculation module is used to calculate the correlation between the search information and each candidate resource based on the first word vector and the second word vector corresponding to each candidate resource, and select a target candidate resource from multiple candidate resources based on the correlation to obtain the search recall result corresponding to the search information; wherein, the similarity calculation module is trained based on the sample correlation.

[0015] In one embodiment of this application, based on the aforementioned scheme, the candidate sample resources include positive sample resources and negative sample resources; the training module is specifically configured to: generate a first sample word vector corresponding to the search sample information through the first functional module of the model to be trained; generate a positive sample word vector corresponding to the positive sample resource based on the multi-domain sample attribute information of the positive sample resource; and generate a negative sample word vector corresponding to the negative sample resource based on the multi-domain sample attribute information of the negative sample resource; and use the positive sample word vector and the negative sample word vector as a second sample word vector; construct a contrastive learning loss function based on the first sample word vector and the second sample word vector; and train the first functional module based on the contrastive learning loss function to obtain the contrastive learning module.

[0016] In one embodiment of this application, based on the foregoing scheme, the multi-domain sample attribute information includes document title and document content; the training module is further specifically configured to: obtain the document title and document content corresponding to the positive sample resource, and obtain the positive sample word vector corresponding to the positive sample resource based on the document title and document content corresponding to the positive sample resource; and obtain the document title and document content corresponding to the negative sample resource, and obtain the negative sample word vector corresponding to the negative sample resource based on the document title and document content corresponding to the negative sample resource.

[0017] In one embodiment of this application, based on the foregoing scheme, the first functional module includes a first encoder and a second encoder that are independent of each other; the training module is further specifically configured to: generate a first sample word vector corresponding to the search sample information through the first encoder; generate a positive sample word vector corresponding to the positive sample resource based on the multi-domain sample attribute information of the positive sample resource through the second encoder, and generate a negative sample word vector corresponding to the negative sample resource based on the multi-domain sample attribute information of the negative sample resource.

[0018] In one embodiment of this application, based on the foregoing scheme, the training module is specifically configured as follows: the second functional module of the model to be trained calculates the sample correlation between the search sample information and the candidate sample resource based on the first sample word vector and the second sample word vector; a similarity calculation loss function is constructed based on the sample correlation, and the second functional module is trained based on the similarity calculation loss function to obtain the similarity calculation module.

[0019] In one embodiment of this application, based on the aforementioned scheme, there are multiple first sample word vectors and multiple second sample word vectors; the training module is further specifically configured to: through the second functional module of the model to be trained, calculate the similarity between each first sample word vector and each second sample word vector in the candidate sample resources, and take the largest similarity as the similarity sample reference information corresponding to the first sample word vector; based on the similarity sample reference information corresponding to the multiple first sample word vectors respectively, obtain the correlation between the search sample information and the candidate sample resources.

[0020] Thirdly, embodiments of this application provide an electronic device, including one or more processors; and a memory for storing one or more computer programs, which, when executed by the one or more processors, enable the electronic device to implement the search and retrieval method as described above.

[0021] Fourthly, embodiments of this application provide a computer-readable medium having a computer program stored thereon, which, when executed by a processor, implements the search and retrieval method as described above.

[0022] Fifthly, embodiments of this application provide a computer program product, including computer instructions, which, when executed by a processor, implement the search and recall method described above.

[0023] In the technical solution provided by the embodiments of this application: the word vectors of search information and the word vectors of candidate resources are used to calculate the relevance between search information and candidate resources. The relevance calculation has high granularity, which improves the accuracy of the relevance calculation and thus improves the accuracy of search recall. Furthermore, the word vectors of candidate resources are obtained based on the multi-domain attribute information of candidate resources, which covers more comprehensive attribute information, making up for the problem of incomplete attribute information acquisition, further improving the accuracy of relevance calculation, and thus further improving the accuracy of search recall.

[0024] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and do not limit this application. Attached Figure Description

[0025] Figure 1 This is a schematic diagram illustrating an exemplary implementation environment in which the technical solutions of the embodiments of this application can be applied.

[0026] Figure 2 This is a flowchart illustrating a search recall method in an exemplary embodiment of this application.

[0027] Figure 3 This is a flowchart illustrating a search recall method as shown in another exemplary embodiment of this application.

[0028] Figure 4 This is a schematic diagram illustrating a recall model as shown in an exemplary embodiment of this application.

[0029] Figure 5A This is a schematic diagram of a cross encoder shown in an exemplary embodiment of this application.

[0030] Figure 5B This is a schematic diagram of a dual encoder shown in an exemplary embodiment of this application.

[0031] Figure 5C This is a schematic diagram of a post-interactive encoder shown in an exemplary embodiment of this application.

[0032] Figure 6 This is a schematic diagram of a document shown in an exemplary embodiment of this application.

[0033] Figure 7 This is a schematic diagram illustrating the encoding of multi-domain attribute information in an exemplary embodiment of this application.

[0034] Figure 8 This is a schematic diagram illustrating a recall as shown in an exemplary embodiment of this application.

[0035] Figure 9 This is a block diagram illustrating a search recall device in an exemplary embodiment of this application.

[0036] Figure 10 This is a schematic diagram of the structure of a computer system suitable for implementing the electronic devices of the present application embodiments. Detailed Implementation

[0037] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments identical to those described in this application. Rather, they are merely examples of apparatuses and methods identical to some aspects of this application as detailed in the appended claims.

[0038] In this application embodiment, the terms "module" or "unit" refer to a computer program or part of a computer program that has a predetermined function and works with other related parts to achieve a predetermined goal, and can be implemented wholly or partially using software, hardware (such as processing circuitry or memory), or a combination thereof. Similarly, a processor (or multiple processors or memory) can be used to implement one or more modules or units. Furthermore, each module or unit can be part of an overall module or unit that includes the functionality of that module or unit.

[0039] The block diagrams shown in the accompanying drawings are merely functional entities and do not necessarily correspond to physically independent entities. That is, these functional entities can be implemented in software, in one or more hardware modules or integrated circuits, or in different network and / or processor devices and / or microcontroller devices.

[0040] The flowcharts shown in the accompanying drawings are merely illustrative and do not necessarily include all content and operations / steps, nor do they necessarily have to be performed in the described order. For example, some operations / steps can be broken down, while others can be combined or partially combined; therefore, the actual execution order may change depending on the specific circumstances.

[0041] It should be noted that "multiple" as mentioned in this application refers to two or more. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, or B alone. The character " / " generally indicates that the preceding and following related objects have an "or" relationship.

[0042] With the continuous development of computer technology, the performance of search engines is also constantly being optimized. The front end of a search engine receives the search information entered by the user and displays the search results corresponding to the search information. The back end of the search engine retrieves the target resource corresponding to the search information from multiple candidate resources based on the search information passed in by the front end, so as to obtain the search results corresponding to the search information and return them to the front end.

[0043] Two common approaches to search recall are employed in related technologies. Specifically, approach one is semantic-based search recall, which primarily involves matching search information with candidate resources based on semantic relevance. Approach two is inverted index-based search recall, which primarily involves matching search information with candidate resources based on lexical relevance. Both approaches exhibit relatively poor accuracy in search recall.

[0044] Therefore, to improve the accuracy of search recall, this application provides a search recall scheme. Please refer to... Figure 1 , Figure 1 This is a schematic diagram of an implementation environment related to this application. The implementation environment mainly includes a terminal device 101 and a server 102; wherein:

[0045] Terminal devices 101 include, but are not limited to, extended reality devices (virtual reality devices, augmented reality devices, mixed reality devices, etc.), mobile phones, computers (tablets, laptops, desktop computers, etc.), smart home devices (televisions, refrigerators, air conditioners, washing machines, robot vacuums, etc.), smart wearable devices (bracelets, watches, etc.).

[0046] Server 102 can be a standalone physical server, or a server cluster or distributed system consisting of multiple physical servers. The server cluster or distributed system includes cloud servers used to provide basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (CDN), and big data and artificial intelligence platforms.

[0047] It is understood that terminal device 101 and server 102 establish a communication connection via a wired or wireless network. Exemplarily, the wireless or wired network uses standard communication technologies and / or protocols. The network is typically the Internet, but can also be any other network, including but not limited to a Local Area Network (LAN), Metropolitan Area Network (MAN), Wide Area Network (WAN), mobile, wired or wireless networks, private networks, or any combination of virtual private networks.

[0048] In one embodiment of this application, the search recall can be performed by server 102. Specifically, if server 102 receives search information, it generates a first word vector corresponding to the search information and obtains a second word vector corresponding to each candidate resource. The second word vector of the same candidate resource is obtained based on the multi-domain attribute information of the same candidate resource. Then, based on the first word vector and the second word vector corresponding to each candidate resource, the correlation between the search information and each candidate resource is calculated. Then, based on the correlation, the target candidate resource is selected from multiple candidate resources to obtain the search recall result corresponding to the search information.

[0049] In other embodiments of this application, the search and recall method can be executed by the terminal device 101 alone, or by the terminal device 101 and the server 102 together. In practical applications, the executing entity of the search and recall method can be flexibly adjusted according to the specific application scenario.

[0050] It should be made clear that, Figure 1 The number of terminal devices 101 and servers 102 shown is merely illustrative; any number of terminal devices 101 and servers 102 can be used as needed.

[0051] It should be noted that in the specific implementation of this application, user-related data is involved. When the embodiments of this application are applied to specific products or technologies, user permission or consent is required, and the collection, use and processing of related data must comply with the relevant laws, regulations and standards of the relevant countries and regions.

[0052] The following details the various implementation details of the technical solutions in the embodiments of this application:

[0053] Please see Figure 2 , Figure 2 This is a flowchart illustrating a search recall method according to an embodiment of this application.

[0054] like Figure 2 As shown, this search and recall method includes at least S201 to S203, which are described in detail below:

[0055] S201, if search information is received, generate the first word vector corresponding to the search information, and obtain the second word vector corresponding to each candidate resource. The second word vector of the same candidate resource is obtained based on the multi-domain attribute information of the same candidate resource.

[0056] In this embodiment, search information refers to the content entered by the user in the search engine on the terminal device, which is usually denoted as query, also known as query statement, query term, search statement, search term, query, etc. Candidate resources refer to resource content stored in the candidate resource library (also known as the search corpus), which is usually denoted as doc, also known as candidate document, candidate file, document, etc.

[0057] In this embodiment, the first word vector refers to the word vector corresponding to the search information, which is obtained by performing semantic correlation processing on the search information. The second word vector refers to the word vector corresponding to the candidate resource, which is obtained by performing semantic correlation processing on the candidate resource.

[0058] It should be noted that the number of first and second word vectors can each be one or more. Typically, each candidate resource corresponds to multiple second word vectors. Furthermore, the second word vectors for the same candidate resource are obtained based on the multi-domain attribute information of that same candidate resource. Multi-domain attribute information refers to attribute information from different sources or dimensions. For example, for a document, which has a document title and document content, the document title and document content are attribute information from different sources or dimensions. Understandably, in practical applications, multi-domain attribute information can be flexibly adjusted according to the specific application scenario.

[0059] In this embodiment of the application, if the server receives search information, it can generate a first word vector corresponding to the search information and obtain a second word vector corresponding to each candidate resource.

[0060] In one embodiment of this application, if search information is received in S201, the process of generating a first word vector corresponding to the search information and obtaining a second word vector corresponding to each candidate resource may include:

[0061] Receive a search request sent by a terminal device, the search request including search information;

[0062] Generate the first word vector corresponding to the search information, and obtain the second word vector corresponding to each candidate resource.

[0063] That is, in the optional embodiment, the terminal device can receive the search information entered by the user in the search engine on the terminal device, then use the search information to generate a search request, and send the search request to the server; accordingly, the server receives the search request, extracts the search information from the search request, and then generates the first word vector corresponding to the search information, and obtains the second word vector corresponding to each candidate resource.

[0064] By implementing this optional embodiment, the generation of the first word vector corresponding to the search information is triggered by the search request, and the acquisition of the second word vector corresponding to each candidate resource is obtained, which is applicable to many scenarios.

[0065] In one embodiment of this application, the process of obtaining the second word vector corresponding to each candidate resource in S201 may include:

[0066] Obtain the second word vector corresponding to each candidate resource from the candidate resource library;

[0067] Meanwhile, taking multi-domain attribute information including document title and document content as an example, before obtaining the second word vector corresponding to each candidate resource in S201, the process may also include:

[0068] Retrieve the document title and document content for each candidate resource;

[0069] Based on the document title and document content corresponding to each candidate resource, the second word vector corresponding to each candidate resource is obtained;

[0070] The second word vector corresponding to each candidate resource is stored in the candidate resource library.

[0071] That is, in the optional embodiment, the candidate resource library stores the second word vectors corresponding to multiple candidate resources respectively. When the server receives the search information, it can directly obtain the second word vector corresponding to each candidate resource from the candidate resource library.

[0072] In one optional embodiment, the process of obtaining the second word vectors corresponding to the multiple candidate resources stored in the candidate resource library is as follows: obtain the document title and document content corresponding to each candidate resource, then use the document title and document content corresponding to each candidate resource to obtain the second word vector corresponding to each candidate resource, and store the second word vector corresponding to each candidate resource in the candidate resource library.

[0073] For example, taking candidate documents doc1 and doc2 as examples, we obtain the document title doc1_title and document content doc1_content of candidate document doc1, and use the document title doc1_title and document content doc1_content to obtain the second word vector corresponding to candidate document doc1 (there are multiple second word vector groups, denoted as the second word vector group doc1_wvg={doc1_wv1……doc1_wv(u-1),doc1_wvu}), where u is a positive integer greater than 1.

[0074] It is understandable that the process of deriving the second word vector corresponding to candidate document doc2 can be deduced in the same way, and will not be elaborated here; at the same time, the number of second word vectors corresponding to candidate document doc1 and the number of second word vectors corresponding to candidate document doc2 can be the same or different.

[0075] Next, the second word vectors corresponding to candidate document doc1 and candidate document doc2 are stored in the candidate resource library. Optionally, please refer to Table 1 below for an example of a candidate resource library.

[0076] Candidate documents Second word vector doc1 doc1_wv1......doc1_wv(u-1), doc1_wvu doc2 doc2_wv1......doc2_wv(u-1), doc2_wvu …… ……

[0077] Table 1

[0078] By implementing this optional embodiment, the second word vectors corresponding to multiple candidate resources stored in the candidate resource library can be accurately obtained by using the document title and document content corresponding to each candidate resource. When search retrieval is required, the vectors can be directly obtained from the candidate resource library, thus improving the efficiency of search retrieval.

[0079] In one embodiment of this application, the process of obtaining the second word vector corresponding to each candidate resource based on the document title and document content corresponding to each candidate resource may include:

[0080] The document title corresponding to each candidate resource is segmented to obtain the first candidate word corresponding to the document title, and the document content corresponding to each candidate resource is segmented to obtain the second candidate word corresponding to the document content.

[0081] Generate a first candidate word vector based on the context of the first candidate word, and generate a second candidate word vector based on the context of the second candidate word;

[0082] The first and second candidate word vectors corresponding to the same candidate resource are combined to obtain the second word vector corresponding to the same candidate resource.

[0083] That is, in an optional embodiment, the server performs word segmentation on the document title corresponding to each candidate resource to obtain the first candidate word corresponding to the document title, and performs word segmentation on the document content corresponding to each candidate resource to obtain the second candidate word corresponding to the document content. Then, it generates the first candidate word vector of the first candidate word using the context of the first candidate word, and generates the second candidate word vector of the second candidate word using the context of the second candidate word. Then, it combines the first candidate word vector and the second candidate word vector corresponding to the same candidate resource to obtain the second word vector corresponding to the same candidate resource.

[0084] In this optional embodiment, the first candidate word refers to the candidate word corresponding to the document title, and correspondingly, the first candidate word vector refers to the vector representation of the first candidate word. The second candidate word refers to the candidate word corresponding to the document content, and correspondingly, the second candidate word vector refers to the vector representation of the second candidate word.

[0085] For example, continuing from the previous example, for the candidate document doc1, the document title doc1_title is segmented to obtain the first candidate word corresponding to the document title doc1_title (there are multiple first candidate words, denoted as the first candidate word group doc1_title_wg={doc1_title_w1……doc1_title_w(o-1), doc1_title_wo}), and the document content doc1_content is segmented to obtain the second candidate word corresponding to the document content doc1_content (there are multiple second candidate words, denoted as the second candidate word group doc1_content_wg={doc1_content_w1……doc1_content_w(o-1), doc1_content_wo}), where o is a positive integer greater than 1.

[0086] Then, the first candidate word vector group doc1_title_wvg corresponding to the first candidate word group doc1_title_wg is generated, and the second candidate word vector group doc1_content_wvg corresponding to the second candidate word group doc1_content_wg is generated.

[0087] Then, by combining the first candidate word vector group doc1_title_wvg and the second candidate word vector group doc1_content_wvg, the second word vector corresponding to the candidate document doc1 (i.e., the second word vector group doc1_wvg in the previous example) can be obtained.

[0088] It is understandable that the process of deriving the second word vector corresponding to candidate document doc2 can be deduced in the same way, and will not be elaborated here; at the same time, the number of second word vectors corresponding to candidate document doc1 and the number of second word vectors corresponding to candidate document doc2 can be the same or different.

[0089] By implementing this optional embodiment, word segmentation and vectorization processing can be used to easily and accurately obtain the second word vector corresponding to each candidate resource, providing strong support for the construction of the candidate resource library.

[0090] In one embodiment of this application, the process of segmenting the document content corresponding to each candidate resource to obtain the second candidate word corresponding to the document content may include:

[0091] Extract key information from the document content corresponding to each candidate resource;

[0092] The key information corresponding to each candidate resource is segmented into words to obtain the second candidate word corresponding to the key information.

[0093] That is, in an optional embodiment, the server first extracts key information from the document content corresponding to each candidate, and then performs word segmentation on the key information corresponding to each candidate resource to obtain the second candidate word corresponding to the key information.

[0094] By implementing this optional embodiment and using key information in the document content for word segmentation, the computational load of word segmentation can be reduced to some extent, thereby improving the efficiency of determining the second word vector corresponding to the candidate resource.

[0095] In one embodiment of this application, the process of generating the first word vector corresponding to the search information in S201 may include:

[0096] The search information is segmented into words to obtain the third candidate word corresponding to the search information;

[0097] Generate a third candidate word vector based on the context of the third candidate word;

[0098] The third candidate word vector is used as the first word vector corresponding to the search information.

[0099] That is, in the optional embodiment, the server first performs word segmentation on the search information to obtain the third candidate word corresponding to the search information, and then uses the context of the third candidate word to generate the third candidate word vector of the third candidate word. At this time, the third candidate word vector is the first word vector corresponding to the search information.

[0100] In the optional embodiment, the third candidate word refers to the candidate word corresponding to the search information, and correspondingly, the third candidate word vector refers to the vector representation of the third candidate word.

[0101] For example, the search query is segmented to obtain the third candidate word (there are multiple third candidate words, denoted as the third candidate word group query_wg = {query_w1……query_w(a-1), query_wa}). Then, the third candidate word vector group query_wvg is generated (correspondingly, the first word vector group query_wvg = {query_wv1……query_wv(a-1), query_wva}), where a is a positive integer greater than 1. At this time, the third candidate word vector group query_wvg is the first word vector corresponding to the search query.

[0102] By implementing this optional embodiment, the first word vector corresponding to the search information can be obtained easily and accurately, providing strong support for subsequent relevance calculation.

[0103] It is understood that word segmentation in the aforementioned embodiments refers to a fundamental task in Natural Language Processing (NLP), which aims to break down text into meaningful units, commonly referred to as words or tokens. These words or tokens are the basic units for further analysis and processing. Specifically, the text here can be document titles, document content, and search information.

[0104] Optionally, word segmentation includes text segmentation, tokenization, and handling complex vocabulary. Text segmentation refers to separating text by spaces, punctuation marks, or other delimiters, such as segmenting the sentence "I love natural language processing" into "I", "love", and "natural language processing". Tokenization involves converting text into a set of words or tokens; this process may differ in different languages. For example, in English, words are usually separated, but in Chinese, word segmentation involves not only spaces but also word recognition. Handling complex vocabulary refers to situations where some words may be combinations of multiple words, which need to be recognized as a whole.

[0105] S202, based on the first word vector and the second word vector corresponding to each candidate resource, calculate the correlation between the search information and each candidate resource.

[0106] In this embodiment, the server obtains the first word vector corresponding to the search information and the second word vector corresponding to each candidate resource. Then, it can use the first word vector corresponding to the search information and the second word vector corresponding to each candidate resource to perform calculations to obtain the correlation between the search information and each candidate resource.

[0107] In one embodiment of this application, taking the example of having multiple first word vectors and multiple second word vectors corresponding to each candidate resource, the process in S202 of calculating the relevance between the search information and each candidate resource based on the first word vectors and the second word vectors corresponding to each candidate resource may include:

[0108] For each first word vector, calculate the similarity between the first word vector and each second word vector in the same candidate resource, and use the maximum similarity as the similarity reference information corresponding to the first word vector;

[0109] Based on the similarity reference information corresponding to multiple first word vectors, the correlation between search information and the same candidate resource is obtained.

[0110] That is, in an optional embodiment, the server calculates the similarity between each first word vector and each second word vector in the same candidate resource, and uses the maximum similarity as the similarity reference information corresponding to each first word vector. Then, using the similarity reference information corresponding to multiple first word vectors, the relevance between the search information and the same candidate resource is obtained.

[0111] For example, continuing from the previous example, the first word vector group query_wvg = {query_wv1……query_wv(a-1), query_wvva}), let a = 2, then the first word vector group query_wvg = {query_wv1, query_wv2}; the second word vector group doc1_wvg = {doc1_wv1……doc1_wv(u-1), doc1_wvu}), let u = 2, then the second word vector group doc1_wvg = {doc1_wv1, doc1_wv2}.

[0112] Specifically, for the first word vector query_wv1, the similarity f_wv11 between the first word vector query_wv1 and the second word vector doc1_wv1 corresponding to the candidate document doc1 is calculated, and the similarity f_wv12 between the first word vector query_wv1 and the second word vector doc1_wv2 corresponding to the candidate document doc1 is calculated. If the similarity f_wv11 is greater than the similarity f_wv12, then the similarity f_wv11 is the similarity reference information corresponding to the first word vector query_wv1.

[0113] Specifically, for the first word vector query_wv2, the similarity f_wv21 between the first word vector query_wv2 and the second word vector doc1_wv1 corresponding to the candidate document doc1 is calculated, and the similarity f_wv22 between the first word vector query_wv2 and the second word vector doc1_wv2 corresponding to the candidate document doc1 is also calculated. If the similarity f_wv22 is greater than the similarity f_wv21, then the similarity f_wv22 is the similarity reference information corresponding to the first word vector query_wv2.

[0114] Then, using the similarity reference information f_wv11 corresponding to the first word vector query_wv1 and the similarity reference information f_wv22 corresponding to the first word vector query_wv2, the correlation between the search information query and the candidate document doc1 is obtained.

[0115] It is understandable that the process of determining the relevance between the search query and the candidate document doc2 can be deduced similarly, and will not be elaborated here; that is, the final result is the relevance between the search query and the candidate document doc1, and the relevance between the search query and the candidate document doc2.

[0116] By implementing this optional embodiment, the relevance between search information and each candidate resource is obtained by calculating the similarity between word vectors. The relevance calculation is highly granular, which improves the accuracy of the relevance calculation and thus improves the accuracy of search recall.

[0117] In one embodiment of this application, the process of obtaining the relevance between search information and the same candidate resource based on similarity reference information corresponding to multiple first word vectors may include:

[0118] The average similarity is obtained by averaging the similarity reference information corresponding to multiple first word vectors.

[0119] Average similarity is used as the correlation between search information and the same candidate resource.

[0120] That is, in an optional embodiment, the server performs an average calculation on the similarity reference information corresponding to multiple first word vectors to obtain the average similarity. At this time, the average similarity is the relevance between the search information and the same candidate resource.

[0121] For example, continuing from the previous example, the average similarity reference information f_wv11 corresponding to the first word vector query_wv1 and the similarity reference information f_wv22 corresponding to the first word vector query_wv2 is calculated to obtain the average similarity (f_wv11+f_wv22) / 2. At this time, the average similarity (f_wv11+f_wv22) / 2 is the relevance between the search information query and the candidate document doc1.

[0122] It is understandable that the process of determining the relevance between the search query and the candidate document doc2 can be deduced similarly, so it will not be elaborated here.

[0123] By implementing this optional embodiment, the correlation between search information and each candidate resource can be easily obtained by using averaging, which improves the efficiency of correlation calculation and thus improves the efficiency of search recall.

[0124] In other embodiments, other operations can be performed, such as adding specified parameters, to obtain the correlation between search information and the same candidate resource. In practical applications, the operations can be flexibly adjusted according to specific application scenarios.

[0125] S203, Select target candidate resources from multiple candidate resources based on relevance to obtain search recall results corresponding to search information.

[0126] In this embodiment, the server obtains the correlation between the search information and each candidate resource, and then uses the correlation to select the target candidate resource from multiple candidate resources to obtain the search recall result corresponding to the search information. The number of target candidate resources can be one or more.

[0127] In one embodiment of this application, the process of selecting a target candidate resource from multiple candidate resources based on relevance in step S203 to obtain the search recall result corresponding to the search information may include:

[0128] Select target candidate resources whose relevance is greater than a preset relevance threshold from multiple candidate resources;

[0129] The target candidate resources are used as the search recall results corresponding to the search information.

[0130] That is, in an optional embodiment, the server selects target candidate resources with a relevance greater than a preset relevance threshold from multiple candidate resources. At this time, the target candidate resources are the search recall results corresponding to the search information.

[0131] By implementing this optional embodiment, the target candidate resources can be obtained easily and accurately, thereby obtaining the search recall results corresponding to the search information.

[0132] In one embodiment of this application, after the process in S203 of selecting a target candidate resource from multiple candidate resources based on relevance to obtain the search recall result corresponding to the search information, the method may further include:

[0133] Send the target candidate resource to the terminal device so that the terminal device can display the target candidate resource.

[0134] That is, in the optional embodiment, the server obtains the target candidate resource and sends the target candidate resource to the terminal device; accordingly, the terminal device receives the target candidate resource and displays the target candidate resource.

[0135] By implementing this optional embodiment, the terminal device can display target candidate resources for easy viewing by the user, making it suitable for many scenarios.

[0136] In this embodiment, word vectors of search information and word vectors of candidate resources are used to calculate the relevance between search information and candidate resources. The relevance calculation is highly granular, which improves the accuracy of the relevance calculation and thus improves the accuracy of search recall. Furthermore, the word vectors of candidate resources are obtained based on the multi-domain attribute information of candidate resources, which covers a more comprehensive range of attribute information, making up for the problem of incomplete attribute information acquisition, further improving the accuracy of relevance calculation, and thus further improving the accuracy of search recall.

[0137] In one embodiment of this application, another search recall method is provided. For example... Figure 3 As shown, the search and recall method may also include S301 to S303 before S201.

[0138] In this embodiment, the server inputs the search information into the recall model, and then generates the first word vector corresponding to the search information and obtains the second word vector corresponding to each candidate resource through the recall model. Then, the first word vector and the second word vector corresponding to each candidate resource are used to calculate the correlation between the search information and each candidate resource. Then, the target candidate resource is selected from multiple candidate resources using the correlation, thereby obtaining the search recall result corresponding to the search information.

[0139] In one embodiment of this application, the recall model includes a contrastive learning module and a similarity calculation module; specifically:

[0140] The contrastive learning module is used to generate the first word vector corresponding to the search information and to obtain the second word vector corresponding to each candidate resource; the contrastive learning module is trained based on the first sample word vector and the second sample word vector.

[0141] The similarity calculation module is used to calculate the correlation between the search information and each candidate resource based on the first word vector and the second word vector corresponding to each candidate resource, and to select the target candidate resource from multiple candidate resources based on the correlation to obtain the search recall result corresponding to the search information; wherein, the similarity calculation module is trained based on the sample correlation.

[0142] That is, in an optional embodiment, the server inputs the search information into the contrastive learning module in the recall model, and then generates a first word vector corresponding to the search information and obtains a second word vector corresponding to each candidate resource through the contrastive learning module; then, the first word vector corresponding to the search information and the second word vector corresponding to each candidate resource are input into the similarity calculation module in the recall model, and then the similarity calculation module uses the first word vector and the second word vector corresponding to each candidate resource to calculate the correlation between the search information and each candidate resource, and uses the correlation to select the target candidate resource from multiple candidate resources, thereby obtaining the search recall result corresponding to the search information.

[0143] The training process of the recall model is shown in S301 to S303.

[0144] Detailed introductions of S301 to S303 are as follows:

[0145] S301, obtain search sample information and candidate sample resources.

[0146] It should be clarified that some terms in the embodiments of this application contain the word "sample," which has a similar meaning to some terms in the aforementioned embodiments. Specifically, the term "xx1 sample xx2" in the embodiments of this application has a similar meaning to the term "xx1 xx2" in the aforementioned embodiments. For example, "search sample information" and "search information" have similar meanings, "candidate sample resources" and "candidate resources" have similar meanings, "first sample word vector" and "first word vector" have similar meanings, "second sample word vector" and "second word vector" have similar meanings, "multi-domain sample attribute information" and "multi-domain attribute information" have similar meanings, and so on. The term "sample xx1" in the embodiments of this application has a similar meaning to the term "xx1" in the aforementioned embodiments. For example, "sample correlation" and "correlation" have similar meanings, and so on. Similarly, other similar expressions are similar and will not be elaborated here. Among them, "xx1 sample xx2" and "sample xx1" are used to represent the model training stage, while "xx1 xx2" and "xx1" are used to represent the model application / deduction stage, thereby distinguishing different stages.

[0147] S302, input the search sample information and candidate sample resources into the model to be trained, generate the first sample word vector corresponding to the search sample information through the model to be trained, and generate the second sample word vector corresponding to the candidate sample resources based on the multi-domain sample attribute information of the candidate sample resources, and calculate the sample correlation between the search sample information and the candidate sample resources based on the first sample word vector and the second sample word vector.

[0148] In this embodiment, the server obtains search sample information and candidate sample resources. Then, it can input the search sample information and candidate sample resources into the model to be trained, and then generate the first sample word vector corresponding to the search sample information through the model to be trained, and generate the second sample word vector corresponding to the candidate sample resources based on the multi-domain sample attribute information of the candidate sample resources. Based on the first sample word vector and the second sample word vector, the sample correlation between the search sample information and the candidate sample resources is calculated.

[0149] As described in the foregoing embodiments, the recall model includes a contrastive learning module, and correspondingly, the candidate sample resources include positive sample resources and negative sample resources; therefore, in one embodiment of this application, the contrastive learning module can be trained in the following manner:

[0150] The first sample word vector corresponding to the search sample information is generated by the first functional module of the model to be trained, the positive sample word vector corresponding to the positive sample resource is generated based on the multi-domain sample attribute information of the positive sample resource, and the negative sample word vector corresponding to the negative sample resource is generated based on the multi-domain sample attribute information of the negative sample resource, and the positive sample word vector and the negative sample word vector are used as the second sample word vector.

[0151] Based on the first sample word vector and the second sample word vector, a contrastive learning loss function is constructed, and the first functional module is trained based on the contrastive learning loss function to obtain the contrastive learning module.

[0152] That is, in an optional embodiment, the server inputs the search sample information, positive sample resources, and negative sample resources into the first functional module of the model to be trained. Then, the first functional module generates the first sample word vector corresponding to the search sample information, generates the positive sample word vector corresponding to the positive sample resources using the multi-domain sample attribute information of the positive sample resources, and generates the negative sample word vector corresponding to the negative sample resources using the multi-domain sample attribute information of the negative sample resources. At this time, the positive sample word vector and the negative sample word vector are the second sample word vector. Then, the first sample word vector and the second sample word vector are used to construct a contrastive learning loss function, and the first functional module is trained based on the contrastive learning loss function to obtain the contrastive learning module.

[0153] By implementing this optional embodiment, the contrastive learning module in the recall model can be trained easily and accurately.

[0154] In one embodiment of this application, the multi-domain sample attribute information includes the document title and the document content; correspondingly, the process of generating positive sample word vectors corresponding to positive sample resources based on the multi-domain sample attribute information of positive sample resources, and generating negative sample word vectors corresponding to negative sample resources based on the multi-domain sample attribute information of negative sample resources, may include:

[0155] Obtain the document titles and content corresponding to the positive sample resources, and based on the document titles and content, obtain the positive sample word vectors corresponding to the positive sample resources; and

[0156] Obtain the document title and document content corresponding to the negative sample resource, and based on the document title and document content corresponding to the negative sample resource, obtain the negative sample word vector corresponding to the negative sample resource.

[0157] That is, in the optional embodiment, the first functional module will obtain the document title and document content corresponding to the positive sample resource, and use the document title and document content corresponding to the positive sample resource to obtain the positive sample word vector corresponding to the positive sample resource. At the same time, it will also obtain the document title and document content corresponding to the negative sample resource, and use the document title and document content corresponding to the negative sample resource to obtain the negative sample word vector corresponding to the negative sample resource.

[0158] By implementing this optional embodiment, the positive sample word vectors corresponding to the positive sample resources can be accurately obtained by using the document titles and document content corresponding to the positive sample resources, and the negative sample word vectors corresponding to the negative sample resources can be accurately obtained by using the document titles and document content corresponding to the negative sample resources, thereby improving the accuracy of the training of the first functional module.

[0159] In one embodiment of this application, the process of obtaining positive sample word vectors corresponding to positive sample resources based on the document titles and document content corresponding to the positive sample resources may include:

[0160] The document titles corresponding to the positive sample resources are segmented to obtain the first positive sample candidate words corresponding to the document titles, and the document content corresponding to the positive sample resources is segmented to obtain the second positive sample candidate words corresponding to the document content.

[0161] Generate a first positive sample candidate word vector based on the context of the first positive sample candidate word, and generate a second positive sample candidate word vector based on the context of the second positive sample candidate word;

[0162] The positive sample candidate word vectors are combined with the first positive sample candidate word vectors to obtain the positive sample word vectors corresponding to the positive sample resources.

[0163] That is, in the optional embodiment, the first functional module performs word segmentation on the document title corresponding to the positive sample resource to obtain the first positive sample candidate word corresponding to the document title, and performs word segmentation on the document content corresponding to the positive sample resource to obtain the second positive sample candidate word corresponding to the document content. Then, it generates the first positive sample candidate word vector of the first positive sample candidate word using the context of the first positive sample candidate word, and generates the second positive sample candidate word vector of the second positive sample candidate word using the context of the second positive sample candidate word. Then, it combines the first positive sample candidate word vector and the second positive sample candidate word vector to obtain the positive sample word vector corresponding to the positive sample resource.

[0164] By implementing this optional embodiment, word segmentation and vectorization processing can be used to easily and accurately obtain the positive sample word vectors corresponding to the positive sample resources, thereby improving the efficiency and accuracy of training the first functional module.

[0165] In one embodiment of this application, the process of segmenting the document content corresponding to the positive sample resource to obtain the second positive sample candidate word corresponding to the document content may include:

[0166] Extract key information from the document content corresponding to positive sample resources;

[0167] The key information corresponding to the positive sample resources is segmented into words to obtain the second positive sample candidate words corresponding to the key information.

[0168] That is, in the optional embodiment, the first functional module can first extract key information from the document content corresponding to the positive sample resource, and then perform word segmentation on the key information corresponding to the positive sample resource to obtain the second positive sample candidate word corresponding to the key information.

[0169] By implementing this optional embodiment and using key information in the document content for word segmentation, the computational load of word segmentation can be reduced to some extent, improving the efficiency of determining the positive sample word vectors corresponding to the positive sample resources, thereby improving the training efficiency of the first functional module.

[0170] In one embodiment of this application, the process of obtaining negative sample word vectors corresponding to negative sample resources based on the document titles and document content corresponding to the negative sample resources may include:

[0171] The document titles corresponding to the negative sample resources are segmented to obtain the first negative sample candidate words corresponding to the document titles, and the document content corresponding to the negative sample resources is segmented to obtain the second negative sample candidate words corresponding to the document content.

[0172] Generate a first negative sample candidate word vector based on the context of the first negative sample candidate word, and generate a second negative sample candidate word vector based on the context of the second negative sample candidate word;

[0173] The negative sample word vectors corresponding to the negative sample resources are obtained by combining the first negative sample candidate word vectors and the second negative sample candidate word vectors.

[0174] That is, in the optional embodiment, the first functional module performs word segmentation on the document title corresponding to the negative sample resource to obtain the first negative sample candidate word corresponding to the document title, and performs word segmentation on the document content corresponding to the negative sample resource to obtain the second negative sample candidate word corresponding to the document content. Then, it generates the first negative sample candidate word vector of the first negative sample candidate word using the context of the first negative sample candidate word, and generates the second negative sample candidate word vector of the second negative sample candidate word using the context of the second negative sample candidate word. Finally, it combines the first negative sample candidate word vector and the second negative sample candidate word vector to obtain the negative sample word vector corresponding to the negative sample resource.

[0175] By implementing this optional embodiment, word segmentation and vectorization processing can be used to easily and accurately obtain the negative sample word vectors corresponding to the negative sample resources, thereby improving the efficiency and accuracy of training the first functional module.

[0176] In one embodiment of this application, the process of segmenting the document content corresponding to the negative sample resource to obtain the second negative sample candidate word corresponding to the document content may include:

[0177] Extract key information from the document content corresponding to negative sample resources;

[0178] The key information corresponding to the negative sample resources is segmented into words to obtain the second negative sample candidate words corresponding to the key information.

[0179] That is, in the optional embodiment, the first functional module can first extract key information from the document content corresponding to the negative sample resource, and then perform word segmentation on the key information corresponding to the negative sample resource to obtain the second negative sample candidate word corresponding to the key information.

[0180] By implementing this optional embodiment and using key information in the document content for word segmentation, the computational load of word segmentation can be reduced to some extent, and the efficiency of determining the negative sample word vectors corresponding to the negative sample resources can be improved, thereby improving the training efficiency of the first functional module.

[0181] In one embodiment of this application, the first functional module includes a first encoder and a second encoder that are independent of each other, i.e., the first functional module has a dual-encoder structure; correspondingly, the first functional module of the model to be trained generates first sample word vectors corresponding to search sample information, generates positive sample word vectors corresponding to positive sample resources based on multi-domain sample attribute information of positive sample resources, and generates negative sample word vectors corresponding to negative sample resources based on multi-domain sample attribute information of negative sample resources, including:

[0182] The first encoder generates the first sample word vector corresponding to the search sample information;

[0183] The second encoder generates positive sample word vectors corresponding to positive sample resources based on multi-domain sample attribute information of positive sample resources, and generates negative sample word vectors corresponding to negative sample resources based on multi-domain sample attribute information of negative sample resources.

[0184] That is, in the optional embodiment, the first functional module inputs the search sample information into the first encoder, and then generates the first sample word vector corresponding to the search sample information through the first encoder. At the same time, the positive sample resources are input into the second encoder, and then the positive sample word vector corresponding to the positive sample resources is generated by the second encoder using the multi-domain sample attribute information of the positive sample resources. At the same time, the negative sample resources are input into the second encoder, and then the negative sample word vector corresponding to the negative sample resources is generated by the second encoder using the multi-domain sample attribute information of the negative sample resources.

[0185] By implementing this optional embodiment, the first sample word vector corresponding to the search sample information, the positive sample word vector corresponding to the positive sample resource, and the negative sample word vector corresponding to the negative sample resource can be easily obtained by using mutually independent dual encoders, thereby improving the training efficiency of the first functional module.

[0186] In one embodiment of this application, the process of constructing a contrastive learning loss function based on the first sample word vectors and the second sample word vectors may include:

[0187] A first learning loss function is constructed based on the first sample word vector and the positive sample word vector, and a second learning loss function is constructed based on the first sample word vector and the negative sample word vector. The first learning loss function and the second learning loss function are used as a contrastive learning loss function.

[0188] That is, in the optional embodiment, the first functional module constructs a first learning loss function using the first sample word vector and the positive sample word vector, and constructs a second learning loss function using the first sample word vector and the negative sample word vector. At this time, the first learning loss function and the second learning loss function are the contrastive learning loss function.

[0189] By implementing this optional embodiment, the contrastive learning loss function can be constructed easily and accurately, providing strong support for the training of the first functional module.

[0190] As described in the foregoing embodiments, the recall model includes a similarity calculation module; therefore, in one embodiment of this application, the similarity calculation module can be trained in the following manner:

[0191] The second functional module of the model to be trained calculates the sample correlation between the search sample information and the candidate sample resources based on the word vectors of the first and second samples.

[0192] A similarity calculation loss function is constructed based on sample relevance, and a second functional module is trained based on the similarity calculation loss function to obtain the similarity calculation module.

[0193] That is, in an optional embodiment, the server inputs the first sample word vector and the second sample word vector into the second functional module of the model to be trained, and then uses the first sample word vector and the second sample word vector to calculate the sample correlation between the search sample information and the candidate sample resources. Then, the similarity calculation loss function is constructed using the sample correlation, and the second functional module is trained based on the similarity calculation loss function to obtain the similarity calculation module.

[0194] By implementing this optional embodiment, the similarity calculation module in the recall model can be trained easily and accurately.

[0195] In one embodiment of this application, there are multiple first sample word vectors and multiple second sample word vectors; correspondingly, the process of obtaining the sample correlation between the search sample information and the candidate sample resources by calculating based on the first and second sample word vectors by the second functional module of the model to be trained may include:

[0196] Through the second functional module of the model to be trained, for each first sample word vector, the similarity between the first sample word vector and each second sample word vector in the candidate sample resources is calculated, and the maximum similarity is used as the similarity sample reference information corresponding to the first sample word vector;

[0197] Based on the similarity sample reference information corresponding to multiple first sample word vectors, the correlation between search sample information and candidate sample resources is obtained.

[0198] That is, in the optional embodiment, the second functional module calculates the similarity between each first sample word vector and each second sample word vector in the candidate sample resources, and uses the maximum similarity as the similarity sample reference information corresponding to each first sample word vector. Then, using the similarity sample reference information corresponding to multiple first sample word vectors respectively, the correlation between the search sample information and the candidate sample resources is obtained.

[0199] In one optional embodiment, when the candidate sample resources include positive sample resources and negative sample resources, the second functional module calculates the similarity between each first sample word vector and each second sample word vector in the positive sample resources, and uses the maximum similarity as the positive similarity reference information corresponding to each first sample word vector. Then, using the positive similarity reference information corresponding to multiple first sample word vectors respectively, the correlation between the search sample information and the positive sample resources is obtained. Simultaneously, the second functional module calculates the similarity between each first sample word vector and each second sample word vector in the negative sample resources, and uses the maximum similarity as the negative similarity reference information corresponding to each first sample word vector. Then, using the negative similarity reference information corresponding to multiple first sample word vectors respectively, the correlation between the search sample information and the negative sample resources is obtained.

[0200] By implementing this optional embodiment, the correlation between search sample information and candidate sample resources is obtained by calculating the similarity between word vectors. The correlation calculation is highly granular, which improves the accuracy of the correlation calculation and thus improves the accuracy of the training of the second functional module.

[0201] In one embodiment of this application, the process of obtaining the correlation between search sample information and candidate sample resources based on similarity sample reference information corresponding to multiple first sample word vectors may include:

[0202] The average similarity is obtained by averaging the similarity sample reference information corresponding to the word vectors of multiple first samples.

[0203] The average similarity is used as the correlation between the search sample information and the candidate sample resources.

[0204] In other words, in an optional embodiment, the server performs an average calculation on the similarity sample reference information corresponding to multiple first sample word vectors to obtain the average similarity. At this time, the average similarity is the correlation between the search sample information and the candidate sample resources.

[0205] By implementing this optional embodiment, the correlation between the search sample information and each candidate resource can be easily obtained by using the averaging operation, which improves the efficiency of correlation calculation and thus improves the efficiency of training the second functional module.

[0206] In other embodiments, other operations can be performed, such as adding specified parameters, to obtain the correlation between search sample information and candidate sample resources. In practical applications, the operations can be flexibly adjusted according to specific application scenarios.

[0207] S303: Based on the word vectors of the first sample, the word vectors of the second sample, and the sample relevance, a loss is constructed, and the model to be trained is trained based on the loss to obtain the recall model.

[0208] In this embodiment, the server obtains the first sample word vector, the second sample word vector, and the sample relevance. Then, it can use the first sample word vector, the second sample word vector, and the sample relevance to construct a loss, and use the loss to train the model to be trained, thereby obtaining the recall model.

[0209] As described in the foregoing embodiments, the model to be trained includes a first functional module and a second functional module. Specifically, a contrastive learning loss function is constructed using the first sample word vectors and the second sample word vectors, and the first functional module is trained using the contrastive learning loss function to obtain a contrastive learning module. A similarity calculation loss function is constructed using sample relevance, and the second functional module is trained using the similarity calculation loss function to obtain a similarity calculation module. Thus, a recall model is trained.

[0210] It should be noted that, Figure 3 For detailed information on S201 to S203 shown, please refer to [link / reference]. Figure 2 S201 to S203 shown will not be described again here.

[0211] In this embodiment, word vectors of search information and word vectors of candidate resources are used to calculate the relevance between search information and candidate resources in order to train the recall model and improve the accuracy of relevance calculation of the recall model. Furthermore, the word vectors of candidate resources are obtained based on the multi-domain attribute information of candidate resources, which covers a more comprehensive range of attribute information, making up for the problem of incomplete attribute information acquisition and further improving the accuracy of relevance calculation of the recall model.

[0212] The following provides a detailed description of specific scenarios in the embodiments of this application:

[0213] Please see Figure 4 , Figure 4 This is a schematic diagram illustrating a recall model as shown in one embodiment of this application. Figure 4 As shown, the recall model includes a knowledge distillation module (also known as a knowledge distillation (KD) module), a contrastive learning module, and a similarity calculation module (also known as a fine-grained learning module), wherein:

[0214] A distillation learning module refers to a module that employs distillation learning techniques. This module can include a teacher model and a student model. The teacher model can be pre-trained (specifically, trained using query terms and documents) and has good prediction accuracy, while the student model is the model to be trained and has lower prediction accuracy. The main purpose of distillation learning is to allow the student model's predictions to fit the teacher model's predictions, thereby achieving the goal of training the student model using the teacher model. Typically, the teacher model is more complex and can be considered a large-scale model, while the student model is simpler and can be considered a lightweight model. Using the teacher model to train the student model based on distillation learning techniques can complete the training of the student model more quickly and improve its prediction accuracy. It's understood that the student model here is used for relevance calculation, such as in a fine-grained learning module.

[0215] For example, the loss function for distillation learning can be constructed as follows:

[0216]

[0217] Where q represents the query term, p represents a paragraph in the document, and Rel q,p The relevance score between the query term q generated by the teacher model and paragraph p in the document. <BERT Q (q), BERT P (p)> represents the relevance score between the query term q generated by the student model and the paragraph p in the document. The two relevance scores take values ​​of [0, 1]. Q is the sum of the query terms, and P is the sum of the paragraphs in the document.

[0218] The contrastive learning module refers to a module that employs unsupervised learning techniques. This module can include two encoders: a query encoder and a document encoder. The query encoder encodes the query term to obtain word vectors related to the query term, and then processes these vectors through a binary layer to obtain a standardized representation. The document encoder encodes the multi-domain attribute information of multiple documents (docs) to obtain word vectors related to the documents, and then processes these vectors through a binary layer to obtain a standardized representation. Finally, a dot product operation is performed based on the obtained standardized representations to achieve contrastive learning. Unsupervised learning techniques primarily learn useful representations or features by comparing the similarities and differences between samples. The goal of contrastive learning is to bring samples from the same category closer together and push samples from different categories further apart, so as to better distinguish them in the learned representation space.

[0219] In one embodiment of this application, the two encoders can be cross-encoders, dual-encoders, and late-interaction encoders; wherein:

[0220] like Figure 5A The diagram illustrates a cross-encoder. Cross-encoders are typically used as rerankers, primarily concatenating query terms and paragraphs from documents to achieve comprehensive interaction and effectively capture the relevance features between the query term and the documents. Because the relevance features between query terms and paragraphs are crucial for relevance modeling, cross-encoders offer better ranking performance. However, their application is limited to small sets due to higher inference latency.

[0221] like Figure 5B The diagram illustrates a dual encoder. Dual encoders are typically used as retrievers, primarily encoding both the query term and paragraphs in the documents (docs) separately to ensure efficient retrieval. The relevant word vectors for the paragraphs in the documents can be pre-computed and cached. Because there is no interaction between the query term and the paragraphs in the documents during the encoding process, dual encoders have lower inference latency and more efficient inference.

[0222] like Figure 5CThe diagram shows a post-interactive encoder. The post-interactive encoder primarily encodes the textual semantics of the query term and paragraphs in the documents (docs) separately, and performs lightweight concatenation between the query term and the paragraphs in the documents (docs) to achieve relatively comprehensive interaction. In other words, the post-interactive encoder is a fusion of a cross-encoder and a dual-encoder; however, as the model size increases, it requires a larger storage space and also has a certain inference latency.

[0223] Optionally, dual encoders are used in the embodiments of this application to meet the needs of more efficient inference scenarios.

[0224] In one embodiment of this application, the multi-domain attribute information of the document docs targeted by the document encoder includes the document title and document content.

[0225] like Figure 6 The image shows a schematic diagram of a document (doc). This document (doc) includes a document title (title="A Single Spark Can Start a Prairie Fire: Joint Construction of Moral Exemplar Studios in Dongshan District") and document content (content="Source: xxxx; Author: xxxx; Publication Time: xxxx; Main Content: xxxx;"). Accordingly, the document encoder encodes the aforementioned document title (title) and document content (content) to obtain the relevant word vectors for the document (doc).

[0226] For easier understanding, please refer to Figure 7 This is a schematic diagram illustrating the encoding of multi-domain attribute information. For example... Figure 7 As shown, the deep learning model uses a shared BERT encoder to process different attribute information (such as document title and document content), i.e., E = BERT([CLS][Title]title[Content]content[SEP]), and to process the query term, i.e., E = BERT([CLS]query[SEP]), where CLS represents the start symbol and SEP represents the end symbol. Then, an attribute fusion layer is used to fuse the various attribute information with the query term to generate a global loss, i.e., v = E([CLS] + w(1) × E([Title]) + w(2) × E([Content]), where w = Softmax(W G (E |CLs| )0, It is a learnable parameter matrix. Furthermore, attribute-aware learning can be used to compute local loss for each attribute, thereby enhancing the deep learning model's ability to recognize each attribute.

[0227] It should be clarified that in other embodiments, the multi-domain attribute information may also include other information, such as keywords extracted when processing web page content offline. In practical applications, the multi-domain attribute information can be flexibly adjusted according to specific application scenarios.

[0228] In one embodiment of this application, the training sample documents (i.e., positive sample documents and negative sample documents) used by the contrastive learning module can be constructed in the following manner, wherein:

[0229] For building positive sample documents:

[0230] i. Search log data: Analyze the log data to obtain the recorded query terms and documents, including click information for each document (i.e., whether the user clicked the document). For each query term, documents that are displayed and clicked can be considered positive sample documents, while documents that are displayed but not clicked can be considered negative sample documents. Whether a document is clicked can roughly indicate the user's satisfaction with their intent.

[0231] ii. Manually annotate data, which can be done by manually annotating positive sample documents.

[0232] For constructing negative sample documents:

[0233] i. Random Negative Sample Mining: Negative samples within a batch are referred to as random negative samples, which are positive sample documents for other query terms within the same mini-batch. Because the data is randomly shuffled before being input into the model, random negative samples are typically very different from the query terms, thus helping to simulate online retrieval scenarios—identifying positive samples from a large number of random negative samples. Furthermore, to collect sufficient random negative samples from each mini-batch, the batch size can be increased, where the batch size is set to maximize the utilization of GPU memory.

[0234] For example, consider a training dataset with a batch size of 10, containing the following query terms and positive sample pairs, where the positive samples for each query are already labeled:

[0235] 1. Query 1: "Weather Forecast"

[0236] 2. Positive Sample 1: "The weather is sunny and there is a light breeze today."

[0237] 3. Query 2: "Healthy Eating"

[0238] 4. Positive Sample 2: "Eating more fruits and vegetables is good for your health."

[0239] 5. Query 3: "Movie Recommendations"

[0240] 6. Positive Sample 3: "I recommend you watch Inception."

[0241] During training, negative samples can be generated for each query from this batch, for example:

[0242] For query 1: "Weather forecast", we select positive samples from queries 2 and 3 in the batch as negative samples.

[0243] For query 2: "healthy eating", we select the positive samples of queries 1 and 3 as negative samples.

[0244] For query 3: "Movie Recommendation", we select the positive samples from queries 1 and 2 as negative samples.

[0245] ii. Hard Negative Sample Mining. For each query term, samples are taken from its neighborhood as hard negative samples, i.e., a: BERTUni(a)∈ANN(BERTUni(q)), where q represents the query term. In this embodiment, taking an advertising scenario as an example, sampling filtering can be performed using relevance scores: First, neighborhood ads (e.g., the top 200 nearest neighbors) are ranked according to their relevance scores; then, top-ranked ads (e.g., the top 1 to K ads) are removed; finally, sampling is performed on the remaining ads (e.g., from K+1 to 200). This allows selecting ads that are hard but have low relevance as negative samples, thus helping to improve representation quality. Furthermore, it has been verified that sampling no more than 4 ANN hard negative samples from the filtered neighborhood is sufficient to obtain optimal recall performance; further increasing the number of ANN hard negative samples leads to additional training costs without further improvement. It is understood that hard negative samples of a query term will also be shared with other query terms, but this may further increase the size of the negative samples.

[0246] For example, suppose there exists a set of pairs of examples Where x i and Semantically related, let h i For x i Vector representation, for The vector representation; therefore, for a batch of size N, The corresponding loss function for contrastive learning can be constructed as follows:

[0247]

[0248] Where τ is a hyperparameter, and sim(h1, h2) is the cosine similarity. h = f θ (x), T is the matrix transpose, and j takes the value [1, N].

[0249] The fine-grained learning module refers to the module that focuses on distinguishing categories with high similarity. It is mainly used to calculate the relevance between query terms and documents by using word vectors related to query terms and word vectors related to documents.

[0250] For example, let n1 represent multiple query terms on the term side, and n2 represent multiple paragraphs on the document side, where:

[0251] The word vector representation of the query terms extracted from the last hidden layer of the encoder is as follows:

[0252]

[0253] The word vector representation of a paragraph in the document extracted from the last hidden layer of the encoder is as follows:

[0254]

[0255] Where d is the dimension of the output vector.

[0256] Calculate the similarity and take the maximum value:

[0257]

[0258] The average value is used as the similarity between the query term and the document.

[0259]

[0260] in, k is the kth element in n1, and r is the rth element in n2.

[0261] For example, gradient descent can be used to simultaneously optimize distillation learning loss, contrastive learning loss, and fine-grained learning loss, and train for multiple rounds until convergence to obtain a recall model.

[0262] Then, inference is performed using a recall model.

[0263] like Figure 8 As shown, the query terms are input into the recall model. The recall model retrieves the corresponding web document indexes (demb1, demb2, ..., dembn) from the web document library (including doc1, doc2, ..., docn) based on the query index (qemb) of the query terms, thereby obtaining the recalled documents (including doc1, doc2, ..., dock).

[0264] In this embodiment, leveraging the flexibility and powerful semantic representation capabilities of the Query-Doc dual-tower recall model, contrastive learning and distillation learning are used to train the Query-Doc dual-tower recall model to vectorize documents and query terms. Furthermore, dynamic multi-domain fusion vectors are introduced on the document side to compensate for the Query-Doc dual-tower recall model's insufficient semantic acquisition of document text information (i.e., the text domain), thereby improving the recall capability of the Query-Doc dual-tower recall model. At the same time, fine-grained learning is introduced during the training process to enhance the Query-Doc dual-tower recall model's ability to capture key information, further improving its recall capability.

[0265] Figure 9 This is a block diagram illustrating a search and recall device according to one embodiment of this application. Figure 9 As shown, the device includes:

[0266] The generation and acquisition module 901 is configured to generate a first word vector corresponding to the search information and acquire a second word vector corresponding to each candidate resource if search information is received. The second word vector of the same candidate resource is obtained based on the multi-domain attribute information of the same candidate resource.

[0267] The calculation module 902 is configured to perform calculations based on the first word vector and the second word vector corresponding to each candidate resource to obtain the correlation between the search information and each candidate resource.

[0268] The selection module 903 is configured to select a target candidate resource from multiple candidate resources based on the relevance, so as to obtain the search recall result corresponding to the search information.

[0269] In one embodiment of this application, based on the foregoing scheme, there are multiple first word vectors, and multiple second word vectors corresponding to each candidate resource; the calculation module 902 is specifically configured as follows:

[0270] For each first word vector, calculate the similarity between the first word vector and each second word vector in the same candidate resource, and use the maximum similarity as the similarity reference information corresponding to the first word vector;

[0271] Based on the similarity reference information corresponding to multiple first word vectors, the correlation between the search information and the same candidate resource is obtained.

[0272] In one embodiment of this application, based on the foregoing scheme, the calculation module 902 is further configured as follows:

[0273] The average similarity is obtained by averaging the similarity reference information corresponding to multiple first word vectors.

[0274] The average similarity is used as the correlation between the search information and the same candidate resource.

[0275] In one embodiment of this application, based on the foregoing scheme, the generation and acquisition module 901 is specifically configured as follows:

[0276] Obtain the second word vector corresponding to each candidate resource from the candidate resource library;

[0277] Accordingly, the multi-domain attribute information includes the document title and document content, and the device further includes a storage module configured as follows:

[0278] Retrieve the document title and document content for each candidate resource;

[0279] Based on the document title and document content corresponding to each candidate resource, a second word vector corresponding to each candidate resource is obtained;

[0280] The second word vector corresponding to each candidate resource is stored in the candidate resource library.

[0281] In one embodiment of this application, based on the foregoing scheme, the storage module is specifically configured as follows:

[0282] The document title corresponding to each candidate resource is segmented to obtain the first candidate word corresponding to the document title, and the document content corresponding to each candidate resource is segmented to obtain the second candidate word corresponding to the document content.

[0283] A first candidate word vector is generated based on the context of the first candidate word, and a second candidate word vector is generated based on the context of the second candidate word;

[0284] The first candidate word vector and the second candidate word vector corresponding to the same candidate resource are combined to obtain the second word vector corresponding to the same candidate resource.

[0285] In one embodiment of this application, based on the foregoing solution, the storage module is further configured as follows:

[0286] Extract key information from the document content corresponding to each candidate resource;

[0287] The key information corresponding to each candidate resource is segmented into words to obtain the second candidate word corresponding to the key information.

[0288] In one embodiment of this application, based on the aforementioned scheme, a first word vector corresponding to the search information is generated through a recall model, and a second word vector corresponding to each candidate resource is obtained. The correlation between the search information and each candidate resource is calculated based on the first word vector and the second word vector corresponding to each candidate resource. A target candidate resource is selected from multiple candidate resources based on the correlation to obtain the search recall result corresponding to the search information. The device further includes a training module configured as follows:

[0289] Obtain search sample information and candidate sample resources;

[0290] The search sample information and the candidate sample resources are input into the model to be trained. The model to be trained generates a first sample word vector corresponding to the search sample information and a second sample word vector corresponding to the candidate sample resources based on the multi-domain sample attribute information of the candidate sample resources. The sample correlation between the search sample information and the candidate sample resources is calculated based on the first sample word vector and the second sample word vector.

[0291] The loss is constructed based on the first sample word vector, the second sample word vector, and the sample relevance, and the model to be trained is trained based on the loss to obtain the recall model.

[0292] In one embodiment of this application, based on the foregoing scheme, the recall model includes a contrastive learning module and a similarity calculation module;

[0293] The contrastive learning module is used to generate a first word vector corresponding to the search information and to obtain a second word vector corresponding to each candidate resource; wherein, the contrastive learning module is trained based on the first sample word vector and the second sample word vector;

[0294] The similarity calculation module is used to calculate the correlation between the search information and each candidate resource based on the first word vector and the second word vector corresponding to each candidate resource, and to select the target candidate resource from multiple candidate resources based on the correlation to obtain the search recall result corresponding to the search information; wherein, the similarity calculation module is trained based on the sample correlation.

[0295] In one embodiment of this application, based on the foregoing scheme, the candidate sample resources include positive sample resources and negative sample resources; the training module is specifically configured as follows:

[0296] The first sample word vector corresponding to the search sample information is generated by the first functional module of the model to be trained; the positive sample word vector corresponding to the positive sample resource is generated based on the multi-domain sample attribute information of the positive sample resource; and the negative sample word vector corresponding to the negative sample resource is generated based on the multi-domain sample attribute information of the negative sample resource. The positive sample word vector and the negative sample word vector are used as the second sample word vector.

[0297] Based on the first sample word vector and the second sample word vector, a contrastive learning loss function is constructed, and the first functional module is trained based on the contrastive learning loss function to obtain the contrastive learning module.

[0298] In one embodiment of this application, based on the foregoing scheme, the multi-domain sample attribute information includes document title and document content; the training module is further specifically configured as follows:

[0299] Obtain the document title and document content corresponding to the positive sample resource, and based on the document title and document content corresponding to the positive sample resource, obtain the positive sample word vector corresponding to the positive sample resource; and

[0300] Obtain the document title and document content corresponding to the negative sample resource, and based on the document title and document content corresponding to the negative sample resource, obtain the negative sample word vector corresponding to the negative sample resource.

[0301] In one embodiment of this application, based on the foregoing scheme, the first functional module includes a first encoder and a second encoder that are independent of each other; the training module is further specifically configured as follows:

[0302] The first encoder generates the first sample word vector corresponding to the search sample information;

[0303] The second encoder generates positive sample word vectors corresponding to the positive sample resources based on the multi-domain sample attribute information of the positive sample resources, and generates negative sample word vectors corresponding to the negative sample resources based on the multi-domain sample attribute information of the negative sample resources.

[0304] In one embodiment of this application, based on the foregoing scheme, the training module is specifically configured as follows:

[0305] The second functional module of the model to be trained calculates the sample correlation between the search sample information and the candidate sample resources based on the first sample word vector and the second sample word vector.

[0306] A similarity calculation loss function is constructed based on the sample correlation, and the second functional module is trained based on the similarity calculation loss function to obtain the similarity calculation module.

[0307] In one embodiment of this application, based on the foregoing scheme, the first sample word vector is multiple, and the second sample word vector is multiple; the training module is further specifically configured as follows:

[0308] Through the second functional module of the model to be trained, for each first sample word vector, the similarity between the first sample word vector and each second sample word vector in the candidate sample resources is calculated, and the maximum similarity is used as the similarity sample reference information corresponding to the first sample word vector;

[0309] Based on the similarity sample reference information corresponding to multiple first sample word vectors, the correlation between the search sample information and the candidate sample resources is obtained.

[0310] It should be noted that the apparatus provided in the foregoing embodiments and the method provided in the foregoing embodiments belong to the same concept, and the specific way in which each module and unit performs operations has been described in detail in the method embodiments.

[0311] Embodiments of this application also provide an electronic device, including: one or more processors; and a memory for storing one or more computer programs, which, when executed by one or more processors, cause the electronic device to implement the aforementioned search and recall method.

[0312] Figure 10 It is an electronic device suitable for implementing the embodiments of this application (e.g. Figure 1 The diagram shows the structure of a computer system (terminal device or server).

[0313] It should be noted that, Figure 10 The computer system 1000 of the electronic device shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments of this application.

[0314] like Figure 10As shown, the computer system 1000 includes a Central Processing Unit (CPU) 1001, which can perform various appropriate actions and processes, such as executing the methods described in the above embodiments, based on a computer program stored in a Read-Only Memory (ROM) 1002 or a computer program loaded from a storage portion 1008 into a Random Access Memory (RAM) 1003. The RAM 1003 also stores various computer programs and data required for system operation. The CPU 1001, ROM 1002, and RAM 1003 are interconnected via a bus 1004. An Input / Output (I / O) interface 1005 is also connected to the bus 1004.

[0315] The following components are connected to I / O interface 1005: an input section 1006 including a keyboard, mouse, etc.; an output section 1007 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and speakers, etc.; a storage section 1008 including a hard disk, etc.; and a communication section 1009 including a network interface card such as a LAN (Local Area Network) card, modem, etc. The communication section 1009 performs communication processing via a network such as the Internet. A drive 1010 is also connected to I / O interface 1005 as needed. Removable media 1011, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., are installed on drive 1010 as needed so that computer programs read from them can be installed into storage section 1008 as needed.

[0316] Specifically, according to embodiments of this application, the processes described above with reference to the flowcharts can be implemented as computer programs. For example, embodiments of this application include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing computer instructions for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication section 1009, and / or installed from removable medium 1011. When the computer program is executed by central processing unit (CPU) 1001, it performs various functions defined in the system of this application.

[0317] It should be noted that the computer-readable medium shown in the embodiments of this application can be a computer-readable signal medium, a computer-readable storage medium, or any combination thereof. For example, a computer-readable medium can be an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM), flash memory, optical fiber, portable compact disc read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this application, a computer-readable medium can be any tangible medium containing or storing a computer program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In this application, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying a computer-readable computer program. Such transmitted data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. The computer-readable signal medium can also be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a computer program for use by or in connection with an instruction execution system, apparatus, or device. The computer program contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to wireless, wired, etc., or any suitable combination thereof.

[0318] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this application. Each block in a flowchart or block diagram may represent a module, segment, or portion of code, which contains one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram or flowchart, and combinations of blocks in a block diagram or flowchart, may be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.

[0319] The units described in the embodiments of this application can be implemented in software or hardware, and the described units can also be located in a processor. The names of these units do not necessarily limit the specific unit itself.

[0320] Another aspect of this application provides a computer-readable medium having a computer program stored thereon, which, when executed by a processor, implements the search and retrieval method as described above. This computer-readable medium may be included in the electronic device described in the above embodiments, or it may exist independently and not assembled into the electronic device.

[0321] Another aspect of this application provides a computer program product or computer program including computer instructions stored in a computer-readable medium. A processor of an electronic device reads the computer instructions from the computer-readable medium and executes the computer instructions, causing the electronic device to perform the search and recall methods provided in the various embodiments described above.

[0322] The above description is merely a preferred exemplary embodiment of this application and is not intended to limit the implementation of this application. Those skilled in the art can easily make corresponding modifications or alterations based on the main concept and spirit of this application. Therefore, the scope of protection of this application should be determined by the scope of protection claimed in the claims.

Claims

1. A search recall method, characterized in that, include: If search information is received, a first word vector corresponding to the search information is generated, and a second word vector corresponding to each candidate resource is obtained. The second word vector of the same candidate resource is obtained based on the multi-domain attribute information of the same candidate resource. The correlation between the search information and each candidate resource is calculated based on the first word vector and the second word vector corresponding to each candidate resource. Based on the relevance, target candidate resources are selected from multiple candidate resources to obtain the search recall results corresponding to the search information.

2. The method according to claim 1, characterized in that, There are multiple first word vectors, and multiple second word vectors corresponding to each candidate resource; the calculation based on the first word vectors and the second word vectors corresponding to each candidate resource to obtain the relevance between the search information and each candidate resource includes: For each first word vector, calculate the similarity between the first word vector and each second word vector in the same candidate resource, and use the maximum similarity as the similarity reference information corresponding to the first word vector; Based on the similarity reference information corresponding to multiple first word vectors, the correlation between the search information and the same candidate resource is obtained.

3. The method according to claim 2, characterized in that, The process of obtaining the relevance between the search information and the same candidate resource based on similarity reference information corresponding to multiple first word vectors includes: The average similarity is obtained by averaging the similarity reference information corresponding to multiple first word vectors. The average similarity is used as the correlation between the search information and the same candidate resource.

4. The method according to claim 1, characterized in that, The step of obtaining the second word vector corresponding to each candidate resource includes: Obtain the second word vector corresponding to each candidate resource from the candidate resource library; The multi-domain attribute information includes the document title and document content; before obtaining the second word vector corresponding to each candidate resource, the method further includes: Retrieve the document title and document content for each candidate resource; Based on the document title and document content corresponding to each candidate resource, a second word vector corresponding to each candidate resource is obtained; The second word vector corresponding to each candidate resource is stored in the candidate resource library.

5. The method according to claim 4, characterized in that, The step of obtaining the second word vector corresponding to each candidate resource based on the document title and document content corresponding to each candidate resource includes: The document title corresponding to each candidate resource is segmented to obtain the first candidate word corresponding to the document title, and the document content corresponding to each candidate resource is segmented to obtain the second candidate word corresponding to the document content. A first candidate word vector is generated based on the context of the first candidate word, and a second candidate word vector is generated based on the context of the second candidate word; The first candidate word vector and the second candidate word vector corresponding to the same candidate resource are combined to obtain the second word vector corresponding to the same candidate resource.

6. The method according to claim 5, characterized in that, The step of performing word segmentation on the document content corresponding to each candidate resource to obtain the second candidate word corresponding to the document content includes: Extract key information from the document content corresponding to each candidate resource; The key information corresponding to each candidate resource is segmented into words to obtain the second candidate word corresponding to the key information.

7. The method according to any one of claims 1 to 6, characterized in that, The first word vector corresponding to the search information is generated by the recall model, and the second word vector corresponding to each candidate resource is obtained. The correlation between the search information and each candidate resource is calculated based on the first word vector and the second word vector corresponding to each candidate resource. The target candidate resource is selected from multiple candidate resources based on the correlation to obtain the search recall result corresponding to the search information. The recall model is trained in the following manner: Obtain search sample information and candidate sample resources; The search sample information and the candidate sample resources are input into the model to be trained. The model to be trained generates a first sample word vector corresponding to the search sample information and a second sample word vector corresponding to the candidate sample resources based on the multi-domain sample attribute information of the candidate sample resources. The sample correlation between the search sample information and the candidate sample resources is calculated based on the first sample word vector and the second sample word vector. The loss is constructed based on the first sample word vector, the second sample word vector, and the sample relevance, and the model to be trained is trained based on the loss to obtain the recall model.

8. The method according to claim 7, characterized in that, The recall model includes a contrastive learning module and a similarity calculation module; The contrastive learning module is used to generate a first word vector corresponding to the search information and to obtain a second word vector corresponding to each candidate resource; wherein, the contrastive learning module is trained based on the first sample word vector and the second sample word vector; The similarity calculation module is used to calculate the correlation between the search information and each candidate resource based on the first word vector and the second word vector corresponding to each candidate resource, and to select the target candidate resource from multiple candidate resources based on the correlation to obtain the search recall result corresponding to the search information; wherein, the similarity calculation module is trained based on the sample correlation.

9. The method according to claim 8, characterized in that, The candidate sample resources include positive sample resources and negative sample resources; the contrastive learning module is trained in the following manner: The first sample word vector corresponding to the search sample information is generated by the first functional module of the model to be trained; the positive sample word vector corresponding to the positive sample resource is generated based on the multi-domain sample attribute information of the positive sample resource; and the negative sample word vector corresponding to the negative sample resource is generated based on the multi-domain sample attribute information of the negative sample resource. The positive sample word vector and the negative sample word vector are used as the second sample word vector. Based on the first sample word vector and the second sample word vector, a contrastive learning loss function is constructed, and the first functional module is trained based on the contrastive learning loss function to obtain the contrastive learning module.

10. The method according to claim 9, characterized in that, The multi-domain sample attribute information includes document title and document content; the generation of positive sample word vectors corresponding to the positive sample resources based on the multi-domain sample attribute information of the positive sample resources, and the generation of negative sample word vectors corresponding to the negative sample resources based on the multi-domain sample attribute information of the negative sample resources, include: Obtain the document title and document content corresponding to the positive sample resource, and based on the document title and document content corresponding to the positive sample resource, obtain the positive sample word vector corresponding to the positive sample resource; and Obtain the document title and document content corresponding to the negative sample resource, and based on the document title and document content corresponding to the negative sample resource, obtain the negative sample word vector corresponding to the negative sample resource.

11. The method according to claim 9, characterized in that, The first functional module includes a first encoder and a second encoder that are independent of each other; the step of generating the first sample word vector corresponding to the search sample information, generating the positive sample word vector corresponding to the positive sample resource based on the multi-domain sample attribute information of the positive sample resource, and generating the negative sample word vector corresponding to the negative sample resource based on the multi-domain sample attribute information of the negative sample resource through the first functional module of the model to be trained includes: The first encoder generates the first sample word vector corresponding to the search sample information; The second encoder generates positive sample word vectors corresponding to the positive sample resources based on the multi-domain sample attribute information of the positive sample resources, and generates negative sample word vectors corresponding to the negative sample resources based on the multi-domain sample attribute information of the negative sample resources.

12. The method according to claim 8, characterized in that, The similarity calculation module is trained in the following way: The second functional module of the model to be trained calculates the sample correlation between the search sample information and the candidate sample resources based on the first sample word vector and the second sample word vector. A similarity calculation loss function is constructed based on the sample correlation, and the second functional module is trained based on the similarity calculation loss function to obtain the similarity calculation module.

13. The method according to claim 12, characterized in that, The first sample word vectors are multiple, and the second sample word vectors are multiple; the step of calculating the sample relevance between the search sample information and the candidate sample resources based on the first sample word vectors and the second sample word vectors by the second functional module of the model to be trained includes: Through the second functional module of the model to be trained, for each first sample word vector, the similarity between the first sample word vector and each second sample word vector in the candidate sample resources is calculated, and the maximum similarity is used as the similarity sample reference information corresponding to the first sample word vector; Based on the similarity sample reference information corresponding to multiple first sample word vectors, the correlation between the search sample information and the candidate sample resources is obtained.

14. A search and recall device, characterized in that, include: The generation and acquisition module is configured to generate a first word vector corresponding to the search information and acquire a second word vector corresponding to each candidate resource if search information is received. The second word vector of the same candidate resource is obtained based on the multi-domain attribute information of the same candidate resource. The calculation module is configured to perform calculations based on the first word vector and the second word vector corresponding to each candidate resource to obtain the correlation between the search information and each candidate resource. The selection module is configured to select target candidate resources from multiple candidate resources based on the relevance, so as to obtain the search recall results corresponding to the search information.

15. An electronic device, characterized in that, include: One or more processors; A memory for storing one or more computer programs that, when executed by the electronic device, cause the electronic device to perform the search recall method as described in any one of claims 1 to 13.

16. A computer-readable medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the search recall method as described in any one of claims 1 to 13.

17. A computer program product comprising computer instructions, characterized in that, When the computer instructions are executed by the processor, they implement the search recall method as described in any one of claims 1 to 13.