Method and device for obtaining recommended menu
By using BERT model and multiple recall technology in large information management systems, combined with click-through rate model, we will build a recommended menu system, which solves the problem that users find the menus of required function quickly, and improves usage efficiency and experience.
Patent Information
- Application Number
- CN202510074784.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-17
- Publication Date
- 2025-05-16
AI Technical Summary
In large information management systems, it is difficult for users to quickly find the required functional menus, resulting in high learning costs and poor user experience.
By training the BERT model to extract semantic features, combining multiple recall technology and click-through rate model, a recommendation menu system is built to help users quickly find the menus of required function.
It reduces the learning cost of users using the system and improves the efficiency and experience of users in large-scale information management systems.
Smart Images

Figure CN120011538A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of retrieval, and in particular to a method and device for obtaining a recommended menu. Background Art
[0002] Nowadays, management information systems are widely used in the information management of enterprises and institutions. For example, take the Academia Resource Planning system of the Chinese Academy of Sciences. The system includes business processing modules such as scientific research projects, human resources, comprehensive finance, and scientific research conditions, and provides a large number of specific application services, with a total of more than 1,800 function menus. Moreover, with the continuous updating of business and management needs, new functions can be continuously added to the system, so that the number of function menus can gradually increase. A large number of function menus makes it difficult for users to quickly master existing functions and become familiar with new functions, and the learning cost of users using the system increases sharply. Therefore, quickly retrieving menus from large-scale information management systems has become an urgent task.
[0003] Therefore, a method and device for obtaining a recommended menu are needed. Summary of the invention
[0004] The purpose of the present invention is to provide a method for obtaining a recommended menu, an electronic device and a computer storage medium, which can help users find the function menu they want to obtain more efficiently through more intelligent semantic recognition and multi-way recall merging technology, reduce the learning cost of users using the system, and thus improve the overall user experience.
[0005] In a first aspect, a method for obtaining a recommended menu is provided, comprising:
[0006] Obtain multiple menus of a target application, functional descriptions of the menus, and a first BERT model;
[0007] The function description is used as a training sample, and the menu is used as a training label corresponding to the training sample, and the first BERT model is trained to obtain a second BERT model, wherein the second BERT model is used to output a recommended menu according to the input function description; according to the function description of the menu, a generation question corresponding to the menu is generated through a preset question generation model, and the first semantic features of the function description and the generation question are extracted through the second BERT model and saved in a preset vector database; the menu, the function description and the generation question are stored in a preset document database, the menu, the function description and the generation question are segmented, and an inverted index is constructed according to the first segmentation result obtained;
[0008] Acquire input information of a first user, and obtain K first predicted menus corresponding to the input information through the second BERT model; extract a second semantic feature of the input information through the second BERT model, and determine K second predicted menus corresponding to the input information based on the second semantic feature and the first semantic feature stored in the vector database; perform word segmentation on the input information, and retrieve K third predicted menus corresponding to the input information from the document database based on the obtained second word segmentation result;
[0009] N recommended menus are determined based on the K first predicted menus, the K second predicted menus, the K third predicted menus, and the user information of the first user.
[0010] Specifically, determining N recommended menus according to the K first predicted menus, the K second predicted menus, the K third predicted menus, and the user information of the first user includes:
[0011] A candidate menu set is constructed for the K first predicted menus, the K second predicted menus, and the K third predicted menus. The candidate menu set is reordered using a pre-trained click-through rate model, and a second candidate set of less than 3K menus is determined based on the sorting results. The first N menus in the second candidate set are displayed on the user interface.
[0012] Specifically, the pre-training method of the click rate model includes:
[0013] A deep cross-network attention model for predicting the first user's menu-clicking operation is trained based on the user information. When the first user logs into the target application and inputs information, the input information is cleaned and the validity of the input is verified. The candidate menu set and the user information are input into the deep cross-network attention model. The deep cross-network attention model scores the possibility of the first user clicking on the candidate menu set and re-sorts the menus. Menus with higher scores are ranked higher.
[0014] Specifically, the user information includes: the age, gender, and job position information of the first user, the search content of the first user, and the menu information clicked after the search.
[0015] Preferably, the score is calculated as follows:
[0016] Score = CTR (α * S 1 +β*S 2 +γ*S 3 )
[0017] Among them, Score is the menu score, S 1 represents the similarity score of the first predicted menu, S2 represents the similarity score of the second predicted menu, S 3 represents the similarity score of the third predicted menu, CTR represents the click rate model, α, β, γ are weight coefficients and satisfy α+β+γ=1.
[0018] Preferably, the question generation model is a sequence-to-sequence model.
[0019] In a second aspect, a device for obtaining a recommended menu is provided, comprising:
[0020] An acquisition unit configured to acquire a plurality of menus of a target application, functional descriptions of the menus, and a first BERT model;
[0021] The preparation unit is configured to use the function description as a training sample and the menu as a training label corresponding to the training sample to train the first BERT model to obtain a second BERT model, wherein the second BERT model is used to output a recommended menu according to the input function description; generate a generation question corresponding to the menu according to the function description of the menu through a preset question generation model, extract first semantic features of the function description and the generation question through the second BERT model, and save them in a preset vector database; store the menu, the function description, and the generation question in a preset document database, perform word segmentation on the menu, the function description, and the generation question, and construct an inverted index according to the obtained first word segmentation result;
[0022] The prediction unit is configured to obtain input information of a first user, obtain K first prediction menus corresponding to the input information through the second BERT model; extract a second semantic feature of the input information through the second BERT model, and determine the K second prediction menus corresponding to the input information according to the second semantic feature and the first semantic feature stored in the vector database; perform word segmentation on the input information, and retrieve K third prediction menus corresponding to the input information from the document database according to the obtained second word segmentation result;
[0023] The determination unit is configured to determine N recommended menus based on the K first predicted menus, the K second predicted menus, the K third predicted menus, and the user information of the first user.
[0024] According to a third aspect, an electronic device is provided, comprising: a processor, a memory, and computer program instructions stored in the memory and executable on the processor, wherein the processor is used to implement the method described in the first aspect when executing the computer program instructions.
[0025] According to a fourth aspect, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer-executable instructions, and when the computer-executable instructions are executed by a processor, they are used to implement the method described in the first aspect.
[0026] Compared with the prior art, the present invention has the following advantages: the present invention combines the advantages of multiple search methods, and users only need to enter the content they need in the search box, and various forms of text input will be able to match the corresponding function menu. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] Figure 1 A flowchart of a method for obtaining a recommended menu provided by an embodiment of the present invention;
[0028] Figure 2 A structural diagram of a device for obtaining a recommended menu provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0029] The technical solution of the present invention is further described in detail below through the accompanying drawings and embodiments.
[0030] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be described below in conjunction with the accompanying drawings. It should be noted that similar reference numerals and letters represent similar items in the following drawings, so once an item is defined in one drawing, it does not need to be further defined and explained in the subsequent drawings.
[0031] In the description of the embodiments of the present invention, words such as "exemplary", "for example" or "for example" are used to indicate examples, illustrations or explanations. Any embodiment or design described as "exemplary", "for example" or "for example" in the embodiments of the present invention should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary", "for example" or "for example" is intended to present related concepts in a concrete way.
[0032] In large-scale management information systems, there is a common phenomenon called the "long tail problem". Specifically, the system contains a large number of function menus, but only a few of them are used very frequently. These function menus are the core part of users' daily operations, so users are very familiar with them. However, for a large number of other function menus in the system, users use them relatively less frequently. These function menus may be unfamiliar to users or even completely unknown to users due to reasons such as infrequent use, high complexity, unintuitive user interfaces, or lack of effective guidance paths. This long tail problem not only increases the learning cost of users, but also makes it difficult for them to quickly find the functions they need in the face of such a large number of function menus, thus affecting the overall efficiency of the system and user experience.
[0033] In the prior art, traditional search methods mainly rely on SQL queries or querying by indexing through ElasticSearch (ES). The core of these methods is to match keywords entered by users or their segmented forms with existing function menus in the database. However, the effectiveness of this method is highly dependent on the user's familiarity with the existing functions of the system, a clear understanding of the functions they need, and prior knowledge of the names of new functions. Only when these prerequisites are met can users accurately enter the desired function name in the search box and quickly navigate to the relevant function menu.
[0034] However, this method has a high cost for users to use the system, especially for users who are not familiar with the system or use functions that are not frequently used, it is often difficult for users to accurately enter the function name. This makes it difficult for this retrieval method to accurately enter the function name when faced with a large number of function menus in a large information management system. This makes it difficult for this retrieval method to help users quickly find the required functions when faced with a large number of function menus in a large information management system, and thus it is difficult to cope with the challenges faced by users when using large information management systems.
[0035] Therefore, in order to improve the retrieval success rate and reduce user usage costs, we urgently need to introduce a method and device for obtaining recommended menus. This method will extract semantic features by training the BERT model and store them in the vector database, store menu information in the document database and build an inverted index, obtain K first predicted menus through the BERT model, extract the semantic features of the input information and the features of the vector database to determine the K second predicted menus, segment the input information to retrieve K third predicted menus from the document database, and finally determine N recommended menus based on the three predicted menus and user information.
[0036] Figure 1 A flowchart of a method for obtaining a recommended menu provided by an embodiment of the present invention. Figure 1 As shown, the method comprises at least the following steps:
[0037] S101: Obtain multiple menus of a target application, functional descriptions of the menus, and a first BERT model.
[0038] In different embodiments, the target application may be a specific software or system used for different specific businesses or purposes. In one embodiment, the description content of the function menu may be obtained, for example, through business experts, to determine a natural language description of no less than one sentence for each function menu, and each function menu corresponds to a sentence description. Then, for example, create data set 1: function menu-function description data set. Exemplary: "Reimbursement-You can reimburse taxi fares.", "Reimbursement-You can reimburse XX project." In one example, data set 1 can also be cleaned, stop words deleted, etc., to improve the accuracy of the description of each function point and reduce its redundancy.
[0039] The BERT (Bidirectional Encoder Representations from Transformers) model is a pre-trained language model. The Transformer architecture is the core of BERT, which is mainly composed of a multi-head attention mechanism and a feed-forward neural network. The multi-head attention mechanism allows the model to focus on different parts of the input sequence at the same time, which can effectively capture the semantic relationship in the sentence. The feed-forward neural network is used to perform nonlinear transformations on the information processed by the attention mechanism.
[0040] S102: Use the function description as a training sample and the menu as a training label corresponding to the training sample to train the first BERT model to obtain a second BERT model, wherein the second BERT model is used to output a recommended menu according to the input function description; generate a generation question corresponding to the menu according to the function description of the menu through a preset question generation model, extract first semantic features of the function description and the generation question through the second BERT model, and save them in a preset vector database; store the menu, the function description and the generation question in a preset document database, segment the menu, the function description and the generation question, and construct an inverted index according to the first segmentation result obtained.
[0041] In different embodiments, the specific method of question generation may be different. In a specific embodiment, the question may be generated through a sequence-to-sequence (Seq2Seq, Sequence-to-Sequence) model.
[0042] For example, based on the above dataset 1, extract the function description as the answer, use the Seq2Seq (Sequence-to-Sequence) model to generate questions, and establish dataset 2: the corresponding dataset of menu-description-question; the sequence-to-sequence (Seq2Seq) model is a deep learning architecture that is mainly used to handle the task of converting one sequence data into another sequence data, usually consisting of an encoder and a decoder. The encoder encodes the input text into a vector of fixed length, and the decoder generates questions based on this vector. The system uses dataset 2 as the corpus, uses the pre-trained BERT model to extract semantics from it, and stores the semantic embedding in the Faiss (Facebook AI Similarity Search) vector database for subsequent queries. The above dataset 2 is segmented and stored in the Elastic Search (ES) database to establish an inverted index of description-menu function.
[0043] S103: Obtain input information of the first user, and obtain K first prediction menus corresponding to the input information through the second BERT model; extract the second semantic feature of the input information through the second BERT model, and determine the K second prediction menus corresponding to the input information based on the second semantic feature and the first semantic feature stored in the vector database; perform word segmentation on the input information, and retrieve K third prediction menus corresponding to the input information from the document database based on the obtained second word segmentation result.
[0044] For example, the system obtains the predicted menu results through three-way recall. First recall: The system uses the BERT-trained model to classify the input according to the function description input by the user, and obtains K predicted output menu contents. Second recall: The user input content is semantically extracted through the BERT model, and matched with the content in the Faiss (Facebook AI Simi laritySearch) database to obtain the K output menu contents with the highest similarity. Third recall: The input information is segmented, and the second segmentation result is obtained. Exemplarily, the user enters "reimbursement of expenses", and after the content is segmented into "reimbursement" and "expenses", it goes to the Elastic Search (ES) database for precise matching, and returns K output menu contents.
[0045] S104: Determine N recommended menus according to the K first predicted menus, the K second predicted menus, the K third predicted menus, and the user information of the first user.
[0046] In one embodiment, N recommended menus are determined based on the K first predicted menus, the K second predicted menus, the K third predicted menus, and the user information of the first user, including: constructing a candidate menu set for the K first predicted menus, the K second predicted menus, and the K third predicted menus, reordering the candidate menu set using a pre-trained click-through rate model, determining a second candidate set of less than 3K menus based on the ordering results, and displaying the first N menus in the second candidate set on the user interface.
[0047] In one embodiment, the pre-training method of the click rate model includes: training a deep cross-network attention model for predicting a first user's menu click operation based on the user information; when the first user logs into the target application and inputs information, cleaning the input information and verifying the validity of the input; inputting the candidate menu set and the user information into the deep cross-network attention model; the deep cross-network attention model scores the likelihood of the first user clicking on the candidate menu set and re-ranks the menus, with menus with higher scores being ranked higher.
[0048] In one embodiment, the user information includes: the age, gender, and job position information of the first user, the search content of the first user, and the menu information clicked after the search.
[0049] In one embodiment, the score is calculated as follows:
[0050] Score = CTR (α * S 1 +β*S 2 +γ*S 3 )
[0051] Among them, Score is the menu score, S 1 represents the similarity score of the first predicted menu, S 2 represents the similarity score of the second predicted menu, S 3 represents the similarity score of the third predicted menu, CTR represents the click rate model, α, β, γ are weight coefficients and satisfy α+β+γ=1.
[0052] In a specific embodiment, for example, the user's click data can be obtained from the target application log and cleaned so that the user identifier (USER_ID) corresponds to the user's click operation. Obtain user information, including but not limited to age, gender, and position information; create data set 3: USER_ID-operation-user information data set. Use data set 3 to train a DeepCross Network Attention binary classification model (user click is 1, no click is 0) to predict the user's menu click operation. Vote for the content returned by the above three channels to generate a candidate set of less than 3K menus with order. When the user logs in to the system and searches, the user's input information is first cleaned and verified to be valid input. The model receives the user's basic information and the candidate set information after the three-way recall is merged. This information is input into the model for prediction, and the user's behavior is scored for click probability. The higher the score, the higher the ranking of the menu, where the score is calculated as follows:
[0053] Score = CTR (α * S 1 +β*S 2 +γ*S 3 )
[0054] Among them, Score is the menu score, S 1 represents the similarity score of the first predicted menu, S 2 represents the similarity score of the second predicted menu, S 3 represents the similarity score of the third predicted menu, CTR represents the click-through rate model, α, β, γ are weight coefficients and satisfy α+β+γ=1; the CTR model of user click data is used to reorder the three-way returns to generate a menu candidate set of less than 3K, and finally returns a refined list of, for example, the top 5 most likely menus for the user to choose.
[0055] According to yet another embodiment, a device for acquiring a recommended menu is provided. Figure 2 A structural diagram of a device for obtaining a recommended menu provided by an embodiment of the present invention, such as Figure 2 As shown, the device 200 includes:
[0056] An acquisition unit 201 is configured to acquire multiple menus of a target application, function descriptions of the menus, and a first BERT model;
[0057] The preparation unit 202 is configured to train the first BERT model using the function description as a training sample and the menu as a training label corresponding to the training sample to obtain a second BERT model, wherein the second BERT model is used to output a recommended menu according to the input function description; generate a generated question corresponding to the menu according to the function description of the menu through a preset question generation model, extract first semantic features of the function description and the generated question through the second BERT model, and save them in a preset vector database; store the menu, the function description, and the generated question in a preset document database, perform word segmentation on the menu, the function description, and the generated question, and construct an inverted index according to the obtained first word segmentation result;
[0058] The prediction unit 203 is configured to obtain input information of the first user, and obtain K first prediction menus corresponding to the input information through the second BERT model; extract a second semantic feature of the input information through the second BERT model, and determine the K second prediction menus corresponding to the input information according to the second semantic feature and the first semantic feature stored in the vector database; perform word segmentation on the input information, and retrieve K third prediction menus corresponding to the input information from the document database according to the obtained second word segmentation result;
[0059] The determination unit 204 is configured to determine N recommended menus according to the K first predicted menus, the K second predicted menus, the K third predicted menus, and the user information of the first user.
[0060] It is understood that the method steps in the embodiments of the present invention can be implemented by hardware or by a processor executing software instructions. The software instructions can be composed of corresponding software modules, and the software modules can be stored in random access memory (RAM), flash memory, read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), registers, hard disks, mobile hard disks, CD-ROMs, or any other form of storage medium known in the art. An exemplary storage medium is coupled to the processor so that the processor can read information from the storage medium and write information to the storage medium. Of course, the storage medium can also be a component of the processor. The processor and the storage medium can be located in an ASIC.
[0061] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented by software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present invention is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted through the computer-readable storage medium. The computer instructions can be transmitted from a website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server or data center that includes one or more available media integrated. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state disk (SSD)), etc.
[0062] The specific implementation methods described above further illustrate the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above description is only a specific implementation method of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.
Claims
1. A method for obtaining a recommended menu, comprising: Obtain multiple menus of a target application, functional descriptions of the menus, and a first BERT model; The function description is used as a training sample, and the menu is used as a training label corresponding to the training sample, to train the first BERT model to obtain a second BERT model, wherein the second BERT model is used to output a recommended menu according to the input function description; according to the function description of the menu, a generation question corresponding to the menu is generated by a preset question generation model, and the first semantic features of the function description and the generation question are extracted by the second BERT model, and are saved in a preset vector database; The menu, the function description and the generation question are stored in a preset document database, the menu, the function description and the generation question are segmented, and an inverted index is constructed according to the first segmentation result obtained; Acquire input information of a first user, and obtain K first predicted menus corresponding to the input information through the second BERT model; extract a second semantic feature of the input information through the second BERT model, and determine K second predicted menus corresponding to the input information based on the second semantic feature and the first semantic feature stored in the vector database; perform word segmentation on the input information, and retrieve K third predicted menus corresponding to the input information from the document database based on the obtained second word segmentation result; N recommended menus are determined based on the K first predicted menus, the K second predicted menus, the K third predicted menus, and the user information of the first user.
2. The method according to claim 1, wherein determining N recommended menus according to the K first predicted menus, the K second predicted menus, the K third predicted menus, and the user information of the first user comprises: A candidate menu set is constructed for the K first predicted menus, the K second predicted menus, and the K third predicted menus. The candidate menu set is reordered using a pre-trained click-through rate model, and a second candidate set of less than 3K menus is determined based on the sorting results. The first N menus in the second candidate set are displayed on the user interface.
3. The method according to claim 2, wherein the pre-training method of the click rate model comprises: A deep cross-network attention model for predicting the first user's menu-clicking operation is trained based on the user information. When the first user logs into the target application and inputs information, the input information is cleaned and the validity of the input is verified. The candidate menu set and the user information are input into the deep cross-network attention model. The deep cross-network attention model scores the possibility of the first user clicking on the candidate menu set and re-sorts the menus. Menus with higher scores are ranked higher.
4. The method according to claim 3, wherein: The user information includes: the age, gender, and job position of the first user, the search content of the first user, and the menu information clicked after the search.
5. The method according to claim 3, wherein: The score is calculated as follows: Score=CTR(α*S1+β*S2+γ*S3) Among them, Score is the menu score, S1 represents the similarity score of the first predicted menu, S2 represents the similarity score of the second predicted menu, S3 represents the similarity score of the third predicted menu, CTR represents the click-through rate model, α, β, γ are weight coefficients and satisfy α+β+γ=1.
6. The method according to claim 1, wherein: The question generation model is a sequence-to-sequence model.
7. A device for obtaining a recommended menu, comprising: An acquisition unit configured to acquire a plurality of menus of a target application, functional descriptions of the menus, and a first BERT model; The preparation unit is configured to use the function description as a training sample and the menu as a training label corresponding to the training sample to train the first BERT model to obtain a second BERT model, wherein the second BERT model is used to output a recommended menu according to the input function description; according to the function description of the menu, a generation question corresponding to the menu is generated by a preset question generation model, and the first semantic features of the function description and the generation question are extracted by the second BERT model, and stored in a preset vector database; The menu, the function description and the generation question are stored in a preset document database, the menu, the function description and the generation question are segmented, and an inverted index is constructed according to the first segmentation result obtained; The prediction unit is configured to obtain input information of a first user, obtain K first prediction menus corresponding to the input information through the second BERT model; extract a second semantic feature of the input information through the second BERT model, and determine the K second prediction menus corresponding to the input information according to the second semantic feature and the first semantic feature stored in the vector database; perform word segmentation on the input information, and retrieve K third prediction menus corresponding to the input information from the document database according to the obtained second word segmentation result; The determination unit is configured to determine N recommended menus based on the K first predicted menus, the K second predicted menus, the K third predicted menus, and the user information of the first user.
8. An electronic device comprising: A processor, a memory, and computer program instructions stored in the memory and executable on the processor, wherein the processor is used to implement the method according to any one of claims 1 to 6 when executing the computer program instructions.
9. A computer-readable storage medium, wherein: The computer-readable storage medium stores computer-executable instructions, which are used to implement the method according to any one of claims 1 to 6 when executed by a processor.