Search box drop-down phrase recommendation method and device, electronic equipment and storage medium
By comprehensively considering semantics and prefix matching through a dual-tower recommendation model, the problem of inaccurate dropdown candidate word recommendations in existing technologies is solved, enabling more efficient search of business requirements documents and improving user experience.
Patent Information
- Application Number
- CN202210954616.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-10
- Publication Date
- 2026-02-10
- Estimated Expiration
- 2042-08-10
AI Technical Summary
Existing dropdown suggestion methods cannot accurately recommend semantically matching candidate phrases, resulting in a poor user experience. This is especially true during the writing of business requirement documents, where requirement documents with similar content but different keywords cannot be found in search results.
A dual-tower recommendation model is adopted. The semantic vector and query vector of the query item text are output by the network on the left tower side. Combined with the pre-built semantic index list and matching index list, the model recommends the first type of phrases with semantic matching and the second type of phrases with prefix matching. The trained dual-tower recommendation model is used to perform comprehensive recommendation based on semantic and prefix matching.
The dropdown list recommendation accuracy has been improved, making it easier to find requirement documents with similar content but different keywords, thus enhancing the user experience and making it easier for business personnel to quickly write requirement documents.
Smart Images

Figure CN115687597B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present disclosure relates to the technical field of artificial intelligence, in particular to a search box drop-down phrase recommendation method, device, equipment, medium and program product. BACKGROUND
[0002] In the process of compiling a business requirement document, a user usually helps to compile by using a search function. In the input process of the user search, the search word is associated and recommended to help the user quickly locate the actual key word to be searched, which is a key step for the system to assist the user search. In the process of implementing the present disclosure, it is found that the existing recommendation method of drop-down candidate words cannot recommend more accurate candidate phrases to the user, and the user experience is poor. SUMMARY
[0003] In view of the above problems, the present disclosure provides a search box drop-down phrase recommendation method, device, equipment, medium and program product.
[0004] An aspect of the present disclosure provides a search box drop-down phrase recommendation method, comprising:
[0005] obtaining query item text, wherein the query item text is associated with a query character input by a target user in a search box;
[0006] inputting the query item text into a left tower side network of a double tower recommendation model, so as to respectively output a semantic vector and a query vector of the query item text through different layers of the left tower side network;
[0007] determining a first type of recommended phrase matched with the semantic of the query character by using the semantic vector and a pre-constructed semantic index list;
[0008] determining a second type of recommended phrase matched with the prefix of the query character by using the query vector and a pre-constructed matching index list, wherein the semantic index list and the matching index list are respectively constructed by using different layers of a right tower side network of the double tower recommendation model according to a plurality of historical search records of historical users in a preset historical time period;
[0009] recommending the first type of recommended phrase and the second type of recommended phrase to the target user, wherein the first type of recommended phrase and the second type of recommended phrase are used to generate a business requirement document.
[0010] According to an embodiment of the present disclosure, the left tower side network comprises a first left side network layer and a second left side network layer connected in sequence, and the respective output of the semantic vector and the query vector of the query item text through different layers of the left tower side network comprises:
[0011] inputting the query item text into the first left side network layer to output the semantic vector of the query item text through the first left side network layer;
[0012] The semantic vector of the query text is input into the second left network layer, so that the query vector of the query text is output through the second left network layer.
[0013] According to embodiments of this disclosure, the right tower-side network comprises a first right-side network layer and a second right-side network layer connected sequentially, and the semantic index list is constructed using the following method:
[0014] Retrieve multiple historical search records of historical users within a preset historical time period. These historical search records include multiple historical candidate phrases used to generate historical business requirement documents.
[0015] Multiple historical candidate phrases are input into the first right-hand network layer, so that the first right-hand network layer outputs multiple first candidate vectors associated with the multiple historical candidate phrases;
[0016] Multiple first candidate vectors and multiple historical candidate phrases are paired to form multiple semantic index pairs, and these multiple semantic index pairs constitute a semantic index list.
[0017] According to embodiments of this disclosure, the matching index list is constructed using the following method:
[0018] Multiple first candidate vectors are input into the second right-hand network layer, so that the second right-hand network layer outputs multiple second candidate vectors associated with multiple historical candidate phrases;
[0019] Multiple second candidate vectors and multiple historical candidate phrases are paired to form multiple matching index pairs, and these multiple matching index pairs constitute a matching index list.
[0020] According to embodiments of this disclosure, the second category of recommended phrases that match the prefix of the query text, determined using a query vector and a pre-built matching index list, includes:
[0021] The target matching index pair is determined from multiple matching index pairs in the matching index list, wherein the target second candidate vector in the target matching index pair and the query vector satisfy a preset similarity condition;
[0022] Extract the target historical candidate phrases from the target matching index pairs and use them as the second type of recommended phrases.
[0023] According to embodiments of this disclosure, determining a target matching index pair from a plurality of matching index pairs in a matching index list includes:
[0024] Using a predefined retrieval tool, the target matching index pair is determined from multiple matching index pairs in the matching index list.
[0025] According to embodiments of this disclosure, the dual-tower recommendation model is trained using the following method:
[0026] obtaining a query item training text, a positive sample of the query item training text, and a negative sample of the query item training text, wherein the query item training text is associated with historical query text input by a historical user in a search box, and the positive sample and the negative sample are associated with a plurality of historical search records of the historical user in a preset historical time period;
[0027] inputting the query item training text into a left tower side network of a double tower recommendation model to be trained, so as to output a first training vector of the query item text through the left tower side network to be trained;
[0028] inputting the positive sample of the query item training text and the negative sample of the query item training text into a right tower side network of the double tower recommendation model to be trained, so as to output a second training vector of the positive sample and the negative sample through the right tower side network to be trained;
[0029] calculating a similarity of the first training vector and the second training vector;
[0030] obtaining the double tower recommendation model trained in a case where the similarity of the first training vector and the second training vector meets a preset termination condition.
[0031] Another aspect of the present disclosure provides a search box drop-down phrase recommendation device, comprising an obtaining module, an input and output module, a first determination module, a second determination module, and a recommendation module.
[0032] The obtaining module is configured to obtain a query item text, wherein the query item text is associated with query text input by a target user in a search box.
[0033] The input and output module is configured to input the query item text into a left tower side network of a double tower recommendation model, so as to output a semantic vector and a query vector of the query item text through different layers of the left tower side network respectively.
[0034] The first determination module is configured to determine a first type of recommended phrase matched with semantics of the query text by using the semantic vector and a pre-constructed semantic index list.
[0035] The second determination module is configured to determine a second type of recommended phrase matched with a prefix of the query text by using the query vector and a pre-constructed matching index list, wherein the semantic index list and the matching index list are respectively constructed by using different layers of a right tower side network of the double tower recommendation model according to a plurality of historical search records of a historical user in a preset historical time period.
[0036] The recommendation module is configured to recommend the first type of recommended phrase and the second type of recommended phrase to the target user, wherein the first type of recommended phrase and the second type of recommended phrase are used to generate a business requirement document.
[0037] According to an embodiment of the present disclosure, the left tower side network comprises a first left side network layer and a second left side network layer connected in sequence, and the input and output module comprises a first input and output unit and a second input and output unit.
[0038] The first input and output unit is configured to input the query item text into the first left side network layer to output a semantic vector of the query item text through the first left side network layer.
[0039] The second input and output unit is configured to input the semantic vector of the query item text into the second left side network layer to output a query vector of the query item text through the second left side network layer.
[0040] According to an embodiment of the present disclosure, the right tower side network comprises a first right side network layer and a second right side network layer connected in sequence.
[0041] The device further comprises a first construction module configured to construct a semantic index list, wherein the first construction module comprises a first acquisition unit, a third input and output unit and a first combination unit.
[0042] The first acquisition unit is configured to acquire a plurality of historical search records of historical users in a preset historical time period, and the plurality of historical search records comprise a plurality of historical candidate phrases used to generate a historical business requirement document.
[0043] The third input and output unit is configured to input the plurality of historical candidate phrases into the first right side network layer to output a plurality of first candidate vectors associated with the plurality of historical candidate phrases through the first right side network layer.
[0044] The first combination unit is configured to combine the plurality of first candidate vectors and the plurality of historical candidate phrases in pairs to form a plurality of semantic index pairs, wherein the plurality of semantic index pairs constitute the semantic index list.
[0045] According to an embodiment of the present disclosure, the device further comprises a second construction module configured to construct a matching index list, wherein the second construction module comprises a fourth input and output unit and a second combination unit.
[0046] The fourth input and output unit is configured to input the plurality of first candidate vectors into the second right side network layer to output a plurality of second candidate vectors associated with the plurality of historical candidate phrases through the second right side network layer.
[0047] The second combination unit is configured to combine the plurality of second candidate vectors and the plurality of historical candidate phrases in pairs to form a plurality of matching index pairs, wherein the plurality of matching index pairs constitute the matching index list.
[0048] According to an embodiment of the present disclosure, the second determination module comprises a determination unit and an extraction unit.
[0049] The determining unit is used to determine the target matching index pair from multiple matching index pairs in the matching index list, wherein the target second candidate vector in the target matching index pair and the query vector satisfy a preset similarity condition.
[0050] The extraction unit is used to extract target historical candidate phrases from the target matching index pairs as second-class recommended phrases.
[0051] According to embodiments of this disclosure, the determining unit includes a determining subunit for determining a target matching index pair from a plurality of matching index pairs in a matching index list using a predetermined retrieval tool.
[0052] According to embodiments of this disclosure, the above-described apparatus further includes a training module for training a dual-tower recommendation model, wherein the training module includes a second acquisition unit, a fifth input-output unit, a sixth input-output unit, a calculation unit, and an iteration unit.
[0053] The second acquisition unit is used to acquire query training text, positive samples of query training text, and negative samples of query training text. The query training text is associated with the historical query text entered by the historical user in the search box, and the positive and negative samples are associated with multiple historical search records of the historical user within a preset historical time period.
[0054] The fifth input / output unit is used to input the query training text into the left tower side network of the dual-tower recommendation model to be trained, so as to output the first training vector of the query text through the left tower side network to be trained.
[0055] The sixth input / output unit is used to input the positive samples and negative samples of the query training text into the right tower side network of the dual-tower recommendation model to be trained, so as to output the second training vector of the positive and negative samples through the right tower side network to be trained.
[0056] A calculation unit is used to calculate the similarity between the first training vector and the second training vector;
[0057] An iterative unit is used to obtain the trained dual-tower recommendation model when the similarity between the first training vector and the second training vector meets a preset termination condition.
[0058] Another aspect of this disclosure provides an electronic device including: one or more processors; and a memory for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors cause the search box drop-down phrase recommendation method described above to be performed.
[0059] Another aspect of this disclosure provides a computer-readable storage medium having executable instructions stored thereon, which, when executed by a processor, cause the processor to perform the aforementioned search box dropdown phrase recommendation method.
[0060] Another aspect of this disclosure provides a computer program product, including a computer program that, when executed by a processor, implements the above-described search box dropdown phrase recommendation method. Attached Figure Description
[0061] The foregoing contents, as well as other objects, features, and advantages of this disclosure, will become clearer from the following description of embodiments with reference to the accompanying drawings, in which:
[0062] Figure 1 The illustration schematically depicts an application scenario of a search box dropdown phrase recommendation method, apparatus, device, medium, and program product according to embodiments of the present disclosure;
[0063] Figure 2 A flowchart illustrating a search box dropdown phrase recommendation method according to an embodiment of the present disclosure is shown schematically.
[0064] Figure 3 A flowchart illustrating a search box dropdown phrase recommendation method according to another embodiment of the present disclosure is shown schematically;
[0065] Figure 4 A flowchart illustrating a method for training a dual-tower recommendation model according to an embodiment of the present disclosure is shown schematically.
[0066] Figure 5 A schematic block diagram of a search box drop-down phrase recommendation device according to an embodiment of the present disclosure is shown; and
[0067] Figure 6 A block diagram schematically illustrates an electronic device suitable for implementing a search box dropdown phrase recommendation method according to an embodiment of the present disclosure. Detailed Implementation
[0068] The embodiments of the present disclosure will now be described with reference to the accompanying drawings. However, it should be understood that these descriptions are exemplary only and are not intended to limit the scope of the disclosure. In the following detailed description, numerous specific details are set forth to provide a thorough understanding of the embodiments of the present disclosure for ease of explanation. However, it will be apparent that one or more embodiments may be practiced without these specific details. Furthermore, descriptions of well-known structures and techniques are omitted in the following description to avoid unnecessarily obscuring the concepts of the present disclosure.
[0069] The terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit this disclosure. The terms “comprising,” “including,” etc., as used herein indicate the presence of the stated features, steps, operations, and / or components, but do not exclude the presence or addition of one or more other features, steps, operations, or components.
[0070] All terms used herein (including technical and scientific terms) have the meanings commonly understood by those skilled in the art, unless otherwise defined. It should be noted that the terms used herein are to be interpreted in a manner consistent with the context of this specification, and not in an idealized or overly rigid way.
[0071] When using expressions such as "at least one of A, B, and C", they should generally be interpreted in accordance with the meaning that is commonly understood by a person skilled in the art (e.g., "a system having at least one of A, B, and C" should include, but is not limited to, a system having A alone, a system having B alone, a system having C alone, a system having A and B, a system having A and C, a system having B and C, and / or a system having A, B, and C, etc.).
[0072] With the rapid development of internet technology, people are editing traditional documents online, leading to an explosive growth in the amount of unstructured text data. Business requirements documents, as the best way to explain business needs, have given rise to numerous requirements document writing systems. These documents serve as crucial communication tools between requirements analysts and developers, providing a basis for later delivery specifications and testing. Providing requirements personnel with similar requirements documents for reference reduces their workload.
[0073] During the writing of business requirements documents, users typically utilize the search function for assistance. The system's ability to suggest and recommend search terms during user input helps them quickly locate the specific keywords they are looking for—a crucial step in assisting user searches. The system's guidance becomes paramount in helping users select the most relevant requirements documents from a large dataset. This process of suggesting and recommending search terms during user input, helping them quickly locate the desired keywords, is the most critical step in assisting user searches and a vital element of the user experience.
[0074] In the process of implementing this disclosure, it was found that existing dropdown suggestion methods cannot recommend accurate candidate phrases to users, resulting in a poor user experience.
[0075] For example, most dropdown suggestions in related technologies rely on prefix matching for searching. For instance, searching for "apple" will only return suggestions starting with "apple." However, when users search for requirements documents, they primarily focus on the content. But the domain limitations of these requirements restrict the keywords they can input. Requirements documents with similar content but different keywords will not be found, contradicting the user's initial expectations. Therefore, to meet user needs, dropdown suggestions should consider not only semantic matching but also prefix matching.
[0076] In view of the above, embodiments of this disclosure provide a method, apparatus, device, medium, and program product for recommending drop-down phrases in a search box.
[0077] One aspect of this disclosure provides a method for recommending dropdown phrases in a search box, including:
[0078] Retrieve the query text, which is associated with the query text entered by the target user in the search box;
[0079] The query text is input into the left tower side network of the dual-tower recommendation model, so that the semantic vector of the query text and the query vector are output through different layers of the left tower side network respectively.
[0080] Using semantic vectors and a pre-built list of semantic indexes, the first category of recommended phrases that semantically match the text are identified and queried.
[0081] Using query vectors and a pre-built matching index list, the second type of recommended phrases that match the prefix of the query text are determined. The semantic index list and the matching index list are constructed using different layers of the right tower side network of the dual-tower recommendation model, based on multiple historical search records of historical users within a preset historical time period.
[0082] The system recommends first-category recommended phrases and second-category recommended phrases for the query item to the target user. The first-category recommended phrases and the second-category recommended phrases are used to generate the business requirements document.
[0083] Figure 1 The illustration schematically depicts an application scenario of a search box dropdown phrase recommendation method, apparatus, device, medium, and program product according to embodiments of the present disclosure.
[0084] like Figure 1 As shown, application scenario 100 according to this embodiment may include terminal devices 101, 102, and 103, network 104, and server 105. Network 104 is used as a medium to provide a communication link between terminal devices 101, 102, and 103 and server 105. Network 104 may include various connection types, such as wired or wireless communication links or fiber optic cables, etc.
[0085] Users can use terminal devices 101, 102, and 103 to interact with server 105 via network 104 to receive or send messages, etc. Various communication client applications can be installed on terminal devices 101, 102, and 103, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social media platform software, etc. (for example only).
[0086] Terminal devices 101, 102, and 103 can be various electronic devices with displays and web browsing capabilities, including but not limited to smartphones, tablets, laptops, and desktop computers.
[0087] Server 105 can be a server that provides various services, such as a backend management server that supports websites browsed by users using terminal devices 101, 102, and 103 (for example only). The backend management server can analyze and process data such as received user requests, and feed back the processing results (such as web pages, information, or data obtained or generated according to user requests) to the terminal devices.
[0088] In the application scenario of this disclosure embodiment, users can use the search function to help write search terms, and the system will suggest and recommend search terms during the user's search input process to help the user quickly locate the keywords they actually want to search for. Users can use terminal devices 101, 102, and 103 to input query text to send a request to server 105 to obtain recommended drop-down phrases. Server 105 can be used to execute the search box drop-down phrase recommendation method of this disclosure embodiment. The query item text associated with the query text entered by the user in the search box is input into the left tower side network of the dual-tower recommendation model. The semantic vector and query vector of the query item text are output through different layers of the left tower side network. Using the semantic vector and a pre-built semantic index list, a first type of recommended phrase that semantically matches the query text is determined. Using the query vector and a pre-built matching index list, a second type of recommended phrase that prefixes match the query text is determined. The two types of recommended phrases are then displayed to the user in the search box drop-down list through terminal devices 101, 102, and 103.
[0089] It should be noted that the search box drop-down phrase recommendation method provided in this embodiment can generally be executed by server 105. Correspondingly, the search box drop-down phrase recommendation device provided in this embodiment can generally be located in server 105. The search box drop-down phrase recommendation method provided in this embodiment can also be executed by a server or server cluster that is different from server 105 and capable of communicating with terminal devices 101, 102, 103 and / or server 105. Correspondingly, the search box drop-down phrase recommendation device provided in this embodiment can also be located in a server or server cluster that is different from server 105 and capable of communicating with terminal devices 101, 102, 103 and / or server 105.
[0090] It should be understood that Figure 1 The number of terminal devices, networks, and servers shown is merely illustrative. Depending on implementation needs, any number of terminal devices, networks, and servers can be included.
[0091] It should be noted that the search box drop-down phrase recommendation method and apparatus of this disclosure can be used in the field of artificial intelligence technology, the field of financial technology, or any field other than the field of artificial intelligence technology and the field of financial technology. The embodiments of this disclosure do not limit the application field of the above-mentioned search box drop-down phrase recommendation method and apparatus.
[0092] In the technical solution disclosed herein, the collection, storage, use, processing, transmission, provision, disclosure, and application of user personal information comply with the provisions of relevant laws and regulations, necessary confidentiality measures have been taken, and there is no violation of public order and good morals.
[0093] In the technical solution disclosed herein, the user's authorization or consent is obtained before acquiring or collecting the user's personal information.
[0094] The following will be based on Figure 1 The described scene, through Figures 2 to 6 The method for recommending drop-down phrases in the search box according to the disclosed embodiments is described in detail.
[0095] Figure 2 A flowchart illustrating a search box dropdown phrase recommendation method according to an embodiment of the present disclosure is shown schematically.
[0096] like Figure 2 As shown, the search box drop-down phrase recommendation method in this embodiment includes operations S201 to S205.
[0097] In operation S201, the query item text is obtained, which is associated with the query text entered by the target user in the search box;
[0098] In operation S202, the query item text is input into the left tower side network of the dual-tower recommendation model to respectively output the semantic vector and the query vector of the query item text through different layers of the left tower side network;
[0099] In operation S203, using the semantic vector and the pre-constructed semantic index list, the first type of recommended phrases that semantically match the query text are determined;
[0100] In operation S204, using the query vector and the pre-constructed matching index list, the second type of recommended phrases that prefix-match the query text are determined, where the semantic index list and the matching index list are respectively constructed using different layers of the right tower side network of the dual-tower recommendation model based on multiple historical search records of historical users within a preset historical time period;
[0101] In operation S205, the first type of recommended phrases and the second type of recommended phrases of the query item are recommended to the target user, where the first type of recommended phrases and the second type of recommended phrases are used to generate a business requirement document.
[0102] According to an embodiment of the present disclosure, in operation S201, the query item text is associated with the query text input by the target user in the search box, for example, it can be text obtained by preprocessing the query text input by the user (such as extracting keywords, removing stop words, etc.).
[0103] According to an embodiment of the present disclosure, the left tower side network of the dual-tower recommendation model is used to input the query item text, and the right tower side network of the dual-tower recommendation model is used to input the search records associated with the query item text. For example, a complete search record can be: system fault recovery time requirement, and the query item text associated with this can be partial words or phrases in the search record, such as any of the following: system, system fault, system fault recovery time, etc. After encoding and dimension reduction of the query item text by the left tower side network of the dual-tower recommendation model, a vector associated with the query item text can be output through the top of the left tower. After encoding and dimension reduction of the search records by the right tower side network of the dual-tower recommendation model, a vector associated with the search records can be output through the top of the right tower.
[0104] According to an embodiment of the present disclosure, the trained dual-tower recommendation model is used to perform vector encoding on input phrases, words, sentences, etc. The dual-tower recommendation model includes a left tower side network and a right tower side network. The left tower side network and the right tower side network include at least two layers of networks. For example, the left tower side network can include a first left network layer and a second left network layer, and the right tower side network includes a first right network layer and a second right network layer. Different layers of the left tower side network and the right tower side network can respectively obtain different vector representations.
[0105] For example, in operation S202, the query text is input into the left tower side network of the dual-tower recommendation model. Different layers of the left tower side network can output the semantic vector and query vector of the query text. In operations S203 and S204, the semantic vector can be used to retrieve words / sentences from the semantic index list that are semantically similar to the query text, while the query vector can be used to retrieve words / sentences from the matching index list that closely match the prefix of the query text. The matching rules are determined based on the network structure, loss function, and training sample data.
[0106] According to embodiments of this disclosure, a semantic index list and a matching index list can be constructed using different layers of the right-side network of the dual-tower recommendation model, based on multiple historical search records of historical users within a preset historical time period. The semantic index list and the matching index list can be constructed using vectors output from different layers of the right-side network of the dual-tower recommendation model.
[0107] According to embodiments of this disclosure, by utilizing the semantic vector and query vector output from the left-side network of the dual-tower recommendation model, and using the semantic index list and matching index list constructed from the output vectors of different layers of the right-side network, retrieval and matching are performed. The semantic vector is used to retrieve semantically matching phrases from the semantic index list, and the query vector is used to retrieve phrases with relatively matching prefixes from the matching index list. Through this method, when a requirement engineer searches for a requirement document, the document system continuously captures the input of the current search term and requests the recommendation system, thereby completing real-time dynamic recommendation of dropdown terms in the requirement document search. The recommended phrases given in the dropdown list consider both prefix matching and semantic matching, resulting in higher recommendation accuracy. This allows requirement documents with similar content but different keywords to be better retrieved, solving the technical problem of unsatisfactory dropdown list search recommendation effects in related technologies, meeting user search needs, improving user experience, and facilitating business personnel to write business requirement documents more quickly and efficiently.
[0108] According to embodiments of this disclosure, the left-side network of the dual-tower recommendation model may specifically include a first left-side network layer and a second left-side network layer connected sequentially. Further, the semantic vector and query vector of the query item text are output separately through different layers of the left-side network, including:
[0109] First, the query text is input into the first left network layer to output the semantic vector of the query text. The first left network layer can be, for example, a BERT model, which is used to encode the query text and extract textual semantic features. The BERT model has mature applications in the field of natural language processing, and the parameters of the pre-trained open-source BERT model can be used to initialize the parameters of the model here.
[0110] Next, the semantic vector of the query text is input into the second left-hand network layer, which then outputs the query vector of the query text. The second left-hand network layer is used to reduce the dimensionality of the semantic vector output by the BERT model.
[0111] According to embodiments of this disclosure, by training a BERT model, semantic vectors can be used to retrieve words / sentences that are semantically similar to the query text from a semantic index list. By training a second left-hand network layer, query vectors can be used to retrieve words / sentences that closely match the prefix of the query text from a matching index list. The matching rules are determined based on the network structure, loss function, and training sample data.
[0112] According to embodiments of this disclosure, a semantic index list and a matching index list are constructed using the output vectors of different layers of the right tower side network. The semantic index list includes multiple semantic index pairs, which are obtained by combining the output vector of the first layer of the right tower side network with historical candidate phrases. The matching index list includes multiple matching index pairs, which are obtained by combining the output vector of the second layer of the right tower side network with historical candidate phrases.
[0113] Using semantic vectors and a pre-built list of semantic indexes, the first type of recommended phrases for determining and querying semantically matched text may include: determining a target semantic index pair from multiple semantic index pairs in the list of semantic indexes, wherein the target first candidate vector in the target semantic index pair satisfies a preset similarity condition with the semantic vector (e.g., taking the top n index pairs with the highest similarity); and extracting the target historical candidate phrases from the target semantic index pair as the first type of recommended phrases.
[0114] Using the query vector and a pre-built list of matching indexes, the second type of recommended phrases that match the prefix of the query text are determined by: identifying the target matching index pair from multiple matching index pairs in the matching index list, wherein the target second candidate vector in the target matching index pair satisfies the preset similarity condition with the query vector (e.g., taking the top n index pairs with the highest similarity); and extracting the target historical candidate phrases from the target matching index pair as the second type of recommended phrases.
[0115] Determining the target matching index pair from multiple matching index pairs in the matching index list can be achieved using a pre-defined retrieval tool (such as FAISS) to select the target matching index pair from multiple matching index pairs in the matching index list. Alternatively, it can be achieved using a pre-defined retrieval tool to select the target semantic index pair from multiple semantic index pairs in the semantic index list.
[0116] According to embodiments of this disclosure, by retrieving phrases that are relatively similar to the semantic vector and query vector from the semantic index list and the matching index list respectively, as recommended phrases, it is possible to further filter phrases from multiple candidate phrases to select those with better semantic and prefix matching as recommended phrases, thereby further improving the efficiency and accuracy of recommendations. Improving the use of retrieval tools for matching within the index list can enhance retrieval efficiency and accuracy.
[0117] According to embodiments of this disclosure, a semantic index list and a matching index list can be constructed using the output vectors of different layers of the right tower side network. The right tower side network includes a first right network layer and a second right network layer connected in sequence. The semantic index list and the matching index list are constructed by the following methods respectively.
[0118] The semantic index list is constructed as follows:
[0119] The system retrieves multiple historical search records from historical users within a preset historical time period. These records include multiple historical candidate phrases used to generate historical business requirement documents. The multiple historical candidate phrases are input into a first right-hand network layer, which outputs multiple first candidate vectors associated with these phrases. This first right-hand network layer can be, for example, a BERT model, used to encode the historical search records. The multiple first candidate vectors and the multiple historical candidate phrases are then paired to form multiple semantic index pairs, which together constitute a semantic index list.
[0120] The method for constructing the matching index list is as follows:
[0121] Multiple first candidate vectors are input into the second right-hand network layer, which outputs multiple second candidate vectors associated with multiple historical candidate phrases. The second right-hand network layer is used to reduce the dimensionality of the first candidate vectors output by the BERT model to obtain the second candidate vectors. Multiple second candidate vectors and multiple historical candidate phrases are paired to form multiple matching index pairs, which constitute a matching index list.
[0122] Figure 3 A flowchart illustrating a search box dropdown phrase recommendation method according to another embodiment of this disclosure is shown schematically. The following is in conjunction with... Figure 3 The method of the embodiments of this disclosure will be described.
[0123] like Figure 3 As shown in the embodiments of this disclosure, the search box drop-down phrase recommendation method includes an offline process and an online process.
[0124] The offline process consists of two operations. First, training the dual-tower recommendation model; second, after the model is trained, to facilitate more efficient online feedback of dropdown candidate phrases to users, an index needs to be built. This can be done using the right-side network of the trained dual-tower recommendation model to construct an index list. Specifically, a semantic index list and a matching index list can be constructed using the output vectors of different layers of the right-side network. Each sentence / phrase in the index list corresponds to a vector. During online queries, the output vector of the query term is used to retrieve the most similar candidate phrases in the index. The specific method for constructing the index can be referred to the relevant description in the previous embodiments, and will not be repeated here. To facilitate an efficient online retrieval process, the FAISS tool can be used to construct the index. When constructing the index with FAISS, the query vector with higher similarity to the query vector is prioritized.
[0125] The online recommendation process may include the following three steps.
[0126] First, the requirements document system obtains the search text entered by the user in the search bar of the requirements document, preprocesses the text content, and obtains the query item text.
[0127] Second, the query text is input into the left tower side network of the dual-tower recommendation model. The semantic vector of the query text is output through the first left network layer, and the query vector of the query text is output through the second left network layer.
[0128] Third, using the FAISS tool, semantic vectors are used to search a pre-built semantic index list to determine the first category of recommended phrases that semantically match the query text. Then, using the FAISS tool, query vectors are used to search a pre-built matching index list to determine the second category of recommended phrases that prefix the query text matches, thus obtaining a set of recommended candidate phrases. The number of phrases returned can be set according to actual usage needs. During offline index building, phrases with higher similarity are prioritized in the returned values, allowing for the retrieval of multiple phrases related to the user's input, thereby completing the dropdown phrase recommendation.
[0129] Figure 4 A flowchart illustrating a method for training a dual-tower recommendation model according to an embodiment of the present disclosure is shown.
[0130] like Figure 4 As shown, the method for training the dual-tower recommendation model in this embodiment includes operations S401 to S405.
[0131] In operation S401, the query training text, positive samples of the query training text, and negative samples of the query training text are obtained. The query training text is associated with the historical query text entered by the historical user in the search box, and the positive and negative samples are associated with multiple historical search records of the historical user within a preset historical time period.
[0132] The training text can be obtained by parsing the system search logs. All the historical search records of the requirement documents in the search logs are used as the candidate set, and each historical search record is used as a phrase.
[0133] The query item training text is constructed by the following method: For each historical search record, stop words are removed from the historical search record and word segmentation is performed. After word segmentation, each historical search record obtains k words. By taking the first 1, the first 2,..., the first k - 1 words respectively, k - 1 query item training texts can be obtained. For example, one of the historical search records is: Online system response time requirement. The k - 1 query item training texts are respectively: Lian, Onlin, Onlin Sy, Onlin Syst, Onlin Syst Re, Onlin Syst Resp, Onlin Syst Respt, Onlin Syst Respti, Onlin Syst Resptim. The positive sample of these k - 1 query item training texts is this search record: Online system response time requirement.
[0134] According to the embodiments of the present disclosure, negative samples of the query item training text also need to be constructed. For each query item training text, a phrase whose prefix and the first word are not repeated is randomly selected from the candidate set, and this phrase is used as the negative sample of the query item. For example, for the query item: Onlin, the negative sample randomly selected from the candidate set can be: Business transaction volume growth rate, or Data security level and access control, or System batch processing time requirement, or System confidentiality and security requirement, etc.
[0135] In this way, after word segmentation of a search record, k words are obtained. Then, for this search record, k - 1 positive samples and k - 1 negative samples can be derived, a total of 2k - 2 training samples. An appropriate number of historical search records are selected from the candidate set to construct the training sample set.
[0136] After the training samples are constructed, model training is performed. The two - tower recommendation model is a two - tower structure. The bottom - layer input of the left tower is the pre - processed query item, and the bottom - layer text input of the right tower is a complete search record, which is the positive sample or negative sample of the query item. Specifically:
[0137] In operation S402, the query item training text is input into the left - tower side network of the two - tower recommendation model to be trained, so as to output the first training vector of the query item text through the left - tower side network to be trained.
[0138] In operation S403, the positive sample of the query item training text and the negative sample of the query item training text are input into the right - tower side network of the two - tower recommendation model to be trained, so as to output the second training vectors of the positive sample and the negative sample through the right - tower side network to be trained.
[0139] In operation S404, the similarity between the first training vector and the second training vector is calculated; positive samples represent a match with a similarity of 1, and negative samples represent a mismatch with a similarity of 0.
[0140] In operation S405, if the similarity between the first training vector and the second training vector meets the preset termination condition, the trained dual-tower recommendation model is obtained.
[0141] According to embodiments of this disclosure, a dual-tower recommendation model is trained using positive and negative samples. An index list is constructed using the right tower of the trained model, and the vector output from the left tower is used for retrieval within the index. The semantic vector can be used to retrieve words / sentences from the semantic index list that are semantically similar to the query text. The query vector can be used to retrieve words / sentences from the matching index list that closely match the prefix of the query text. In the process of applying the model to recommend dropdown phrases, the recommended phrases provided by the dropdown list consider both prefix matching and semantic matching, resulting in higher recommendation accuracy. This allows for better retrieval of similar content but different keywords, solving the technical problem of unsatisfactory dropdown list search recommendation effects in related technologies, meeting user search needs, and improving user experience.
[0142] Based on the above-described method for recommending drop-down phrases in a search box, this disclosure also provides a device for recommending drop-down phrases in a search box. Figure 5 A schematic block diagram of a search box drop-down phrase recommendation device according to an embodiment of the present disclosure is shown.
[0143] like Figure 5 As shown, the search box drop-down phrase recommendation device 500 of this embodiment includes an acquisition module 501, an input / output module 502, a first determination module 503, a second determination module 504, and a recommendation module 505.
[0144] The acquisition module 501 is used to acquire the query item text, which is associated with the query text entered by the target user in the search box.
[0145] The input / output module 502 is used to input the query text into the left tower side network of the dual-tower recommendation model, so as to output the semantic vector and query vector of the query text through different layers of the left tower side network respectively.
[0146] The first determining module 503 is used to determine and query the first type of recommended phrases that semantically match the text by using semantic vectors and a pre-built list of semantic indexes.
[0147] The second determining module 504 is used to determine the second type of recommended phrase that matches the prefix of the query text using the query vector and a pre-built matching index list. The semantic index list and the matching index list are constructed using different layers of the right tower side network of the dual-tower recommendation model based on multiple historical search records of historical users within a preset historical time period.
[0148] The recommendation module 505 is used to recommend first-type and second-type recommendation phrases to target users, wherein the first-type and second-type recommendation phrases are used to generate business requirement documents.
[0149] According to embodiments of this disclosure, the input / output module 502 utilizes the semantic vector and query vector output from the left-side network of the dual-tower recommendation model. The first determining module 503 and the second determining module 504 then use the output vectors from different layers of the right-side network to construct a semantic index list and a matching index list for retrieval and matching. The semantic vector is used to retrieve semantically matching phrases from the semantic index list, and the query vector is used to retrieve phrases with relatively matching prefixes from the matching index list. Through this device, when a requirement officer searches for a requirement document, the document system continuously captures the input of the current search term and requests the recommendation system, thereby completing real-time dynamic recommendation of dropdown words in the requirement document search. The recommended phrases given in the dropdown list consider both prefix matching and semantic matching, resulting in higher recommendation accuracy. This allows requirement documents with similar content but different keywords to be better retrieved, solving the technical problem of unsatisfactory dropdown list search recommendation effects in related technologies, meeting user search needs, improving user experience, and facilitating business personnel to write business requirement documents more quickly and efficiently.
[0150] According to an embodiment of this disclosure, the left tower side network includes a first left-side network layer and a second left-side network layer connected in sequence, and the input / output module includes a first input / output unit and a second input / output unit.
[0151] The first input-output unit is used to input the query text into the first left network layer so as to output the semantic vector of the query text through the first left network layer.
[0152] The second input / output unit is used to input the semantic vector of the query item text into the second left network layer, so as to output the query vector of the query item text through the second left network layer.
[0153] According to an embodiment of this disclosure, the right tower side network includes a first right-side network layer and a second right-side network layer connected in sequence.
[0154] The aforementioned device further includes a first construction module for constructing a semantic index list, wherein the first construction module includes a first acquisition unit, a third input / output unit, and a first combination unit.
[0155] The first acquisition unit is used to acquire multiple historical search records of historical users within a preset historical time period. The multiple historical search records include multiple historical candidate phrases used to generate historical business requirement documents.
[0156] The third input / output unit is used to input multiple historical candidate phrases into the first right-side network layer, so as to output multiple first candidate vectors associated with the multiple historical candidate phrases through the first right-side network layer;
[0157] The first combination unit is used to combine multiple first candidate vectors and multiple historical candidate phrases into pairs to form multiple semantic index pairs, wherein the multiple semantic index pairs constitute a semantic index list.
[0158] According to an embodiment of this disclosure, the apparatus further includes a second construction module for constructing a matching index list, wherein the second construction module includes a fourth input / output unit and a second combination unit.
[0159] The fourth input-output unit is used to input multiple first candidate vectors into the second right-side network layer, so as to output multiple second candidate vectors associated with multiple historical candidate phrases through the second right-side network layer.
[0160] The second combination unit is used to combine multiple second candidate vectors and multiple historical candidate phrases in pairs to form multiple matching index pairs, wherein the multiple matching index pairs constitute a matching index list.
[0161] According to embodiments of this disclosure, the second determining module includes a determining unit and an extraction unit.
[0162] The determining unit is used to determine the target matching index pair from multiple matching index pairs in the matching index list, wherein the target second candidate vector in the target matching index pair and the query vector satisfy a preset similarity condition.
[0163] The extraction unit is used to extract target historical candidate phrases from the target matching index pairs as second-class recommended phrases.
[0164] According to embodiments of this disclosure, the determining unit includes a determining subunit for determining a target matching index pair from a plurality of matching index pairs in a matching index list using a predetermined retrieval tool.
[0165] According to embodiments of this disclosure, the above-described apparatus further includes a training module for training a dual-tower recommendation model, wherein the training module includes a second acquisition unit, a fifth input-output unit, a sixth input-output unit, a calculation unit, and an iteration unit.
[0166] The second acquisition unit is used to acquire query training text, positive samples of query training text, and negative samples of query training text. The query training text is associated with the historical query text entered by the historical user in the search box, and the positive and negative samples are associated with multiple historical search records of the historical user within a preset historical time period.
[0167] The fifth input / output unit is used to input the query training text into the left tower side network of the dual-tower recommendation model to be trained, so as to output the first training vector of the query text through the left tower side network to be trained.
[0168] The sixth input / output unit is used to input the positive samples and negative samples of the query training text into the right tower side network of the dual-tower recommendation model to be trained, so as to output the second training vector of the positive and negative samples through the right tower side network to be trained.
[0169] A calculation unit is used to calculate the similarity between the first training vector and the second training vector;
[0170] An iterative unit is used to obtain the trained dual-tower recommendation model when the similarity between the first training vector and the second training vector meets a preset termination condition.
[0171] According to embodiments of this disclosure, any multiple modules among the acquisition module 501, input / output module 502, first determination module 503, second determination module 504, and recommendation module 505 can be combined into one module, or any one of these modules can be split into multiple modules. Alternatively, at least some of the functions of one or more of these modules can be combined with at least some of the functions of other modules and implemented in one module. According to embodiments of this disclosure, at least one of the acquisition module 501, input / output module 502, first determination module 503, second determination module 504, and recommendation module 505 can be at least partially implemented as hardware circuitry, such as a field-programmable gate array (FPGA), a programmable logic array (PLA), a system-on-a-chip, a system-on-a-substrate, a system-on-package, an application-specific integrated circuit (ASIC), or implemented in hardware or firmware by any other reasonable means of integrating or packaging the circuitry, or implemented in any one of the three implementation methods of software, hardware, and firmware, or in a suitable combination of any of these. Alternatively, at least one of the acquisition module 501, input / output module 502, first determination module 503, second determination module 504, and recommendation module 505 can be implemented at least partially as a computer program module, which can perform corresponding functions when the computer program module is run.
[0172] Figure 6A block diagram schematically illustrates an electronic device suitable for implementing a search box dropdown phrase recommendation method according to an embodiment of the present disclosure.
[0173] like Figure 6 As shown, an electronic device 600 according to an embodiment of this disclosure includes a processor 601, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 602 or a program loaded from a storage portion 608 into a random access memory (RAM) 603. The processor 601 may include, for example, a general-purpose microprocessor (e.g., a CPU), an instruction set processor and / or an associated chipset and / or a special-purpose microprocessor (e.g., an application-specific integrated circuit (ASIC)), etc. The processor 601 may also include onboard memory for caching purposes. The processor 601 may include a single processing unit or multiple processing units for performing different actions of the method flow according to an embodiment of this disclosure.
[0174] RAM 603 stores various programs and data required for the operation of electronic device 600. Processor 601, ROM 602, and RAM 603 are interconnected via bus 604. Processor 601 performs various operations of the method flow according to embodiments of the present disclosure by executing programs in ROM 602 and / or RAM 603. It should be noted that the programs may also be stored in one or more memories other than ROM 602 and RAM 603. Processor 601 may also perform various operations of the method flow according to embodiments of the present disclosure by executing programs stored in said one or more memories.
[0175] According to embodiments of this disclosure, the electronic device 600 may further include an input / output (I / O) interface 605, which is also connected to a bus 604. The electronic device 600 may also include one or more of the following components connected to the I / O interface 605: an input section 606 including a keyboard, mouse, etc.; an output section 607 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 608 including a hard disk, etc.; and a communication section 609 including a network interface card such as a LAN card, modem, etc. The communication section 609 performs communication processing via a network such as the Internet. A drive 610 is also connected to the I / O interface 605 as needed. A removable medium 611, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed on the drive 610 as needed so that computer programs read from it can be installed into the storage section 608 as needed.
[0176] This disclosure also provides a computer-readable storage medium, which may be included in the device / apparatus / system described in the above embodiments; or it may exist independently and not assembled into the device / apparatus / system. The computer-readable storage medium carries one or more programs that, when executed, implement the method according to the embodiments of this disclosure.
[0177] According to embodiments of this disclosure, the computer-readable storage medium may be a non-volatile computer-readable storage medium, such as including, but not limited to: portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof. In this disclosure, the computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. For example, according to embodiments of this disclosure, the computer-readable storage medium may include ROM 602 and / or RAM 603 and / or one or more memories other than ROM 602 and RAM 603 described above.
[0178] Embodiments of this disclosure also include a computer program product comprising a computer program containing program code for performing the methods shown in the flowchart. When the computer program product is run on a computer system, the program code enables the computer system to implement the search box dropdown phrase recommendation method provided in embodiments of this disclosure.
[0179] When the computer program is executed by the processor 601, it performs the functions defined in the system / apparatus of this disclosure embodiments. According to embodiments of this disclosure, the systems, apparatuses, modules, units, etc., described above can be implemented by computer program modules.
[0180] In one embodiment, the computer program may rely on a tangible storage medium such as an optical storage device or a magnetic storage device. In another embodiment, the computer program may also be transmitted and distributed in the form of signals over a network medium, and downloaded and installed via the communication section 609, and / or installed from the removable medium 611. The program code contained in the computer program can be transmitted using any suitable network medium, including but not limited to: wireless, wired, etc., or any suitable combination thereof.
[0181] In such an embodiment, the computer program can be downloaded and installed from a network via the communication section 609, and / or installed from the removable medium 611. When the computer program is executed by the processor 601, it performs the functions defined in the system of this disclosure embodiment. According to embodiments of this disclosure, the systems, devices, apparatuses, modules, units, etc., described above can be implemented by computer program modules.
[0182] According to embodiments of this disclosure, program code for executing the computer programs provided in embodiments of this disclosure can be written in any combination of one or more programming languages. Specifically, these computational programs can be implemented using high-level procedural and / or object-oriented programming languages, and / or assembly / machine languages. Programming languages include, but are not limited to, languages such as Java, C++, Python, "C", or similar programming languages. The program code can execute entirely on the user's computing device, partially on the user's device, partially on a remote computing device, or entirely on a remote computing device or server. In cases involving remote computing devices, the remote computing device can be connected to the user's computing device via any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computing device (e.g., via the Internet using an Internet service provider).
[0183] 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 disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing 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.
[0184] Those skilled in the art will understand that the features described in the various embodiments and / or claims of this disclosure can be combined or combined in various ways, even if such combinations or combinations are not explicitly described in this disclosure. In particular, the features described in the various embodiments and / or claims of this disclosure can be combined or combined in various ways without departing from the spirit and teachings of this disclosure. All such combinations and / or combinations fall within the scope of this disclosure.
[0185] The embodiments of this disclosure have been described above. However, these embodiments are for illustrative purposes only and are not intended to limit the scope of this disclosure. Although various embodiments have been described above, this does not mean that the measures in the various embodiments cannot be used advantageously in combination. The scope of this disclosure is defined by the appended claims and their equivalents. Various substitutions and modifications can be made by those skilled in the art without departing from the scope of this disclosure, and all such substitutions and modifications should fall within the scope of this disclosure.
Claims
1. A method for recommending phrases in a search box dropdown menu, comprising: Obtain the query text, wherein the query text is associated with the query text entered by the target user in the search box; The query text is input into the left tower side network of the dual-tower recommendation model, so that the semantic vector and query vector of the query text are output through different layers of the left tower side network respectively. Using the semantic vector and a pre-built list of semantic indexes, a first category of recommended phrases that semantically match the query text are determined; Using the query vector and a pre-built matching index list, a second type of recommended phrase that matches the prefix of the query text is determined. The semantic index list and the matching index list are respectively constructed using different layers of the right tower side network of the dual-tower recommendation model, based on multiple historical search records of historical users within a preset historical time period. The first type of recommended phrase and the second type of recommended phrase are recommended to the target user, wherein the first type of recommended phrase and the second type of recommended phrase are used to generate a business requirement document; The right tower side network comprises a first right network layer and a second right network layer connected in sequence. The semantic index list is constructed by the following method: obtaining multiple historical search records of historical users within a preset historical time period, the multiple historical search records including multiple historical candidate phrases used to generate historical business requirement documents; inputting the multiple historical candidate phrases into the first right network layer to output multiple first candidate vectors associated with the multiple historical candidate phrases; combining the multiple first candidate vectors and the multiple historical candidate phrases in pairs to form multiple semantic index pairs, wherein the multiple semantic index pairs constitute a semantic index list. The matching index list is constructed by the following method: inputting multiple first candidate vectors into the second right-hand network layer, so that the second right-hand network layer outputs multiple second candidate vectors associated with multiple historical candidate phrases; combining multiple second candidate vectors and multiple historical candidate phrases in pairs to form multiple matching index pairs, wherein the multiple matching index pairs constitute the matching index list.
2. The method according to claim 1, wherein, The left-side network comprises a first left-side network layer and a second left-side network layer connected in sequence. The step of outputting the semantic vector and query vector of the query item text through different layers of the left-side network includes: The query text is input into the first left network layer to output the semantic vector of the query text through the first left network layer; The semantic vector of the query text is input into the second left network layer to output the query vector of the query text through the second left network layer.
3. The method according to claim 1, wherein, Using the query vector and a pre-built list of matching indexes, the second category of recommended phrases that match the prefix of the query text includes: A target matching index pair is determined from the plurality of matching index pairs in the matching index list, wherein the target second candidate vector in the target matching index pair and the query vector satisfy a preset similarity condition; Extract the target historical candidate phrases from the target matching index pairs and use them as the second type of recommended phrases.
4. The method according to claim 3, wherein, Determining the target matching index pair from the plurality of matching index pairs in the matching index list includes: Using a predefined retrieval tool, a target matching index pair is determined from the plurality of matching index pairs in the matching index list.
5. The method according to claim 1, wherein, The dual-tower recommendation model was trained using the following method: Obtain query training text, positive samples of the query training text, and negative samples of the query training text, wherein the query training text is associated with the historical query text entered by the historical user in the search box, and the positive samples and the negative samples are associated with multiple historical search records of the historical user within a preset historical time period; The query training text is input into the left tower side network of the dual-tower recommendation model to be trained, so as to output the first training vector of the query text through the left tower side network to be trained. The positive samples and negative samples of the query training text are input into the right tower side network of the dual-tower recommendation model to be trained, so as to output the second training vector of the positive samples and the negative samples through the right tower side network to be trained. Calculate the similarity between the first training vector and the second training vector; If the similarity between the first training vector and the second training vector meets the preset termination condition, the trained dual-tower recommendation model is obtained.
6. A search box dropdown phrase recommendation device, comprising: The acquisition module is used to acquire the query item text, wherein the query item text is associated with the query text entered by the target user in the search box; The input / output module is used to input the query text into the left tower side network of the dual-tower recommendation model, so as to output the semantic vector and query vector of the query text through different layers of the left tower side network respectively; The first determining module is used to determine a first type of recommended phrase that semantically matches the query text by using the semantic vector and a pre-built list of semantic indexes. The second determining module is used to determine a second type of recommended phrase that matches the prefix of the query text using the query vector and a pre-built matching index list. The semantic index list and the matching index list are respectively constructed using different layers of the right tower side network of the dual-tower recommendation model based on multiple historical search records of historical users within a preset historical time period. The recommendation module is used to recommend the first type of recommended phrases and the second type of recommended phrases to the target user, wherein the first type of recommended phrases and the second type of recommended phrases are used to generate a business requirement document; The right tower side network comprises a first right network layer and a second right network layer connected in sequence. The semantic index list is constructed by the following method: obtaining multiple historical search records of historical users within a preset historical time period, the multiple historical search records including multiple historical candidate phrases used to generate historical business requirement documents; inputting the multiple historical candidate phrases into the first right network layer to output multiple first candidate vectors associated with the multiple historical candidate phrases; combining the multiple first candidate vectors and the multiple historical candidate phrases in pairs to form multiple semantic index pairs, wherein the multiple semantic index pairs constitute a semantic index list. The matching index list is constructed by the following method: inputting multiple first candidate vectors into the second right-hand network layer, so that the second right-hand network layer outputs multiple second candidate vectors associated with multiple historical candidate phrases; combining multiple second candidate vectors and multiple historical candidate phrases in pairs to form multiple matching index pairs, wherein the multiple matching index pairs constitute the matching index list.
7. An electronic device, comprising: One or more processors; Storage device for storing one or more programs. Wherein, when the one or more programs are executed by the one or more processors, the one or more processors perform the method according to any one of claims 1 to 5.
8. A computer-readable storage medium having executable instructions stored thereon, which, when executed by a processor, cause the processor to perform the method according to any one of claims 1 to 5.
9. A computer program product comprising a computer program that, when executed by a processor, implements the method according to any one of claims 1 to 5.
Citation Information
Patent Citations
Providing query suggestions
CN102142017A
Method and device for training personalized semantic vector model in search engine
CN113010771A