Sorting model training and sample data generation method, device and electronic device
By generating and using target sample data in the form of shorter keywords to train the ranking model, the problem of inaccurate intelligent prompts when users enter shorter keywords is solved, and accurate intelligent prompts are obtained when users enter shorter keywords. Improved search efficiency.
Patent Information
- Application Number
- CN202111436721.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-29
- Publication Date
- 2024-10-29
- Estimated Expiration
- 2041-11-29
AI Technical Summary
In the existing technology, when a user inputs a short keyword, the intelligent query keyword prompt is inaccurate, and the keyword that the user wishes to search cannot be returned in time.
By obtaining the keywords and true value keywords input by the user, it is judged whether there is a true value keyword in the previous word form before the input of the target keyword is completed, and it is used as the input of the ranking model to generate target sample data to train the ranking model. Use shorter keyword forms for model training to ensure that users can get accurate intelligent query keyword prompts when they enter shorter keywords.
It realizes the return of accurate query keyword intelligent prompts when users enter short keywords, improves the traffic diversion rate and query accuracy of the sorting model, and meets users' fast search needs.
Smart Images

Figure CN114238560B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data search technology, and in particular to methods, devices and electronic equipment for sorting model training and sample data generation. Background Art
[0002] Suggestion (intelligent suggestion for query keywords) refers to the predicted keywords that the user wants to search for, which are returned to the user based on the keywords entered by the user in the search box. For example Figure 1 As shown, the keyword entered by the user in the search box is "neural network", and the returned query keyword intelligent prompts are "neural network algorithm", "neural network model", "three major categories of neural network algorithms", "neural network principles", "neural network engine", etc.
[0003] In the prior art, the ranking model is trained using the keywords finally entered by the user in the search box and the true value keywords that the user wants to search for, thereby obtaining a pre-trained ranking model. In actual use, the pre-trained ranking model is used to analyze the keywords in the search box to obtain multiple predicted keywords, and the predicted keywords are ranked to obtain intelligent prompts for query keywords.
[0004] The inventors found in their research that in the sorting model obtained by the above method, accurate intelligent prompts for query keywords can only be obtained when the user enters a relatively complete keyword, and the intelligent prompts for query keywords are often inaccurate when the user enters a shorter keyword. For example, the keyword that the user wants to search for is "neural network principle", and when the user enters the shorter keyword "neuro" in the input box, the intelligent prompts for the query keywords are "symptoms of neurasthenia", "treatment methods for neurological tinnitus", etc. The intelligent prompts for the query keywords corresponding to "neuro" do not include "neural network algorithm principles" at all, and after the user enters "neural network", the keyword "neural network principle" ranked fourth in the returned query keyword intelligent prompts is the keyword that the user wants to search for. Therefore, how to obtain accurate intelligent prompts for query keywords when the user enters a shorter keyword has become a technical problem that needs to be solved urgently. Summary of the invention
[0005] The purpose of the embodiments of the present application is to provide a method, device and electronic device for ranking model training and sample data generation, so as to obtain accurate intelligent prompts for query keywords when a user inputs a relatively short keyword. The specific technical solution is as follows:
[0006] In a first aspect, an embodiment of the present application provides a ranking model training method, the method comprising:
[0007] Obtaining a user input keyword and a true value keyword, wherein the user input keyword is the keyword finally entered by the user in the input box, and the true value keyword is the keyword used by the user when triggering the search;
[0008] Using the user input keyword as the input of the ranking model, using the true value keyword as the true value calibration of the user input keyword, and obtaining the target sample data of the ranking model;
[0009] Determine whether the true value keyword exists in the recall result of the previous word form before the target keyword is input, wherein the initial target keyword is the user input keyword;
[0010] If it exists, the previous word form before the target keyword is input is used as the input of the sorting model, and the true value keyword is used as the true value calibration of the previous word form before the target keyword is input, to obtain the target sample data of the sorting model;
[0011] The target keyword is updated to the previous word form before the target keyword is input, and the execution step is returned to: determining whether the true value keyword exists in the recall result of the previous word form before the target keyword is input;
[0012] If it does not exist, end the addition of this target sample data;
[0013] The sorting model is trained using the target sample data.
[0014] In a possible implementation, if the target keyword exists, the previous word form before the target keyword is input is used as the input of the sorting model, and the true value keyword is used as the true value calibration of the previous word form before the target keyword is input, to obtain the target sample data of the sorting model, including:
[0015] If it exists, the previous word form before the target keyword is input is used as the input of the sorting model according to the preset probability value, and the true value keyword is used as the true value calibration of the previous word form before the target keyword is input, to obtain the target sample data of the sorting model.
[0016] In a possible implementation, if it exists, then according to a preset probability value, the previous word form before the target keyword is input is used as the input of the sorting model, and the true value keyword is used as the true value calibration of the previous word form before the target keyword is input, to obtain the target sample data of the sorting model, including:
[0017] If it exists, then get the target probability value a corresponding to the previous word form before the target keyword input is completed i , where a iThe target probability value corresponding to the i-th word form before the user completes the keyword input, 0≤a i ≤1, a i <a i-1 , a i-1 The target probability value corresponding to the i-1th word form before the user completes inputting the keyword;
[0018] With the target probability value a i To trigger the execution probability, the trigger execution takes the previous word form before the target keyword is input as the input of the sorting model, and takes the true value keyword as the true value calibration of the previous word form before the target keyword is input, to obtain the target sample data of the sorting model.
[0019] In a possible implementation manner, the target probability value a i To trigger the execution probability, the trigger execution uses the previous word form before the target keyword is input as the input of the sorting model, and uses the true value keyword as the true value calibration of the previous word form before the target keyword is input, to obtain the target sample data of the sorting model, including:
[0020] Randomly generate a number w from 1-100 and determine whether w% is greater than a i ;
[0021] If it is not greater than, the previous word form before the target keyword is input is used as the input of the sorting model, and the true value keyword is used as the true value calibration of the previous word form before the target keyword is input, so as to calculate the target probability value a. i Increase the target sample data of the sorting model.
[0022] In a second aspect, an embodiment of the present application provides a method for generating sample data of a ranking model, the method comprising:
[0023] Obtaining a user input keyword and a true value keyword, wherein the user input keyword is the keyword finally entered by the user in the input box, and the true value keyword is the keyword used by the user when triggering the search;
[0024] Using the user input keyword as the input of the ranking model, using the true value keyword as the true value calibration of the user input keyword, and obtaining the target sample data of the ranking model;
[0025] Determine whether the true value keyword exists in the recall result of the previous word form before the target keyword is input, wherein the initial target keyword is the user input keyword;
[0026] If it exists, the previous word form before the target keyword is input is used as the input of the sorting model, and the true value keyword is used as the true value calibration of the previous word form before the target keyword is input, to obtain the target sample data of the sorting model;
[0027] The target keyword is updated to the previous word form before the target keyword is input, and the execution step is returned to: determining whether the true value keyword exists in the recall result of the previous word form before the target keyword is input;
[0028] If it does not exist, the addition of target sample data is terminated.
[0029] In a third aspect, an embodiment of the present application provides a method for generating intelligent prompts for query keywords, the method comprising:
[0030] Get the keywords to be searched entered by the user;
[0031] Analyze the keywords to be searched using a pre-trained ranking model to obtain a query keyword intelligent prompt composed of multiple predicted keywords arranged in a predicted order, wherein the ranking model is trained by any ranking model training method described in the present application;
[0032] The query keyword intelligent prompt is returned to the user.
[0033] In a fourth aspect, an embodiment of the present application provides a ranking model training device, the device comprising:
[0034] A keyword acquisition module, used to acquire a user input keyword and a true value keyword, wherein the user input keyword is the keyword finally input by the user in the input box, and the true value keyword is the keyword used by the user when triggering the search;
[0035] A target sample adding module, used to use the user input keyword as the input of the sorting model, use the true value keyword as the true value calibration of the user input keyword, and obtain the target sample data of the sorting model;
[0036] A recall result judgment module, used to judge whether the true value keyword exists in the recall result of the previous word form before the target keyword is input, wherein the initial target keyword is the user input keyword;
[0037] A first result execution module is used for, if the result obtained by the recall result judgment module is existence, taking the previous word form before the target keyword is input as the input of the sorting model, taking the true value keyword as the true value calibration of the previous word form before the target keyword is input, and obtaining the target sample data of the sorting model;
[0038] The second sample adding module is used to update the target keyword to the previous word form before the target keyword is input, and return to the recall result judgment module to continue execution;
[0039] The second result execution module is used to end the addition of the target sample data if it does not exist;
[0040] The sorting model training module is used to train the sorting model using the target sample data.
[0041] In a possible implementation, the first result execution module is specifically used to: if it exists, use the previous word form before the target keyword is input as the input of the sorting model according to a preset probability value, and use the true value keyword as the true value calibration of the previous word form before the target keyword is input, to obtain the target sample data of the sorting model.
[0042] In a possible implementation, the first result execution module includes:
[0043] The target probability value acquisition submodule is used to obtain the target probability value a corresponding to the previous word form before the target keyword input is completed, if it exists. i , where a i The target probability value corresponding to the i-th word form before the user completes the keyword input, 0≤a i ≤1, a i <a i-1 , a i-1 The target probability value corresponding to the i-1th word form before the user completes inputting the keyword;
[0044] The target sample data adds a submodule to use the target probability value a i To trigger the execution probability, the trigger execution takes the previous word form before the target keyword is input as the input of the sorting model, and takes the true value keyword as the true value calibration of the previous word form before the target keyword is input, to obtain the target sample data of the sorting model.
[0045] In a possible implementation manner, the target sample data adding submodule is specifically used to: randomly generate a number w from 1-100, determine whether w% is greater than a i If it is not greater than, the previous word form before the target keyword is input is used as the input of the sorting model, and the true value keyword is used as the true value calibration of the previous word form before the target keyword is input, so as to calculate the target probability value a. i Increase the target sample data of the sorting model.
[0046] In a fifth aspect, an embodiment of the present application provides a sample data generating device for a ranking model, the device comprising:
[0047] A keyword acquisition module, used to acquire a user input keyword and a true value keyword, wherein the user input keyword is the keyword finally input by the user in the input box, and the true value keyword is the keyword used by the user when triggering the search;
[0048] A target sample adding module, used to use the user input keyword as the input of the sorting model, use the true value keyword as the true value calibration of the user input keyword, and obtain the target sample data of the sorting model;
[0049] A recall result judgment module, used to judge whether the true value keyword exists in the recall result of the previous word form before the target keyword is input, wherein the initial target keyword is the user input keyword;
[0050] A first result execution module is used for, if the result obtained by the recall result judgment module is existence, taking the previous word form before the target keyword is input as the input of the sorting model, taking the true value keyword as the true value calibration of the previous word form before the target keyword is input, and obtaining the target sample data of the sorting model;
[0051] The second sample adding module is used to update the target keyword to the previous word form before the target keyword is input, and return to the recall result judgment module to continue execution;
[0052] The second result execution module is used to end the addition of the target sample data if it does not exist.
[0053] In a sixth aspect, an embodiment of the present application provides a query keyword intelligent prompt generation device, the device comprising:
[0054] A module for obtaining keywords to be searched is used to obtain keywords to be searched input by users;
[0055] A search discovery result determination module, used to analyze the keywords to be searched using a pre-trained ranking model to obtain a query keyword intelligent prompt composed of multiple predicted keywords arranged in a predicted order, wherein the ranking model is trained by the ranking model training device described in any one of claims 7 to 10;
[0056] The search result return module is used to return the query keyword intelligent prompt to the user.
[0057] In a seventh aspect, an embodiment of the present application provides an electronic device, characterized in that it includes a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus;
[0058] Memory, used to store computer programs;
[0059] The processor is used to implement the sorting model training method, the sorting model sample data generation method or the query keyword intelligent prompt generation method as claimed in any one of the claims of this application when executing the program stored in the memory.
[0060] In the eighth aspect, an embodiment of the present application provides a computer-readable storage medium, characterized in that a computer program is stored in the computer-readable storage medium, and when the computer program is executed by a processor, it implements any of the sorting model training methods, sorting model sample data generation methods, or query keyword intelligent prompt generation methods described in the present application.
[0061] In the ninth aspect, an embodiment of the present application provides a computer program product comprising instructions, which, when executed on a computer, enables the computer to execute any one of the sorting model training methods, sorting model sample data generation methods, or query keyword intelligent prompt generation methods described in the present application.
[0062] The method, device and electronic device for training a sorting model and generating sample data provided by the embodiments of the present application obtain user input keywords and true value keywords, wherein the user input keyword is the keyword finally input by the user in the input box, and the true value keyword is the keyword used when the user triggers a search; the user input keyword is used as the input of the sorting model, and the true value keyword is used as the true value calibration of the user input keyword to obtain target sample data of the sorting model; it is determined whether there is a true value keyword in the recall result of the previous word form before the target keyword is input, wherein the initial target keyword is the user input keyword; if there is, the previous word form before the target keyword is input is used as the input of the sorting model, and the true value keyword is used as the true value calibration of the previous word form before the target keyword is input to obtain the target sample data of the sorting model; the target keyword is updated to the previous word form before the target keyword is input, and the execution step is returned: it is determined whether there is a true value keyword in the recall result of the previous word form before the target keyword is input; if not, the addition of the target sample data is terminated; and the sorting model is trained using the target sample data.
[0063] The target sample data used to train the sorting model includes not only the user input keywords that the user finally inputs, but also the word form before the user inputs the keyword. The word length of the word form before the user inputs the keyword is shorter than the word length of the user input keyword, so that the sorting model can be trained with shorter keywords. The sorting model obtained by training can also obtain accurate query keyword intelligent prompts when the user inputs shorter keywords, thereby achieving accurate query keyword intelligent prompts when the user inputs shorter keywords. Of course, implementing any product or method of the present application does not necessarily require achieving all of the advantages described above at the same time. BRIEF DESCRIPTION OF THE DRAWINGS
[0064] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art are briefly introduced below.
[0065] Figure 1 A schematic diagram showing intelligent prompts for query keywords in the related art;
[0066] Figure 2 A first schematic diagram of the sorting model training method according to an embodiment of the present application;
[0067] Figure 3 A second schematic diagram of the sorting model training method according to an embodiment of the present application;
[0068] Figure 4 A schematic diagram of a possible implementation of step S141 in an embodiment of the present application;
[0069] Figure 5 A schematic diagram of a possible implementation of step S1412 in an embodiment of the present application;
[0070] Figure 6 A schematic diagram of a method for generating intelligent prompts for query keywords according to an embodiment of the present application;
[0071] Figure 7 A schematic diagram of a training device for training a sorting model according to an embodiment of the present application;
[0072] Figure 8 A schematic diagram of a query keyword intelligent prompt generating device according to an embodiment of the present application;
[0073] Fig. 9 A schematic diagram of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION
[0074] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field based on the present application belong to the scope of protection of the present application.
[0075] In order to obtain accurate intelligent prompts for query keywords when a user inputs a shorter keyword, an embodiment of the present application provides a sorting model training method, which includes: obtaining a user-input keyword and a true-value keyword, wherein the user-input keyword is the keyword finally input by the user in the input box, and the true-value keyword is the keyword used when the user triggers a search; using the user-input keyword as the input of the sorting model, and using the true-value keyword as the true-value calibration of the user-input keyword to obtain target sample data for the sorting model; judging whether there is a true-value keyword in the recall result of the previous word form before the target keyword is input, wherein the initial target keyword is the user-input keyword; if there is, using the previous word form before the target keyword is input as the input of the sorting model, and using the true-value keyword as the true-value calibration of the previous word form before the target keyword is input, to obtain the target sample data for the sorting model; updating the target keyword to the previous word form before the target keyword is input, and returning to the execution step: judging whether there is a true-value keyword in the recall result of the previous word form before the target keyword is input; if not, ending the addition of the target sample data; and training the sorting model using the target sample data.
[0076] In an embodiment of the present application, the target sample data used to train the sorting model includes not only the user-input keywords finally input by the user, but also the word form before the user-input keyword input is completed. For example, in addition to "neural network", the target sample data may also include "neural net", "neural", etc. The word length of the word form before the user-input keyword input is shorter than the word length of the user-input keyword. For example, the word length of "neural net" and "neural" is shorter than the word length of "neural network"; thereby, the sorting model can be trained using shorter keywords. For example, in addition to using "neural network" to train the sorting model, the sorting model is also trained using "neural net" and "neural"; the sorting model obtained by training can also obtain accurate query keyword intelligent prompts when the user enters shorter keywords. For example, when the user enters "neural" or "neural net", the search query keyword intelligent prompt containing "neural network principle" has been obtained without the user entering "neural network", thereby achieving accurate query keyword intelligent prompts when the user enters shorter keywords.
[0077] The following is a detailed description, see Figure 2 , Figure 2 A schematic diagram of a sorting model training method according to an embodiment of the present application, the method comprising:
[0078] S11, obtaining a user input keyword and a true value keyword, wherein the user input keyword is a keyword finally input by the user in the input box, and the true value keyword is a keyword used by the user to trigger a search.
[0079] The sorting model training method in the embodiment of the present application can be implemented by an electronic device. Specifically, the electronic device can be a personal computer, a smart phone, or a server.
[0080] The user input keyword is the keyword that the user finally enters in the input box, and the true value keyword is the keyword that the user wants to search for, that is, the keyword used by the user when triggering the search. For example, the user input keyword that the user finally enters in the search box is "neural network", and the true value keyword that the user wants to search for is "neural network principle", etc. In one example, the true value keyword of the user input keyword can be manually calibrated; in one example, the true value keyword of the user input keyword can be obtained from the user's historical data. For example, in a search process, the user input keyword that the user finally enters in the search box is "neural network", and the returned query keyword intelligent prompt includes "neural network principle". The user finally searches for "neural network principle", then "neural network principle" is the true value keyword corresponding to "neural network".
[0081] S12, taking the user input keyword as the input of the sorting model, taking the true value keyword as the true value calibration of the user input keyword, and obtaining the target sample data of the sorting model.
[0082] The specific architecture of the sorting model can refer to the sorting model in the related art, which can be a general deep learning model, such as a convolutional neural network, etc. The present application does not limit the architecture of the sorting model. The user input keywords are used as the input of the sorting model, and the true value keywords are used as the true value calibration of the user input keywords and added to the target sample data for training the sorting model.
[0083] S13, determining whether the true value keyword exists in the recall result of the previous word form before the target keyword is input, wherein the initial target keyword is the user input keyword.
[0084] The completion of the input of keywords is a process. In one example, when using the Wubi input method, the keyword "neural network principle" can be input character by character: "shen" → "jing" → "wang" → "luo" → "yuan" → "li". Then the morphological changes of the keyword are: "shen" → "shenjing" → "shenjingwang" → "shenjingwangluo" → "shenjingwangluoyuan" → "shenjingwangluoyuanli".
[0085] Before the completion of the input of the target keyword, the word length of the word morphology is shorter than that of the target keyword, and the word morphology before the completion of the input of the target keyword is a part of the target keyword. In one example, the previous word morphology before the completion of the input of "neural network" is "neural net", the previous word morphology before the completion of the input of "shenjing" is "shenjin", the previous word morphology before the completion of the input of "banana" is "banan", and the previous word morphology before the completion of the input of "CNN" is "CN", etc.
[0086] The initial target keyword is the keyword input by the user, that is, the target keyword when step S13 is first executed is the keyword input by the user.
[0087] In one example, the recall result of the previous word morphology (hereinafter referred to as the first keyword) before the completion of the input of the target keyword can be each keyword predicted by the user based on the first keyword. In one example, the recall result of the first keyword can be the intelligent query keyword hint returned after the user inputs the first keyword in the input box in the historical search data.
[0088] S14, if it exists, use the previous word morphology before the completion of the input of the target keyword as the input of the sorting model, and use the true value keyword as the true value calibration of the previous word morphology before the completion of the input of the target keyword to obtain the target sample data of the sorting model.
[0089] In the case where the true value keyword exists in the recall result of the previous word morphology before the completion of the input of the target keyword, use the previous word morphology before the completion of the input of the target keyword as the input of the sorting model, and use the true value keyword as the true value calibration of the previous word morphology before the completion of the input of the target keyword, and add it to the target sample data for training the sorting model.
[0090] S15, update the target keyword to the previous word morphology before the completion of the input of the target keyword, and return to execute step: S13 to determine whether the true value keyword exists in the recall result of the previous word morphology before the completion of the input of the target keyword.
[0091] For example, if the target keyword is "neural network" and the previous word form before the target keyword is input is "neural network", the target keyword is updated to "neural network" and the process returns to step S13, i.e., it is determined whether the true value keyword "neural network principle" exists in the recall result of the previous word form "neural" before the input of "neural network" is completed.
[0092] S16: If it does not exist, end the adding of the target sample data.
[0093] If there is no true value keyword in the recall result of the previous word form before the target keyword is input, the addition of the target sample data is terminated. It can be understood that here, a user inputs a keyword as an example, and steps S11-S16 are executed for each user input keyword until enough target sample data is obtained. Sufficient here means that the number is sufficient to train the sorting model. For example, a quantity threshold can be set. When the number of target sample data reaches the quantity threshold, it is determined that enough target sample data has been obtained.
[0094] S17, using the above target sample data to train the sorting model.
[0095] The training process of the sorting model can refer to the sorting model training process in the relevant technology. For example, the target keywords in the target sample data are input into the sorting model to obtain predicted query keyword intelligent prompts. Based on the predicted query keyword intelligent prompts and the true value keywords in the target sample data, the loss of the sorting model is calculated, and the parameters of the sorting model are adjusted according to the loss. Multiple trainings are performed until the loss of the sorting model converges.
[0096] In an embodiment of the present application, the target sample data includes not only the user-input keywords finally input by the user, but also the keywords in word form before the user inputs the keywords. For example, in addition to "neural network", the target sample data may also include "neural net", "neural", etc. The word length of the word form before the user inputs the keywords is shorter than the word length of the user input keywords. For example, the word length of "neural net" and "neural" is shorter than the word length of "neural network"; thereby, the sorting model can be trained using shorter keywords. For example, in addition to using "neural network" to train the sorting model, the sorting model is also trained using "neural net" and "neural"; the sorting model obtained by training can also obtain accurate query keyword intelligent prompts when the user enters shorter keywords. For example, when the user enters "neural" or "neural net", the search query keyword intelligent prompt containing "neural network principle" has been obtained without the user entering "neural network", thereby achieving accurate query keyword intelligent prompts when the user enters shorter keywords.
[0097] Query keyword smart prompts are important traffic diversion items in the search process. A core evaluation indicator of query keyword smart prompts is the diversion rate. The diversion rate represents the efficiency of query keyword smart prompts in completing traffic diversion. Its evaluation formula is diversion rate = search times / request times, where the request times refer to the number of times query keyword smart prompts are calculated and returned based on the keywords entered by the user, and the search times refer to the number of times users actually trigger searches for the returned query keyword smart prompts; for example Figure 1 As shown, after the user enters "neural" in the search box, a query keyword smart prompt is returned. The user did not trigger the actual search, but continued to enter "neural network". The fourth word "neural network principle" in the returned query keyword smart prompt triggered the actual search. The number of searches is 1 and the number of requests is 2. The higher the diversion rate, the better the diversion effect. In order to optimize the search process, the diversion rate can be improved by reducing the number of requests. The sorting model trained by the embodiment of the present application can return accurate query keyword smart prompts when the user enters shorter keywords, thereby improving the diversion rate of the sorting model.
[0098] In one possible implementation, see Figure 3 If the above S14 exists, the previous word form before the target keyword is input is used as the input of the sorting model, and the true value keyword is used as the true value calibration of the previous word form before the target keyword is input, to obtain the target sample data of the sorting model, including:
[0099] S141, if it exists, then according to the preset probability value, the previous word form before the target keyword is input is used as the input of the sorting model, and the true value keyword is used as the true value calibration of the previous word form before the target keyword is input, to obtain the target sample data of the sorting model.
[0100] The preset probability value can be customized according to actual conditions. The preset probability values of different target keywords can be the same or different. In an example, the preset probability value is A, that is, when there is a true keyword in the recall result of the previous word form before the target keyword is input, there is a probability of A that the previous word form before the target keyword is input is used as the input of the sorting model, and the above true keyword is used as the true value calibration of the previous word form before the target keyword is input, and added to the target sample data, that is to say, there is a probability of (1-A) that it is not added.
[0101] In the embodiment of the present application, the target sample data is increased according to the preset probability value, the randomness and discreteness of the target sample data are increased, and under the premise of big data training, the prediction results of the sorting model obtained are more representative and the results are more accurate.
[0102] In one possible implementation, see Figure 4 If the above S141 exists, then the previous word form before the target keyword is input is used as the input of the sorting model according to the preset probability value, and the true value keyword is used as the true value calibration of the previous word form before the target keyword is input, to obtain the target sample data of the sorting model, including:
[0103] S1411, if it exists, then obtain the target probability value a corresponding to the previous word form before the target keyword input is completed i , where a i The target probability value corresponding to the i-th word form before the user completes the keyword input, 0≤a i ≤1, a i <a i-1 , a i-1 The target probability value corresponding to the i-1th word form before the user completes inputting the keyword.
[0104] The initial target keyword is the keyword to be queried, a i is the target probability value corresponding to the i-th word form before the query keyword is input. For example, if the query keyword is "shenjingwangluo", the first word form before the query keyword is input is "shenjingwanglu", and the corresponding target probability value is a 1 ; Before the query keyword is input, the second word form is "shenjingwangl", and the corresponding target probability value is a 2 ; Before the query keyword is input, the third word form is "shenjingwang", and the corresponding target probability value is a 3 ; and so on.
[0105] S1412, with target probability value a i To trigger the execution probability, the trigger execution takes the previous word form before the target keyword is input as the input of the sorting model, and takes the true value keyword as the true value calibration of the previous word form before the target keyword is input, to obtain the target sample data of the sorting model.
[0106] Theoretically, for the same true value keyword, the shorter the keyword length entered by the user, the lower the hit probability. i <a i-1 , it can ensure that the shorter the keyword is, the smaller the probability of it being the target sample data. That is, the shorter the keyword is, the smaller the impact on the ranking model training is, which is more in line with the actual situation, thereby increasing the accuracy of the ranking model's prediction results.
[0107] In one example, the target probability value a can be determined by generating random numbers. i Whether to trigger, the generated random number represents the target probability value a i In the case of a trigger, the previous word form before the target keyword is input is used as the input of the sorting model, and the true value keyword is used as the true value calibration of the previous word form before the target keyword is input, and the target sample data of the sorting model is obtained. The generated random number represents the target probability value a i If not triggered, target sample data will not be added.
[0108] In one possible implementation, see Figure 5 , the above target probability value a i To trigger the execution probability, the trigger execution uses the previous word form before the target keyword is input as the input of the sorting model, and uses the true value keyword as the true value calibration of the previous word form before the target keyword is input, to obtain the target sample data of the sorting model, including:
[0109] S14121, randomly generate a number w from 1-100, and determine whether w% is greater than a i .
[0110] Randomly generate a number w from 1-100, where the probability of each number being generated is 1%. Compare w% with a i The size of w% is greater than a i , when w% is greater than a i In the case of w% not greater than a, step S15 is executed. i In this case, execute step S14122.
[0111] S14122, if it is not greater than, then the previous word form before the target keyword is input is used as the input of the sorting model, and the above-mentioned true value keyword is used as the true value calibration of the previous word form before the target keyword is input, so as to calculate the target probability value a according to the target probability value a. i Increase the target sample data of the sorting model.
[0112] In w% not greater than a i In the case of , the previous word form before the target keyword is input is used as the input of the sorting model, and the above true value keyword is used as the true value calibration of the previous word form before the target keyword is input, thereby achieving the target probability value a i Increase the target sample data of the sorting model. And use the random number generation method of 1-100. Compared with directly generating the corresponding probability value, there is no need to set the decimal point, which can improve the calculation speed.
[0113] In a possible implementation, after the above-mentioned S17 uses the above-mentioned target sample data to train the sorting model, the above-mentioned method also includes: obtaining the keywords to be searched input by the user; using the pre-trained sorting model to analyze the keywords to be searched, and obtaining a query keyword intelligent prompt composed of multiple predicted keywords arranged in a predicted order; and returning the query keyword intelligent prompt to the user.
[0114] In one example, for a target user, the historical search data of the target user can be used to train a ranking model for the target user, so that the resulting ranking model can better conform to the search habits of the target user and can improve the accuracy of intelligent prompts for query keywords for the target user.
[0115] The present application also provides a method for generating sample data of a ranking model, the method comprising:
[0116] Step 1: Obtain user input keywords and true value keywords, wherein the user input keywords are keywords finally input by the user in the input box, and the true value keywords are keywords used by the user when triggering the search;
[0117] Step 2: using the user input keyword as the input of the ranking model, using the true value keyword as the true value calibration of the user input keyword, and obtaining the target sample data of the ranking model;
[0118] Step 3, determining whether the true value keyword exists in the recall result of the previous word form before the target keyword is input, wherein the initial target keyword is the user input keyword;
[0119] Step 4: If it exists, the previous word form before the target keyword is input is used as the input of the sorting model, and the true value keyword is used as the true value calibration of the previous word form before the target keyword is input, so as to obtain the target sample data of the sorting model;
[0120] Step 5, updating the target keyword to the previous word form before the target keyword is input, and returning to the execution step: determining whether the true value keyword exists in the recall result of the previous word form before the target keyword is input;
[0121] Step 6: If it does not exist, end the adding of target sample data.
[0122] The specific process of the target sample data generation method can refer to the target sample data generation process in the above-mentioned sorting model training method, which will not be repeated here. In the embodiment of the present application, the target sample data is generated by using the previous word form before the target keyword input is completed, which can increase the data volume of the target sample data.
[0123] The present application also provides a method for generating intelligent query keyword prompts. Figure 6 , the above method comprises:
[0124] S21, obtaining the keywords to be searched input by the user.
[0125] The generation of intelligent prompts for query keywords in the embodiments of the present application can be implemented by an electronic device, specifically, the electronic device can be a personal computer, a smart phone, or a server, etc. For example, the generation of intelligent prompts for query keywords in the embodiments of the present application can be implemented by an online server, or can be implemented on a user terminal in an offline manner, all of which are within the scope of protection of the present application.
[0126] S22, analyzing the keywords to be searched using a pre-trained ranking model to obtain intelligent query keyword prompts consisting of multiple predicted keywords arranged in a predicted order, wherein the ranking model is trained by any of the above-mentioned ranking model training methods.
[0127] In an example, each predicted keyword predicted by the ranking model has a corresponding confidence level. The predicted keywords can be ranked in descending order of confidence level as the prediction order, thereby obtaining intelligent prompts for the query keywords.
[0128] S23, returning the query keyword intelligent prompt to the user.
[0129] In an embodiment of the present application, the target sample data used to train the sorting model includes not only the query keyword ultimately input by the user, but also the keyword in word form before the query keyword is input, so that the sorting model can be trained with shorter keywords. The trained sorting model can obtain accurate query keyword intelligent prompts when the user inputs shorter keywords, thereby achieving accurate query keyword intelligent prompts when the user inputs shorter keywords.
[0130] The present application also provides a sorting model training device, see Figure 7 , the device comprises:
[0131] The keyword acquisition module 31 is used to acquire the user input keyword and the true value keyword, wherein the user input keyword is the keyword finally input by the user in the input box, and the true value keyword is the keyword used by the user when triggering the search;
[0132] A target sample adding module 32 is used to use the user input keyword as the input of the sorting model, use the true value keyword as the true value calibration of the user input keyword, and obtain the target sample data of the sorting model;
[0133] A recall result judgment module 33 is used to judge whether the true value keyword exists in the recall result of the previous word form before the target keyword is input, wherein the initial target keyword is the user input keyword;
[0134] The first result execution module 34 is used to, if it exists, use the previous word form before the target keyword is input as the input of the sorting model, use the true value keyword as the true value calibration of the previous word form before the target keyword is input, and obtain the target sample data of the sorting model;
[0135] The second sample adding module 35 is used to update the target keyword to the previous word form before the target keyword is input, and return to the recall result judging module 33 to continue execution;
[0136] The second result execution module 36 is used to end the addition of the target sample data if it does not exist;
[0137] The sorting model training module 37 is used to train the sorting model using the target sample data.
[0138] In a possible implementation, the first result execution module is specifically used to: if it exists, use the previous word form before the target keyword is input as the input of the sorting model according to a preset probability value, and use the true value keyword as the true value calibration of the previous word form before the target keyword is input, to obtain the target sample data of the sorting model.
[0139] In a possible implementation, the first result execution module includes:
[0140] The target probability value acquisition submodule is used to obtain the target probability value a corresponding to the previous word form before the target keyword input is completed, if it exists. i , where a i The target probability value corresponding to the i-th word form before the user completes the keyword input, 0≤a i ≤1, a i <a i-1 , a i-1 The target probability value corresponding to the i-1th word form before the user completes inputting the keyword;
[0141] The target sample data adds a submodule to use the target probability value a i To trigger the execution probability, the trigger execution takes the previous word form before the target keyword is input as the input of the sorting model, and takes the true value keyword as the true value calibration of the previous word form before the target keyword is input, to obtain the target sample data of the sorting model.
[0142] In a possible implementation manner, the target sample data adding submodule is specifically used to: randomly generate a number w from 1-100, determine whether w% is greater than a i If it is not greater than, the previous word form before the target keyword is input is used as the input of the sorting model, and the true value keyword is used as the true value calibration of the previous word form before the target keyword is input, so as to calculate the target probability value a. i Increase the target sample data of the sorting model.
[0143] In a possible implementation, the device also includes: a search discovery result prediction module, used to obtain the keywords to be searched input by the user; using a pre-trained sorting model to analyze the keywords to be searched to obtain a query keyword intelligent prompt composed of multiple predicted keywords arranged in a predicted order; and returning the query keyword intelligent prompt to the user.
[0144] The present application also provides a query keyword intelligent prompt generation device, see Figure 8 , the device comprises:
[0145] The to-be-searched keyword acquisition module 41 is used to acquire the to-be-searched keyword input by the user;
[0146] A search result determination module 42 is used to analyze the keywords to be searched using a pre-trained ranking model to obtain a query keyword intelligent prompt composed of multiple predicted keywords arranged in a predicted order, wherein the ranking model is trained by any ranking model training method described in the present application;
[0147] The search result return module 43 is used to return the query keyword intelligent prompt to the user.
[0148] The present application also provides a device for generating sample data of a ranking model, the device comprising:
[0149] A keyword acquisition module, used to acquire a user input keyword and a true value keyword, wherein the user input keyword is the keyword finally input by the user in the input box, and the true value keyword is the keyword used by the user when triggering the search;
[0150] A target sample adding module, used to use the user input keyword as the input of the sorting model, use the true value keyword as the true value calibration of the user input keyword, and obtain the target sample data of the sorting model;
[0151] A recall result judgment module, used to judge whether the true value keyword exists in the recall result of the previous word form before the target keyword is input, wherein the initial target keyword is the user input keyword;
[0152] A first result execution module is used for, if the result obtained by the recall result judgment module is existence, taking the previous word form before the target keyword is input as the input of the sorting model, taking the true value keyword as the true value calibration of the previous word form before the target keyword is input, and obtaining the target sample data of the sorting model;
[0153] The second sample adding module is used to update the target keyword to the previous word form before the target keyword is input, and return to the recall result judgment module to continue execution;
[0154] The second result execution module is used to end the addition of the target sample data if it does not exist.
[0155] The present application also provides an electronic device, such as Fig. 9 As shown, it includes a processor 51, a communication interface 52, a memory 53 and a communication bus 54, wherein the processor 51, the communication interface 52, and the memory 53 communicate with each other through the communication bus 54.
[0156] A memory 53, for storing computer programs;
[0157] The processor 51 is used to implement any of the methods described in the above embodiments when executing the program stored in the memory 53.
[0158] The communication bus mentioned in the above terminal can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.
[0159] The communication interface is used for communication between the above terminal and other devices.
[0160] The memory may include a random access memory (RAM) or a non-volatile memory, such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.
[0161] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
[0162] In another embodiment provided in the present application, a computer-readable storage medium is provided, wherein a computer program is stored in the computer-readable storage medium, and when the computer program is executed by a processor, any of the methods described in the above embodiments is implemented.
[0163] In another embodiment provided by the present application, a computer program product including instructions is also provided, which, when executed on a computer, enables the computer to execute any of the methods described in the above embodiments.
[0164] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using 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 application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be transmitted from a 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.) mode to another website site, computer, server or data center. The computer-readable storage medium may be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated. The available medium may 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 drive Solid State Disk (SSD)), etc.
[0165] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0166] Each embodiment in this specification is described in a related manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the embodiments of the device, electronic device, storage medium and computer program product, since they are basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0167] The above description is only a preferred embodiment of the present application and is not intended to limit the protection scope of the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application are included in the protection scope of the present application.
Claims
1. A sorting model training method, characterized in that: The method comprises: Obtaining a user input keyword and a true value keyword, wherein the user input keyword is the keyword finally entered by the user in the input box, and the true value keyword is the keyword used by the user when triggering the search; Using the user input keyword as the input of the ranking model, using the true value keyword as the true value calibration of the user input keyword, and obtaining the target sample data of the ranking model; Determine whether the true value keyword exists in the recall result of the previous word form before the target keyword is input, wherein the initial target keyword is the user input keyword; If it exists, the previous word form before the target keyword is input is used as the input of the sorting model, and the true value keyword is used as the true value calibration of the previous word form before the target keyword is input, to obtain the target sample data of the sorting model; The target keyword is updated to the previous word form before the target keyword is input, and the execution step is returned to: determining whether the true value keyword exists in the recall result of the previous word form before the target keyword is input; If it does not exist, end the addition of this target sample data; The sorting model is trained using the target sample data.
2. The method according to claim 1, characterized in that If it exists, the previous word form before the target keyword is input is used as the input of the sorting model, and the true value keyword is used as the true value calibration of the previous word form before the target keyword is input, to obtain the target sample data of the sorting model, including: If it exists, the previous word form before the target keyword is input is used as the input of the sorting model according to the preset probability value, and the true value keyword is used as the true value calibration of the previous word form before the target keyword is input, to obtain the target sample data of the sorting model.
3. The method according to claim 2, characterized in that If it exists, then according to the preset probability value, the previous word form before the target keyword is input is used as the input of the sorting model, and the true value keyword is used as the true value calibration of the previous word form before the target keyword is input, to obtain the target sample data of the sorting model, including: If it exists, then get the target probability value a corresponding to the previous word form before the target keyword input is completed i , where a i The target probability value corresponding to the i-th word form before the user completes the keyword input, 0≤a i ≤1, a i <a i-1 , a i-1 The target probability value corresponding to the i-1th word form before the user completes inputting the keyword; With target probability value a i To trigger the execution probability, the trigger execution takes the previous word form before the target keyword is input as the input of the sorting model, and takes the true value keyword as the true value calibration of the previous word form before the target keyword is input, to obtain the target sample data of the sorting model.
4. The method according to claim 3, characterized in that The target probability value a i To trigger the execution probability, the trigger execution uses the previous word form before the target keyword is input as the input of the sorting model, and uses the true value keyword as the true value calibration of the previous word form before the target keyword is input, to obtain the target sample data of the sorting model, including: Randomly generate a number w from 1-100 and determine whether w% is greater than a i ; If it is not greater than, the previous word form before the target keyword is input is used as the input of the sorting model, and the true value keyword is used as the true value calibration of the previous word form before the target keyword is input, so as to calculate the target probability value a. i Increase the target sample data of the sorting model.
5. A method for generating sample data of a ranking model, characterized in that: The method comprises: Obtaining a user input keyword and a true value keyword, wherein the user input keyword is the keyword finally entered by the user in the input box, and the true value keyword is the keyword used by the user when triggering the search; Using the user input keyword as the input of the ranking model, using the true value keyword as the true value calibration of the user input keyword, and obtaining the target sample data of the ranking model; Determine whether the true value keyword exists in the recall result of the previous word form before the target keyword is input, wherein the initial target keyword is the user input keyword; If it exists, the previous word form before the target keyword is input is used as the input of the sorting model, and the true value keyword is used as the true value calibration of the previous word form before the target keyword is input, to obtain the target sample data of the sorting model; The target keyword is updated to the previous word form before the target keyword is input, and the execution step is returned to: determining whether the true value keyword exists in the recall result of the previous word form before the target keyword is input; If it does not exist, the addition of target sample data is terminated.
6. A method for generating intelligent prompts for query keywords, characterized in that: The method comprises: Get the keywords to be searched entered by the user; Analyze the keywords to be searched using a pre-trained ranking model to obtain a query keyword intelligent prompt composed of multiple predicted keywords arranged in a predicted order, wherein the ranking model is trained by the ranking model training method described in any one of claims 1 to 4; The query keyword intelligent prompt is returned to the user.
7. A sorting model training device, characterized in that: The device comprises: A keyword acquisition module, used to acquire a user input keyword and a true value keyword, wherein the user input keyword is the keyword finally input by the user in the input box, and the true value keyword is the keyword used by the user when triggering the search; A target sample adding module, used to use the user input keyword as the input of the sorting model, use the true value keyword as the true value calibration of the user input keyword, and obtain the target sample data of the sorting model; A recall result judgment module, used to judge whether the true value keyword exists in the recall result of the previous word form before the target keyword is input, wherein the initial target keyword is the user input keyword; A first result execution module is used for, if the result obtained by the recall result judgment module is existence, taking the previous word form before the target keyword is input as the input of the sorting model, taking the true value keyword as the true value calibration of the previous word form before the target keyword is input, and obtaining the target sample data of the sorting model; The second sample adding module is used to update the target keyword to the previous word form before the target keyword is input, and return to the recall result judgment module to continue execution; The second result execution module is used to end the addition of the target sample data if it does not exist; The sorting model training module is used to train the sorting model using the target sample data.
8. The device according to claim 7, characterized in that The first result execution module is specifically used to: if it exists, then according to the preset probability value, use the previous word form before the target keyword is input as the input of the sorting model, and use the true value keyword as the true value calibration of the previous word form before the target keyword is input, to obtain the target sample data of the sorting model.
9. The device according to claim 8, characterized in that The first result execution module includes: The target probability value acquisition submodule is used to obtain the target probability value a corresponding to the previous word form before the target keyword input is completed, if it exists. i , where a i The target probability value corresponding to the i-th word form before the user completes the keyword input, 0≤a i ≤1, a i <a i-1 , a i-1 The target probability value corresponding to the i-1th word form before the user completes inputting the keyword; The target sample data adds a submodule to use the target probability value a i To trigger the execution probability, the trigger execution takes the previous word form before the target keyword is input as the input of the sorting model, and takes the true value keyword as the true value calibration of the previous word form before the target keyword is input, to obtain the target sample data of the sorting model.
10. The device according to claim 9, characterized in that The target sample data adding submodule is specifically used to: randomly generate a number w from 1-100, and determine whether w% is greater than a i If it is not greater than, the previous word form before the target keyword is input is used as the input of the sorting model, and the true value keyword is used as the true value calibration of the previous word form before the target keyword is input, so as to calculate the target probability value a. i Increase the target sample data of the sorting model.
11. A sample data generating device for a sorting model, characterized in that: The device comprises: A keyword acquisition module, used to acquire a user input keyword and a true value keyword, wherein the user input keyword is the keyword finally input by the user in the input box, and the true value keyword is the keyword used by the user when triggering the search; A target sample adding module, used to use the user input keyword as the input of the sorting model, use the true value keyword as the true value calibration of the user input keyword, and obtain the target sample data of the sorting model; A recall result judgment module, used to judge whether the true value keyword exists in the recall result of the previous word form before the target keyword is input, wherein the initial target keyword is the user input keyword; A first result execution module is used for, if the result obtained by the recall result judgment module is existence, taking the previous word form before the target keyword is input as the input of the sorting model, taking the true value keyword as the true value calibration of the previous word form before the target keyword is input, and obtaining the target sample data of the sorting model; The second sample adding module is used to update the target keyword to the previous word form before the target keyword is input, and return to the recall result judgment module to continue execution; The second result execution module is used to end the addition of the target sample data if it does not exist.
12. A device for generating intelligent prompts for query keywords, characterized in that: The device comprises: A module for obtaining keywords to be searched is used to obtain keywords to be searched input by users; A search discovery result determination module, used to analyze the keywords to be searched using a pre-trained ranking model to obtain a query keyword intelligent prompt composed of multiple predicted keywords arranged in a predicted order, wherein the ranking model is trained by the ranking model training device described in any one of claims 7 to 10; The search result return module is used to return the query keyword intelligent prompt to the user.
13. An electronic device, characterized in that: It includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus; Memory, used to store computer programs; A processor, for implementing any of the methods described in claims 1-6 when executing a program stored in a memory.
14. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.
Citation Information
Patent Citations
Risk identification model training method, user risk identification method and related devices
CN112308453A
Word vector-based search method, terminal, server and storage medium
CN112988971A
