A query word processing method and device, electronic equipment and storage medium
By acquiring and matching query scenarios, the system estimates the search results and user behavior probabilities of candidate query terms, filters out query terms to be displayed, solves the problem of user search results not meeting expectations, and improves user experience.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- BEIJING SANKUAI ONLINE TECH CO LTD
- Filing Date
- 2022-03-30
- Publication Date
- 2026-05-29
Smart Images

Figure CN114691961B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data processing technology, and in particular to a query term processing method, apparatus, electronic device, and storage medium. Background Technology
[0002] A query term refers to the text a user uses to search for results. The search scenario refers to the various situations that occur during the search process, such as entering the search start page, entering the query term on the search start page, and being redirected to the search results page. When a user initiates a search by entering a query term, the search results displayed on the redirected search results page may not meet their expectations, thus degrading the user experience. For example, a user might search for "baozi delivery," but the search results may not show any baozi shops offering delivery, or the search results may show baozi shops that offer delivery but do not match the user's preferences.
[0003] Therefore, improving the user experience when searching is an urgent technical problem that needs to be solved. Summary of the Invention
[0004] In view of the above problems, embodiments of the present invention provide a query term processing method, apparatus, electronic device, and storage medium to overcome or at least partially solve the above problems.
[0005] A first aspect of this invention provides a query term processing method, the method comprising:
[0006] Get the current query scenario;
[0007] Based on the current query scenario, obtain multiple candidate query terms that match the current query scenario;
[0008] Estimate the search results for each of the multiple candidate query terms, and the total probability that the search results will be used by the user to perform multiple actions;
[0009] Based on the search results and corresponding total probabilities of the multiple candidate query terms, multiple query terms to be displayed are selected from the multiple candidate query terms;
[0010] The multiple query terms to be displayed are presented.
[0011] Optionally, the method further includes:
[0012] Obtain reference features for the current query scenario, wherein the reference features for the current query scenario include at least one of the following: current time features, current geographical location features, and current user features;
[0013] Estimate the search results for each of the multiple candidate query terms, and the total probability that the search results will be used by the user to perform multiple actions, including:
[0014] Obtain the historical search results for each of the multiple candidate query terms, and the total probability that the historical search results were used by the user to perform multiple actions;
[0015] Based on the historical search results of each of the multiple candidate query terms, the total probability that the user performs multiple actions on the historical search results, and the reference features of the current query scenario, the search results of each of the multiple candidate query terms and the total probability that the user performs multiple actions on the search results are estimated.
[0016] Optionally, if the current query scenario is that the user inputs the current query term, the method further includes: obtaining the search results for the current query term;
[0017] Based on the current query term, obtain multiple candidate query terms whose relevance to the current query term is greater than a preset threshold, including:
[0018] If the number of search results for the current query term is less than a preset number, multiple candidate query terms with a relevance greater than a preset threshold are obtained based on the current query term.
[0019] Optionally, when the current query scenario involves the user inputting the current query term, it further includes:
[0020] Retrieve the search results for the current query term;
[0021] Detect whether the user performs any of the multiple actions on the search results for the current query term;
[0022] Based on the current query term, obtain multiple candidate query terms whose relevance to the current query term is greater than a preset threshold, including:
[0023] If it is detected that the user has not performed any of the multiple actions on the search results of the current query term, multiple candidate query terms with a relevance greater than a preset threshold are obtained based on the current query term.
[0024] Optionally, it also includes:
[0025] Obtain the user's historical search log, which includes multiple historical search records. Each historical search record includes at least: historical query terms, search results for the historical query terms, and actions performed by the user on the search results for the historical query terms.
[0026] Based on the search results of the historical query terms and the actions the user has performed on the search results of the historical query terms, the historical query terms are labeled with corresponding tags;
[0027] Using multiple historical query terms with tags as training samples, the preset model is trained to obtain a query term prediction model;
[0028] Estimate the search results for each of the multiple candidate query terms, and the total probability that the search results will be used by the user to perform multiple actions, including:
[0029] The multiple candidate query terms are input into the query term prediction model to determine the search results for each of the multiple candidate query terms, as well as the total probability that the search results will be used by the user to perform multiple actions.
[0030] Optionally, each historical search record also includes reference features of the historical query scenario, which include at least one of the following: the time feature of entering the historical query term, the geographical location feature when entering the historical query term, and the user feature of the user when entering the historical query term;
[0031] Using multiple historical query terms with tags as training samples, a pre-defined model is trained to obtain a query term prediction model, including:
[0032] The query prediction model is trained by using multiple historical query terms with tags and their corresponding historical query scenarios as training samples.
[0033] The method further includes:
[0034] Obtain reference features for the current query scenario;
[0035] Estimate the search results for each of the multiple candidate query terms, and the total probability that the search results will be used by the user to perform multiple actions, including:
[0036] The multiple candidate query terms and the reference features of the current query scenario are input into the query term prediction model to determine the search results for each of the multiple candidate query terms, as well as the total probability that the search results will be used by the user to perform multiple actions.
[0037] Optionally, there is a temporal relationship among the various behaviors; a query term prediction model is obtained by training a preset model, including:
[0038] The first loss value is obtained by using the tags carried by each of the multiple historical query terms and the prediction results of the preset model for each of the multiple historical query terms.
[0039] When the magnitude relationship between the prediction results of two behaviors for a historical query term does not match the temporal relationship between the two behaviors, a second loss value is obtained.
[0040] Based on the first loss value and the second loss value, the model parameters of the preset model are updated to obtain the query term prediction model.
[0041] A second aspect of the present invention provides a query term processing apparatus, the apparatus comprising:
[0042] The retrieval module is used to retrieve the current query scenario;
[0043] The candidate acquisition module is used to acquire multiple candidate query terms that match the current query scenario based on the current query scenario.
[0044] The prediction module is used to predict the search results of each of the multiple candidate query terms, as well as the total probability that the search results will be used by the user to perform multiple actions.
[0045] The filtering module is used to filter out multiple query terms to be displayed from the multiple candidate query terms based on their respective search results and corresponding total probabilities.
[0046] The display module is used to display the multiple query terms to be displayed.
[0047] A third aspect of the present invention provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the query term processing method disclosed in the embodiments of this application.
[0048] A fourth aspect of the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the query term processing method disclosed in the embodiments of this application.
[0049] The embodiments of the present invention have the following advantages:
[0050] In this embodiment of the invention, displaying query terms selected from candidate query terms can assist users in searching using the displayed query terms. Candidate query terms are words that match the current query scenario, thus they are more likely to match the content the user wants to search for. The multiple query terms to be displayed are selected based on the search results of each candidate query term and the total probability of the search results being performed by the user in various ways. Therefore, when searching using multiple displayed query terms, it is possible to avoid obtaining search results that do not meet the user's expectations, thereby improving the user experience. Attached Figure Description
[0051] To more clearly illustrate the technical solutions of the embodiments of this application, the drawings used in the description of the embodiments of this application will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0052] Figure 1 This is a flowchart of the steps of a query term processing method in an embodiment of the present invention;
[0053] Figure 2 This is a flowchart illustrating the query term processing method implemented through a query term prediction model in an embodiment of the present invention.
[0054] Figure 3 This is a schematic diagram of the structure of a query term processing device in an embodiment of the present invention. Detailed Implementation
[0055] To make the above-mentioned objectives, features and advantages of this application more apparent and understandable, the application will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0056] It should be noted that all actions involving the acquisition of signals, information, or data in this application are carried out in compliance with the relevant data protection laws and policies of the country where the application is located, and with the authorization granted by the owner of the relevant device.
[0057] To address the technical problem of search results obtained through query terms not meeting expectations in related technologies, the applicant proposes: obtaining multiple candidate query terms, estimating the search results for each candidate query term, and the total probability of users performing various actions on the search results, thereby determining the query terms to be displayed so that users can obtain search results that meet their expectations when searching based on the displayed query terms.
[0058] Reference Figure 1 As shown, a flowchart illustrating the steps of a query term processing method according to an embodiment of the present invention is presented, as follows: Figure 1 As shown, this query term processing method may specifically include the following steps:
[0059] Step S11: Obtain the current query scenario.
[0060] The search scenario refers to the various scenarios in which a search is conducted. These scenarios include entering the search start page, entering search terms on the search start page, being redirected to the search results page, opening the search box but not yet entering the current search term, entering the current search term, and performing a search.
[0061] Even if both scenarios involve a user opening the search box but not yet entering a query term, the two scenarios will differ due to variations in user history, time, and geographical location. The current query scenario can be determined based on multiple factors, including user history, the entered query term, and the context.
[0062] Step S12: Based on the current query scenario, obtain multiple candidate query terms that match the current query scenario.
[0063] Based on the current query scenario, multiple candidate query terms matching the current query scenario can be obtained. Optionally, if the current query scenario is that the user has opened the search box but has not yet entered the current query term, then the user's historical behavior can be obtained, and multiple candidate query terms matching the current query scenario can be obtained through the user's historical behavior. For example, if the user's historical behavior is that they have searched for milk tea multiple times, then candidate query terms related to milk tea, such as milk tea, coffee, and juice, can be obtained.
[0064] Optionally, if the current query scenario involves a user inputting a specific query term, then the user-inputted query term can be retrieved, and multiple candidate query terms matching the current query scenario can be generated. This can be achieved by replacing characters in the current query term using synonyms, appositives, or hierarchical relationships to generate multiple candidate query terms associated with the current query term. For example, if the current query term is "baozi takeaway," and the appositive of "takeaway" is "delivered to store," then the candidate query term "baozi delivered to store" can be generated. Alternatively, multiple candidate query terms associated with the current query term can be generated based on a language representation model.
[0065] Each candidate query term and the current query term can be represented by a vector. By calculating the cosine distance or Euclidean distance between the vector representations of each candidate query term and the current query term, the correlation between each candidate query term and the current query term can be obtained, thereby identifying multiple candidate query terms with a correlation greater than a preset threshold.
[0066] Optionally, if the current query scenario involves a user performing a search, then candidate query terms can be obtained based on the user's search content. For example, if a user searched for milk tea but did not place an order, candidate query terms such as coffee and juice could be obtained.
[0067] Step S13: Estimate the search results for each of the multiple candidate query terms, and the total probability that the search results will be used by the user to perform multiple actions.
[0068] After obtaining multiple candidate query terms that match the current query scenario, it is possible to estimate the probability that each candidate query term will be selected by the user for searching, as well as the search results displayed after each candidate query term is used. Furthermore, it is also possible to estimate the total probability that each search result will lead to multiple user actions. These multiple user actions can include browsing the search results for more than a preset time, clicking on the search results, placing an order on the search results, etc. The total probability refers to the sum of the probabilities of the user performing multiple actions.
[0069] The query prediction model described later can be used to predict the search results of candidate query terms and the total probability that the search results will be used by users to perform multiple actions. Furthermore, based on the characteristics of candidate query terms, similar query terms in historical query terms can be searched, and the search results of similar query terms in historical query terms and the total probability that the search results will be used by users to perform multiple actions are used as the search results of candidate query terms and the total probability that the search results will be used by users to perform multiple actions.
[0070] It can directly predict the number of search results displayed after each candidate query term is used in a search, as well as the total probability that each search will result in multiple user actions.
[0071] In this context, the probabilities of different user actions can have different weights. For example, for a search result, the probability of clicking it can be weighted at 1, and the probability of placing an order can be weighted at 10. If the estimated probability of a search result being clicked is 0.7, and the estimated probability of it being ordered after being clicked is 0.7 × 0.5 = 0.35, then the total probability of the search result being clicked and ordered is 0.7 × 1 + 0.35 × 10 = 4.2. It is understood that the total probability is the sum of multiple probabilities; this embodiment only compares the total probabilities of various candidate query terms, and the total probability can be greater than 1.
[0072] Step S14: Based on the search results of each of the multiple candidate query terms and their corresponding total probabilities, select multiple query terms to be displayed from the multiple candidate query terms.
[0073] The system can score the number of search results for each candidate query term, obtaining a search result quantity score. Based on the quantity score and total probability of each candidate query term, a total score is calculated for each candidate query term. From these multiple candidate query terms, several query terms with higher total scores are selected for display. Optionally, the system can also calculate the total score for each candidate query term based on the probability that a user selects it for a search, its quantity score, and its total probability, and then select several query terms with higher total scores for display.
[0074] Step S15: Display the multiple query terms to be displayed.
[0075] This feature allows you to display multiple search terms. You can prioritize or highlight search terms with higher total scores. This can be done on the page where the user enters their current search term, on the search results page, or even on the page where the user is redirected to the search results page and then returned to the current search term input page.
[0076] The technical solution of this application embodiment displays query terms selected from candidate query terms, which can assist users in searching using the displayed query terms. Candidate query terms are words that match the current query scenario, so they are more in line with what the user wants to search for. The multiple query terms to be displayed are selected based on the search results of each candidate query term and the total probability of the search results being performed by the user in various ways. Therefore, when searching using multiple displayed query terms, it is possible to avoid obtaining search results that do not meet the user's expectations, thereby improving the user experience.
[0077] Optionally, based on the above technical solution, the query term processing method further includes: obtaining reference features of the current query scenario, wherein the reference features of the current query scenario include at least one of the following: current time features, current geographical location features, and current user features. It can be understood that the reference features of the current scenario are equivalent to the reference features of multiple candidate query terms.
[0078] The search results based on the reference features of the current query scenario have a significant impact. For example, the current time feature might have the following effects: when a user searches for "food" at night, the search results might be more inclined towards barbecue, etc.; when a user searches for "food" in the morning, the search results might be more inclined towards steamed buns, etc. The current geographical location feature might have the following effects: when a user searches for "breakfast" in Henan, the search results might be more inclined towards spicy soup, etc.; when a user searches for "breakfast" in Chongqing, the search results might be more inclined towards Chongqing noodles, etc. The current user's characteristics might have the following effects: when a user is a student, the search results for "beverages" might be more inclined towards milk, etc.; when a user is a white-collar worker, the search results for "beverages" might be more inclined towards coffee, etc.
[0079] Therefore, when estimating the search results for each of multiple candidate query terms, and the total probability that the search results will be used by the user to perform multiple actions, the reference features of the current query scenario can be combined to estimate the search results for each of the multiple candidate query terms, and the total probability that the search results will be used by the user to perform multiple actions, so as to make the estimation results more accurate. Specifically:
[0080] The system obtains reference features for the current query scenario, as well as historical search results for multiple candidate query terms and the total probability of users performing various actions on those historical search results. By combining the historical search results for each candidate query term, the total probability of users performing various actions on those historical search results, and the reference features for the current query scenario, the system predicts the search results for each candidate query term and the total probability of users performing various actions on those search results. Historical search logs can be used to obtain the historical search results for each candidate query term and the total probability of users performing various actions on those historical search results.
[0081] Optionally, based on the above technical solution, if the number of search results for the current query term is less than a preset number when the current query term is entered by the user, then multiple candidate query terms with a relevance greater than a preset threshold are obtained, and the multiple candidate query terms are filtered and displayed.
[0082] Optionally, the search results for the current query term can be estimated. If the estimated number of search results for the current query term is less than a preset number, multiple candidate query terms with a relevance greater than a preset threshold are obtained based on the current query term, and these candidate query terms are then filtered and displayed. The method for estimating the number of search results for the current query term can refer to the method for estimating the number of search results for candidate query terms.
[0083] Alternatively, if a search is performed using the current query term and the number of search results displayed for the current query term is less than a preset number, multiple candidate query terms with a relevance greater than a preset threshold can be obtained based on the current query term, and these multiple candidate query terms can be filtered and displayed.
[0084] Optionally, based on the above technical solution, when the current query scenario involves the user inputting the current query term, the search results for the current query term may be displayed, and then, if it is detected that the user has not performed any of the multiple actions on the search results for the current query term, multiple candidate query terms with a relevance greater than a preset threshold may be obtained based on the current query term, and the multiple candidate query terms may be filtered and displayed.
[0085] Optionally, if a user does not place an order for the search results of the current query term, or clicks on the search results of the current query term less than a preset number of times, multiple candidate query terms with a relevance greater than a preset threshold are obtained based on the current query term, and these multiple candidate query terms are filtered and displayed.
[0086] If a user does not perform any of the various actions related to the search results for the current query term, or if the user does not place an order based on the search results for the current query term, or if the number of clicks on the search results for the current query term is less than the preset number, these situations all reflect that the displayed search results do not meet the user's expectations. Therefore, considering practical needs, other situations where the displayed search results do not meet user expectations can be set. In any of these situations, multiple candidate search terms with a relevance greater than a preset threshold are obtained based on the current query term, and these candidate search terms are then filtered and displayed.
[0087] Optionally, the number of search results and various user actions on those results can be considered together to determine whether to include candidate search terms. Search results and various actions can be scored; for example, 1 point for 10 search results, 2 points for 20 search results, and 1 point for each click on a search result. The final total score determines whether to include candidate search terms.
[0088] By adopting the technical solution of this application embodiment, when it is determined or estimated that the search results of the current query term do not meet the user's expectations, the query term to be displayed can be obtained and displayed so that the user can obtain search results that meet the user's expectations based on the query term to be displayed.
[0089] Optionally, based on the above technical solution, in order to more quickly predict the search results of candidate query terms and the total probability that the search results will be used by users to perform multiple actions, a preset model can be trained to obtain a query term prediction model. The query term prediction model can then be used to predict the search results of each candidate query term and the total probability that the search results will be used by users to perform multiple actions.
[0090] To train the preset model, training samples are needed. The user's historical search logs are retrieved, which store multiple historical search records. Each historical search record includes at least: the historical query term, the search result for each historical query term, and the user's actions performed on the search results corresponding to each historical query term.
[0091] Based on the search results for historical query terms and the actions the user has taken in response to those search results, corresponding tags are assigned to historical query terms. Optionally, the tags may include positive and negative tags. A total score for a historical query term can be obtained based on the number of search results for the same term and the number of times the user has taken actions related to those search results. Historical query terms with a total score greater than a preset score are labeled with a positive tag, while those with a total score less than or equal to a preset score are labeled with a negative tag.
[0092] Using tagged historical query terms as training samples, a pre-defined model is trained to obtain a query term prediction model. Based on the characteristics of the input historical query terms, the pre-defined model predicts the search results for those historical query terms and the total probability that the search results will trigger multiple user actions.
[0093] Optionally, based on the above technical solution, each historical search record also includes reference features of the historical query scenario. The reference features of the historical query scenario include the time feature of inputting the historical query term, the geographical location feature when inputting the historical query term, and the user feature of the user when inputting the historical query term; wherein, the user feature includes the user's age, gender, occupation, hobbies, etc.
[0094] When training a preset model using historical query terms, the reference features of each historical query term can also be input into the preset model. This allows the preset model to be trained by combining the features of historical query terms and the reference features, thereby obtaining a query term prediction model with more accurate prediction results.
[0095] When using a query prediction model to predict the search results of candidate query terms and the total probability that the search results will be used by the user to perform multiple actions, the candidate query terms and their reference features are input into the query prediction model together. This allows the query prediction model to predict the search results for each candidate query term and the total probability that the search results will be used by the user to perform multiple actions based on the candidate query terms and their reference features.
[0096] Therefore, before inputting the reference features of candidate query terms into the query term prediction model, it is necessary to obtain the reference features of candidate query terms. It can be understood that the reference features of each candidate query term are the same as the reference features of the corresponding current query term. Therefore, the reference features of the current query term can be directly obtained and determined as the reference features of multiple candidate query terms.
[0097] Optionally, based on the above technical solution, after inputting historical query terms, the preset model can estimate the search results of the historical query terms and the total probability that the search results will be performed by the user in multiple ways; based on the estimated search results of the historical query terms and the total probability that the search results will be performed by the user in multiple ways, a prediction result can be obtained; the prediction result can be a score obtained based on the estimated search results of the historical query terms and the total probability that the search results will be performed by the user in multiple ways, or it can be a comparison result between the score obtained based on the estimated search results of the historical query terms and the total probability that the search results will be performed by the user in multiple ways and a preset score.
[0098] The first loss value can be obtained based on the tags carried by each historical query term and the differences between the prediction results of the preset model for each historical query term.
[0099] The query term can contain multiple modules, each used to predict different user behaviors. Considering that search results must exist before clicks can occur, and only after clicks can orders be placed, there is a temporal relationship between these behaviors. Furthermore, the number of search results resulting in orders cannot exceed the number of clicks, and the number of clicks cannot exceed the number of impressions. Each module, when predicting user behavior for its corresponding module, can utilize information from the module predicting the previous user behavior to improve the model's prediction accuracy. Optionally, when predicting the first user behavior, the module can obtain information from the user's previous search behavior to predict the current user behavior, further improving the model's prediction accuracy.
[0100] Therefore, if the magnitude relationship between the predicted results of two behaviors for a historical query term does not match the temporal relationship between the two behaviors, a second loss value can be applied as a penalty.
[0101] Based on the first and second loss values, the model parameters of the preset model are updated to obtain the query term prediction model.
[0102] The technical solution of this application embodiment trains a query term prediction model for the total probability of the search results of the query term and the user performing multiple actions on the search results, thereby improving the prediction efficiency and accuracy and quickly obtaining the query term to be displayed.
[0103] It should be noted that, for the sake of simplicity, the method embodiments are all described as a series of actions. However, those skilled in the art should understand that the embodiments of the present invention are not limited to the described order of actions, because according to the embodiments of the present invention, some steps can be performed in other orders or simultaneously. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions involved are not necessarily essential to the embodiments of the present invention.
[0104] Figure 2This diagram illustrates the flowchart of a query term processing method implemented using a query term prediction model. The process involves: acquiring the current query scenario; obtaining multiple candidate query terms matching the current query scenario; acquiring reference features of the current query scenario; inputting the reference features and multiple candidate query terms into the query term prediction model; obtaining the prediction result for each candidate query term output by the model, including the search result and the total probability that the search result will be used by the user to perform a user action; selecting the query terms to be displayed from the multiple candidate query terms based on the search result for each candidate query term and the total probability that the search result will be used by the user to perform a user action; and finally, displaying the query terms to be displayed.
[0105] Figure 3 This is a schematic diagram of the structure of a query term processing device according to an embodiment of the present invention, such as... Figure 3 As shown, a query term processing device includes an acquisition module, a candidate acquisition module, a prediction module, a filtering module, and a display module, wherein:
[0106] The retrieval module is used to retrieve the current query scenario;
[0107] The candidate acquisition module is used to acquire multiple candidate query terms that match the current query scenario based on the current query scenario.
[0108] The prediction module is used to predict the search results of each of the multiple candidate query terms, as well as the total probability that the search results will be used by the user to perform multiple actions.
[0109] The filtering module is used to filter out multiple query terms to be displayed from the multiple candidate query terms based on their respective search results and corresponding total probabilities.
[0110] The display module is used to display the multiple query terms to be displayed.
[0111] Optionally, as an embodiment, it also includes:
[0112] The reference feature acquisition module is used to acquire reference features of the current query scenario, wherein the reference features of the current query scenario include at least one of the following: current time feature, current geographical location feature, and current user feature;
[0113] The prediction module includes:
[0114] The total probability acquisition unit is used to acquire the historical search results of each of the multiple candidate query terms, and the total probability that the historical search results are used by the user to perform multiple actions.
[0115] The estimation unit is used to estimate the search results of each of the multiple candidate query terms and the total probability that the search results are performed by the user on multiple actions based on the historical search results of each of the multiple candidate query terms, the total probability that the historical search results are performed by the user on multiple actions, and the reference features of the current query scenario.
[0116] Optionally, as an embodiment, when the current query scenario is that the user inputs the current query term, it further includes:
[0117] The result acquisition module is used to acquire the search results for the current query term;
[0118] The candidate acquisition module includes:
[0119] The candidate acquisition unit is used to acquire multiple candidate query terms whose relevance to the current query term is greater than a preset threshold, when the number of search results for the current query term is less than a preset number.
[0120] Optionally, as an embodiment, when the current query scenario is that the user inputs the current query term, it further includes:
[0121] Another result acquisition module is used to acquire the search results for the current query term;
[0122] The detection module is used to detect whether the user performs any of the multiple behaviors on the search results of the current query term;
[0123] The candidate acquisition module includes:
[0124] Another candidate acquisition unit is used to acquire, based on the current query term, multiple candidate query terms whose relevance to the current query term is greater than a preset threshold, when it is detected that the user has not performed any of the multiple actions on the search results of the current query term.
[0125] Optionally, as an embodiment, it also includes:
[0126] The log acquisition module is used to acquire the user's historical search logs. The historical search logs include multiple historical search records. Each historical search record includes at least: historical query terms, search results for the historical query terms, and actions performed by the user on the search results for the historical query terms.
[0127] A tagging module is used to tag the historical query terms with corresponding labels based on the search results of the historical query terms and the actions performed by the user on the search results of the historical query terms.
[0128] The training module is used to train a pre-defined model using multiple historical query terms with labels as training samples, thereby obtaining a query term prediction model.
[0129] The prediction module includes:
[0130] The determining unit is used to input the plurality of candidate query terms into the query term prediction model, determine the search results of each of the plurality of candidate query terms, and the total probability that the search results are performed by the user in multiple actions.
[0131] Optionally, as an embodiment, each historical search record also includes reference features of the historical query scenario, which include at least one of the following: the time feature of inputting the historical query term, the geographical location feature when inputting the historical query term, and the user feature of the user when inputting the historical query term;
[0132] The training module includes:
[0133] The training unit is used to train the preset model using multiple historical query terms with labels and their corresponding historical query scenarios as training samples, so as to obtain the query term prediction model.
[0134] The device further includes:
[0135] A reference feature acquisition module is used to obtain reference features for the current query scenario;
[0136] The prediction module includes:
[0137] The result prediction unit is used to input the multiple candidate query terms and the reference features of the current query scenario into the query term prediction model to determine the search results of each of the multiple candidate query terms, as well as the total probability that the search results will be used by the user to perform multiple actions.
[0138] Optionally, as an embodiment, there is a temporal relationship among the various behaviors; the training module includes:
[0139] The first loss acquisition unit is used to obtain a first loss value by using the labels carried by each of the multiple historical query terms and the prediction results of the preset model for each of the multiple historical query terms.
[0140] The second loss acquisition unit is used to obtain a second loss value when the magnitude relationship between the prediction results of two behaviors of a historical query term does not match the temporal relationship between the two behaviors.
[0141] The parameter update unit is used to update the model parameters of the preset model based on the first loss value and the second loss value to obtain the query term prediction model.
[0142] It should be noted that the device embodiments are similar to the method embodiments, so the description is relatively simple. For relevant details, please refer to the method embodiments.
[0143] This invention also provides an electronic device, including a processor, a memory, and a computer program stored in the memory and executable on the processor. When the processor executes the program, it implements the query term processing method disclosed in this application.
[0144] This invention also provides a computer-readable storage medium storing a computer program, which, when executed, implements the query term processing method disclosed in this application.
[0145] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other.
[0146] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, apparatus, or computer program products. Therefore, embodiments of the present invention can take the form of entirely hardware embodiments, entirely software embodiments, or embodiments combining software and hardware aspects. Furthermore, embodiments of the present invention can take the form of computer program products implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0147] Embodiments of the present invention are described with reference to flowchart illustrations and / or block diagrams of methods, apparatuses, electronic devices, and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing terminal device to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing terminal device, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0148] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing terminal device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0149] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal equipment, causing a series of operational steps to be performed on the computer or other programmable terminal equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable terminal equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0150] Although preferred embodiments of the present invention have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments as well as all changes and modifications falling within the scope of the embodiments of the present invention.
[0151] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or terminal device that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or terminal device. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or terminal device that includes said element.
[0152] The foregoing has provided a detailed description of a query term processing method, apparatus, electronic device, and storage medium provided in this application. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only for the purpose of helping to understand the method and core ideas of this application. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this application. Therefore, the content of this specification should not be construed as a limitation of this application.
Claims
1. A query term processing method, characterized in that, include: Get the current query scenario; Based on the current query scenario, obtain multiple candidate query terms that match the current query scenario; Estimate the search results for each of the multiple candidate query terms, and the total probability that the search results will be used by the user to perform multiple actions; Based on the search results and corresponding total probabilities of the multiple candidate query terms, multiple query terms to be displayed are selected from the multiple candidate query terms; Display the multiple query terms to be shown; The method also includes: obtaining the user's historical search logs, which include multiple historical search records, each of which includes at least: historical query terms, search results for the historical query terms, and actions performed by the user on the search results for the historical query terms; labeling the historical query terms with corresponding tags based on the search results for the historical query terms and the actions performed by the user on the search results for the historical query terms; training a preset model using multiple labeled historical query terms as training samples to obtain a query term prediction model; and predicting the search results for each of the multiple candidate query terms, and the total probability that the search results will be used by the user to perform multiple actions, including: inputting the multiple candidate query terms into the query term prediction model to determine the search results for each of the multiple candidate query terms, and the total probability that the search results will be used by the user to perform multiple actions.
2. The method according to claim 1, characterized in that, Also includes: Obtain reference features for the current query scenario, wherein the reference features for the current query scenario include at least one of the following: current time features, current geographical location features, and current user features; Estimate the search results for each of the multiple candidate query terms, and the total probability that the search results are performed by the user in multiple actions, including: obtaining the historical search results for each of the multiple candidate query terms, and the total probability that the historical search results are performed by the user in multiple actions; Based on the historical search results of each of the multiple candidate query terms, the total probability that the user performs multiple actions on the historical search results, and the reference features of the current query scenario, the search results of each of the multiple candidate query terms and the total probability that the user performs multiple actions on the search results are estimated.
3. The method according to claim 1, characterized in that, When the current query scenario is that the user inputs the current query term, the method further includes: obtaining the search results of the current query term; and obtaining multiple candidate query terms with a relevance greater than a preset threshold based on the current query term, including: when the number of search results for the current query term is less than a preset number, obtaining multiple candidate query terms with a relevance greater than a preset threshold based on the current query term.
4. The method according to claim 1, characterized in that, When the current query scenario involves a user inputting a current query term, the method further includes: obtaining the search results for the current query term; detecting whether the user performs any of the multiple actions on the search results for the current query term; and obtaining multiple candidate query terms with a relevance greater than a preset threshold based on the current query term, including: if it is detected that the user has not performed any of the multiple actions on the search results for the current query term, obtaining multiple candidate query terms with a relevance greater than a preset threshold based on the current query term.
5. The method according to claim 1, characterized in that, Each historical search record also includes reference features of the historical query scenario, which include at least one of the following: the time feature of entering the historical query term, the geographical location feature when entering the historical query term, and the user feature of the user when entering the historical query term; The method trains a preset model using multiple historical query terms with tags as training samples to obtain a query term prediction model. This includes: training the preset model using multiple historical query terms with tags and their corresponding historical query scenarios as training samples to obtain the query term prediction model; the method further includes: obtaining reference features of the current query scenario; and predicting the search results for each of the multiple candidate query terms, and the total probability that the search results will be used by the user to perform multiple actions, including: inputting the multiple candidate query terms and the reference features of the current query scenario into the query term prediction model to determine the search results for each of the multiple candidate query terms, and the total probability that the search results will be used by the user to perform multiple actions.
6. The method according to claim 1 or 5, characterized in that, There is a temporal relationship among the various behaviors; The preset model is trained to obtain a query term prediction model, including: obtaining a first loss value by using the labels carried by each of the multiple historical query terms and the prediction results of the preset model for each of the multiple historical query terms; When the magnitude relationship between the prediction results of two behaviors of a historical query term does not match the temporal relationship between the two behaviors, a second loss value is obtained; based on the first loss value and the second loss value, the model parameters of the preset model are updated to obtain the query term prediction model.
7. A query term processing device, characterized in that, include: The retrieval module is used to retrieve the current query scenario; The candidate acquisition module is used to acquire multiple candidate query terms that match the current query scenario based on the current query scenario. The prediction module is used to predict the search results of each of the multiple candidate query terms, as well as the total probability that the search results will be used by the user to perform multiple actions. The filtering module is used to filter out multiple query terms to be displayed from the multiple candidate query terms based on their respective search results and corresponding total probabilities. The display module is used to display the multiple query terms to be displayed; The method also includes: obtaining the user's historical search logs, which include multiple historical search records, each of which includes at least: historical query terms, search results for the historical query terms, and actions performed by the user on the search results for the historical query terms; labeling the historical query terms with corresponding tags based on the search results for the historical query terms and the actions performed by the user on the search results for the historical query terms; training a preset model using multiple labeled historical query terms as training samples to obtain a query term prediction model; and predicting the search results for each of the multiple candidate query terms, and the total probability that the search results will be used by the user to perform multiple actions, including: inputting the multiple candidate query terms into the query term prediction model to determine the search results for each of the multiple candidate query terms, and the total probability that the search results will be used by the user to perform multiple actions.
8. An electronic device, characterized in that, include: processor; A memory for storing processor-executable instructions; wherein the processor is configured to execute the instructions to implement the query term processing method as described in any one of claims 1 to 6.
9. A computer-readable storage medium, wherein when instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device is enabled to perform the query term processing method as described in any one of claims 1 to 6.