WO2021128729A1 - 确定搜索结果的方法、装置、设备和计算机存储介质 - Google Patents

确定搜索结果的方法、装置、设备和计算机存储介质 Download PDF

Info

Publication number
WO2021128729A1
WO2021128729A1 PCT/CN2020/092742 CN2020092742W WO2021128729A1 WO 2021128729 A1 WO2021128729 A1 WO 2021128729A1 CN 2020092742 W CN2020092742 W CN 2020092742W WO 2021128729 A1 WO2021128729 A1 WO 2021128729A1
Authority
WO
WIPO (PCT)
Prior art keywords
model
search
query
user
sub
Prior art date
Application number
PCT/CN2020/092742
Other languages
English (en)
French (fr)
Other versions
WO2021128729A9 (zh
Inventor
黄际洲
王海峰
张伟
Original Assignee
百度在线网络技术(北京)有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 百度在线网络技术(北京)有限公司 filed Critical 百度在线网络技术(北京)有限公司
Priority to US17/602,304 priority Critical patent/US11734373B2/en
Priority to EP20904682.0A priority patent/EP3937032A4/en
Priority to JP2022506430A priority patent/JP7379804B2/ja
Priority to KR1020217039536A priority patent/KR20220003085A/ko
Publication of WO2021128729A1 publication Critical patent/WO2021128729A1/zh
Publication of WO2021128729A9 publication Critical patent/WO2021128729A9/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/953Querying, e.g. by the use of web search engines
    • G06F16/9538Presentation of query results
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/903Querying
    • G06F16/9035Filtering based on additional data, e.g. user or group profiles
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/953Querying, e.g. by the use of web search engines
    • G06F16/9535Search customisation based on user profiles and personalisation

Definitions

  • This application relates to the field of computer application technology, in particular to methods, devices, equipment and computer storage media for determining search results in the field of intelligent search.
  • the traditional related entity recommendation only considers the user's current search keywords. For the same search keyword, the same related entity recommendation is performed for all users. However, this situation cannot solve the problem of inaccurate related entities of ambiguous search keywords. For example, if the user's current search keyword is "Chicago", it is impossible to know whether the user refers to a city, movie, or opera. Therefore, the user's needs cannot be accurately reflected when recommending related entities.
  • the present application provides a method, device, device, and computer storage medium for determining search results, so as to provide users with search results that more accurately reflect user needs.
  • this application provides a method for determining search results, which includes:
  • the result ranking model scores the candidate search results, determines the search result corresponding to the current query, and the second duration is greater than the first duration;
  • the search result ranking model determines the score of the candidate results according to the first similarity and the second similarity, and the first similarity is the vector representation of the current query and the user’s
  • the second similarity is the vector representation of the current query and the search history information of the user within the second time period
  • the similarity between the integration of the vector representation and the vector representation of the candidate search result is the vector representation of the candidate results according to the first similarity and the second similarity.
  • the search history information of the user within the first time period includes: a query sequence before the current query in the same session and a clicked search result corresponding to each query in the query sequence;
  • the search history information of the user in the second time period includes: queries searched by the user in the second time period and search results clicked on.
  • the vector representation of the search history information of the user within the first time period is obtained in the following manner:
  • the vector representation of each query in the query sequence and the vector representation of the clicked search result corresponding to each query are weighted using an attention mechanism to obtain a vector representation of the search history information of the user within the first time period.
  • the vector representation of the search history information of the user in the second time period is obtained in the following manner:
  • the word set uses the distributed word bag PV-DBOW of the sentence vector to perform encoding processing to obtain the vector representation of the search history information of the user in the second time period.
  • the candidate search results include related webpages or related entities
  • the vector representation of related entities is: an integrated vector representation of the identification, name, and entity description of the related entities.
  • the method further includes:
  • the search result corresponding to the current query is displayed on the search result page.
  • this application provides a method for training a search result ranking model, the method including:
  • the training samples include: sample query, search history information within the first period of time before the user enters the sample query, search history information within the second period of time before the user enters the sample query, and corresponding to the sample query Search results and the clicked status of search results;
  • the input of the ranking model includes the sample query, the search history information of the user in the first time period before inputting the sample query, and the first time before the user inputting the sample query.
  • the search history information within two hours and the search results corresponding to the sample query
  • the output of the ranking model includes the score of each search result;
  • the score of each search result by the ranking model is determined according to the first similarity and the second similarity
  • the first similarity is the similarity between the integration of the vector representation of the sample query and the vector representation of the search history information within the first time period and the vector representation of the search result
  • the degree is the similarity between the integration of the vector representation of the sample query and the vector representation of the search history information within the second period of time and the vector representation of the search result
  • the training objective includes: maximizing the search result The correlation between the clicked status and the score of the search result;
  • the search history information for the first time period before the user enters the sample query includes: the query sequence before the sample query in the same session and the clicked search result corresponding to each query in the query sequence ;
  • the search history information of the user within the second time period before inputting the sample query includes: the query searched by the user during the second time period before inputting the sample query and the search result clicked.
  • the vector representation of the search history information in the first time period before the user inputs the sample query is obtained in the following manner:
  • the vector representation of each query in the query sequence and the vector representation of the clicked search result corresponding to each query are weighted using an attention mechanism to obtain the vector representation of the search history information of the user within the first time period.
  • the vector representation of the search history information within the second period of time before the user enters the sample query is obtained in the following manner:
  • the word set uses the distributed word bag PV-DBOW of the sentence vector to perform encoding processing to obtain the vector representation of the search history information of the user in the second time period before inputting the sample query.
  • the search results include related webpages or related entities
  • the vector representation of related entities is: an integrated vector representation of the identification, name, and entity description of the related entities.
  • the search results include: a first type of search result and a second type of search result;
  • the ranking model includes: a shared vector sub-model, a first ranking sub-model, and a second ranking sub-model;
  • Joint training is performed on the first ranking sub-model and the second ranking sub-model to achieve a preset training goal, and the training goal includes: maximizing the click status of the first type of search result and the score of the first type of search result And maximize the correlation between the second type of search result being clicked on and the second type of search result’s score;
  • the search result ranking model is obtained by using one of the first ranking sub-model and the second ranking sub-model and the shared vector sub-model.
  • the joint training of the first ranking sub-model and the second ranking sub-model includes:
  • the first ranking sub-model and the second ranking sub-model are trained each time, and all the sub-models are updated using the outputs of the first ranking sub-model and the second ranking sub-model Model parameters.
  • this application provides a device for determining search results, the device including:
  • the acquiring unit is configured to acquire the current query of the user, the search history information of the user in the first time period, the search history information of the user in the second time period, and the candidate search results of the current query;
  • the determining unit is used to input the current query, the search history information of the user in the first time period, the search history information of the user in the second time period, and the candidate search results of the current query into the search result ranking model according to Scoring the candidate search results by the search result ranking model to determine the search result corresponding to the current query, and the second duration is greater than the first duration;
  • the search result ranking model determines the score of the candidate results according to the first similarity and the second similarity, and the first similarity is the vector representation of the current query and the user’s
  • the second similarity is the vector representation of the current query and the search history information of the user within the second time period
  • the similarity between the integration of the vector representation and the vector representation of the candidate search result is the vector representation of the candidate results according to the first similarity and the second similarity.
  • this application provides a device for training a search result ranking model, the device including:
  • the sample obtaining unit is used to obtain training samples by using the search log.
  • the training samples include: sample query, search history information of the user in the first time period before inputting the sample query, and search history of the user in the second time period before inputting the sample query Information, search results corresponding to the sample query, and the clicked status of the search results;
  • the model training unit is used to train the ranking model by using the training samples to achieve the preset training goal; wherein the input of the ranking model includes the sample query, the search history information of the user in the first time period before the user input the sample query, and the user The search history information within the second time period before the sample query is input and the search results corresponding to the sample query, the output of the ranking model includes a score for each search result; the ranking model for each search result is based on the first similarity And the second similarity determination, the first similarity is the similarity between the integration of the vector representation of the sample query and the vector representation of the search history information within the first duration and the vector representation of the search result The second similarity is the similarity between the integration of the vector representation of the sample query and the vector representation of the search history information within the second time period and the vector representation of the search result; the training target Including: maximizing the correlation between the clicked status of the search result and the score of the search result;
  • the model acquisition unit is used to obtain the search result ranking model by using the training ranking model.
  • this application provides an electronic device, including:
  • At least one processor At least one processor
  • a memory communicatively connected with the at least one processor; wherein,
  • the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor, so that the at least one processor can execute the method as described above.
  • the present application provides a non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to make the computer execute the method described above.
  • this application comprehensively considers the search context information reflected in the user's short-term search history and the user's personalized preferences reflected in the long-term search history when determining the search results, thereby improving the accuracy of the search results.
  • entity recommendation it can eliminate the ambiguity of the current query and provide more accurate related entities that meet the user's search requirements.
  • Figure 1 provides an example diagram of related entity recommendation on the search result page
  • FIG. 2 is a flowchart of a method for recommending related entities according to Embodiment 1 of this application;
  • FIG. 3 is a schematic structural diagram of an entity sorting model provided in Embodiment 1 of this application.
  • FIG. 5 is a schematic structural diagram of an entity sorting model provided in Embodiment 3 of this application.
  • Fig. 6 is a structural diagram of an apparatus for determining search results provided by an embodiment of the application.
  • FIG. 7 is a structural diagram of an apparatus for training a search result ranking model provided by an embodiment of the application.
  • Fig. 8 is a block diagram of an electronic device used to implement an embodiment of the present application.
  • the method provided in this application is applied to the search engine of a computer system, executed by a computer or a processor, and can be set on the server side to improve the effect of determining search results by using historical queries of users.
  • the browser or client sends the current query to the server, and the server determines the search result using the method provided in the embodiment of this application, and then sends the search result to the browser.
  • Server or client The search results involved in the embodiments of the present application may include related entities or related webpages.
  • the method provided by this application can be used to recommend related entities for the current query, and can also be used to recommend related webpages for the current query.
  • the related entity recommendation for the current query is taken as an example, and the principles for the recommendation of related webpages are similar.
  • the application will be described in detail below in conjunction with embodiments.
  • FIG. 2 is a flowchart of a method for recommending related entities provided in Embodiment 1 of this application. As shown in FIG. 2, the method may include the following steps:
  • the user’s current query search keyword
  • the user’s search history information in the first time period the user’s search history information in the second time period
  • candidate related entities of the current query are obtained, where the second time period is greater than the first time period.
  • the traditional entity recommendation system is only based on the recommendation of the current query.
  • the current query refers to the query currently entered by the user, and cannot understand the user's real search needs, resulting in inaccurate recommendation of related entities and does not meet the user's needs.
  • search history can provide very valuable clues, which can better help capture the real needs of users.
  • Search history can be divided into two types: short-term search history and long-term search history.
  • the short-term search history may correspond to the search history information of the user in this application in the first time period
  • the long-term search history may correspond to the search history information of the user in this application in the second time period.
  • the short-term search history may include previous user behaviors in the same search session as the current query, for example, the query sequence before the current query in the same session and the clicked search result corresponding to each query in the query sequence.
  • the clicked search result may be the clicked webpage in the search result page, or the clicked related entity.
  • the short-term search history can be regarded as the contextual information of the current query, which reflects the short-term instant interest of the user. If the user searched for "Dream Girl" in the same session before searching for "Chicago", then the user is more likely to be more interested in the movie. Similarly, if the user previously clicked on search results and recommended entities related to opera, the user may be more interested in opera.
  • the above-mentioned "session” refers to a search session, and a widely used method for determining a search session can be used here. If the user does not have any search behavior before the first time period (for example, 30 minutes), the first search behavior within the first time period can be used as the start of the current session. In other words, if the user has continuous search behaviors within 30 minutes, then the continuous search behaviors within 30 minutes belong to the same session.
  • the first time period for example, 30 minutes
  • Long-term search history refers to all user search behaviors in the second time period before the current query, including all user search behaviors in all sessions of the user during the second time period, including the entered query and the webpage clicked on the search result page , Clicked related entities.
  • the long-term search history reflects the user's long-term inherent interest preferences. If a user frequently searches for opera-related queries, clicks on opera-related web pages and related entities, then when the user searches for "Chicago", it is best to recommend opera-related entities to the user. Long-term search history is very helpful to build a personalized entity recommendation system.
  • the above-mentioned first time length can be selected in a minute level or an hour level, for example, 30 minutes.
  • the above-mentioned second duration can be selected from day level or month level, for example, 3 months.
  • the application embodiment does not limit the acquisition method of the candidate related entities of the current query. For example, entities that co-occur with the current query in a window of a preset length can be selected from the text set, and the entities that meet the preset number of co-occurrences are regarded as the current query's entities.
  • Candidate related entities For example, entities that co-occur with the current query in a window of a preset length can be selected from the text set, and the entities that meet the preset number of co-occurrences are regarded as the current query's entities.
  • the user’s current query, the user’s search history information in the first time period, the user’s search history information in the second time period, and the candidate related entities of the current query are input into the entity ranking model, and the candidates are related according to the entity ranking model.
  • the score of the entity determines the relevant entity recommended by the current query.
  • the search result ranking model determines the score of the candidate results based on the first similarity and the second similarity.
  • the first similarity is the integration and candidate of the vector representation of the current query and the vector representation of the user’s search history information within the first time period.
  • the similarity between the vector representations of related entities, and the second similarity is the similarity between the integration of the vector representation of the current query and the vector representation of the user's search history information in the second time period and the vector representation of the candidate related entities.
  • the entity ranking model is used to score each candidate related entity of the current query, so as to determine the recommended related entity of the current query according to the score.
  • candidate related entities whose scores meet certain requirements may be used as recommendation related entities, and the display positions of the recommendation related entities may be further ranked according to the scores.
  • the score meeting certain requirements may include: the score is ranked in the top M, and M is a preset positive integer; or the score exceeds a preset threshold.
  • the entity ranking model is pre-trained from training data.
  • the training method of the entity ranking model will be described in detail in the second embodiment.
  • the entity ranking model obtained by training can output related entities for each candidate related entity for the input user's current query, the user's search history information in the first time period, the user's search history information in the second time period, and the candidate related entities of the current query. Rating.
  • the structure of the entity sorting model can be as shown in Figure 3, which consists of a vector sub-model and a sorting sub-model.
  • the current search keyword query, the user's search history information in the first time period, and the user's search history information in the second time period are used as the input of the vector sub-model.
  • the vector sub-model outputs the vector representation of the current query and the user in the first time. Integration of vector representations of search history information within a time period.
  • the output of the vector sub-model and the candidate related entities of the current query are used as the input of the ranking sub-model, and the ranking model outputs the scores of the candidate related entities.
  • the input current query which is represented as q t in the figure, it can be encoded by a neural network, and the vector representation v q of the current query is obtained.
  • the neural network is preferably BiLSTM (Bidirectional Long Short-Term Memory).
  • q t [w 1 ,w 2 ,...,w n ]
  • the word w i is transformed into a vector representation through a word vector matrix, and then a forward LSTM and a backward LSTM are used to convert
  • the search query q t is separately encoded as a hidden vector: with Finally with Concatenated together as a vector representation of the search query q t Among them, [;] represents the splicing of vectors.
  • C i may include the clicked webpage and/or clicked related entities.
  • each q i can be encoded by a neural network (in a manner consistent with q t ) to obtain a vector representation v qi , and then the clicked webpage in C i can be represented as a vector Represent the clicked related entity in C i as a vector
  • l is the number of the clicked page C i
  • g is C i is the number of hits are related entities.
  • a neural network can be used to encode the title of each clicked webpage to obtain the vector of each clicked webpage.
  • the vector representation of the entity's identity, name, and entity description can be spliced, combined with certain offset parameters for activation processing, and the vector representation of each clicked entity can be obtained
  • This method of determining the vector representation of an entity can effectively solve the OOV (Out-Of-Vocabulary) problem and the ambiguity problem.
  • the entity description can be understood as the "description text" of the entity to describe the meaning of an entity.
  • the first sentence of the encyclopedia entry corresponding to the entity can be used, or the abstract of the encyclopedia entry corresponding to the entity can be used.
  • the function symbol Attention w ( ⁇ , ⁇ ) represents a weighted representation method based on the attention mechanism.
  • v a is the model parameter, which is learned during the model training process.
  • u For the user's search history information in the second time period, since it represents the user's personalized preference, it is denoted as u in the figure, which is regarded as a user representation.
  • PV-DBOW Distributed Bag of Words version of Paragraph Vector
  • the vector representation of history represented as v u in the figure.
  • PV-DBOW is currently a relatively mature processing method, which can output the corresponding vector representation in the case of the input word set.
  • v q and v c are spliced together to obtain an integrated vector representation v cq .
  • other vector integration methods can also be used.
  • other vector integration methods can also be used.
  • the vector sub- model outputs two integrated vector representations: v cq and v uq.
  • v cq , v uq and candidate related entities e are input to the ranking sub-model.
  • the ranking sub-model uses two similarities to rank candidate related entities e: the first similarity and the second similarity.
  • the first similarity is the similarity between the integration of the vector representation of the current query and the vector representation of the user's search history information within the first time period and the vector representation of the candidate related entities.
  • S t ,q t ) can be calculated using the following formula:
  • V represents the vector e e-related entity
  • said vector e entity identification, entity name and description may be a rear spliced vector e entity binding constant offset parameter obtained after the activation treatment represented v e.
  • v s is a vector representation obtained by mapping v cq through a fully connected layer (FC layer), which can be calculated using the following formula:
  • W s is the parameter matrix
  • b s is the offset vector
  • ⁇ ( ⁇ ) is the activation function
  • W s and b s are model parameters, which are learned during model training.
  • the second similarity is the similarity between the integration of the vector representation of the current query and the vector representation of the user's search history information within the second time period and the vector representation of the candidate related entities.
  • u,q t ) can be calculated using the following formula:
  • v p is a vector representation obtained by mapping v uq through a fully connected layer (FC layer), which can be calculated using the following formula:
  • W u is a parameter matrix
  • b u is the offset vector
  • ⁇ ( ⁇ ) is the activation function.
  • Wu and b u are model parameters, which are learned during model training.
  • the ranking sub-model can comprehensively use the above-mentioned first similarity and second similarity when scoring the candidate related entity e, which can specifically be:
  • W f is the parameter matrix
  • b f is the offset value
  • ⁇ ( ⁇ ) is the activation function.
  • W f and b f are model parameters, which are learned during model training.
  • the determined recommendation related entities are displayed in the search result page.
  • the recommendation related entity may be displayed in the search result page of the current query.
  • the recommended related entities are displayed in the right area of the search result page of the current query.
  • it can also be displayed in other positions on the search result page, and the present application does not limit the display position of the recommended related entity in the search result page.
  • the user enters the current query "Chicago”, the user also searched for "Titanic” and “Moulin Rouge” in the same session, and searched and clicked on a lot of movie-related content within three months.
  • the candidate related entity related to the movie has a higher score, so the candidate related entity related to the movie will be regarded as the recommendation related entity.
  • the ambiguity in the current query can be eliminated, which not only considers the contextual information, but also considers the personalized preferences reflected by the user's long-term search history, so that the related entity recommendation can be more in line with the actual needs of the user.
  • Fig. 4 is a flow chart of the method for training an entity ranking model provided in the second embodiment of the application. As shown in Fig. 4, the method may include the following steps:
  • the search log is used to obtain training samples.
  • the acquired training samples include the sample query, the search history information of the user in the first time period before entering the sample query, the search history information of the user in the second time period before entering the sample query, the search results corresponding to the sample query, and the clicks of the search results Situation, the second duration is greater than the first duration.
  • the search logs for a continuous period of time are obtained, and the above-mentioned training samples are extracted from them.
  • the search history information in the first time period before the user enters the sample query may include previous user behaviors in the same search session as the sample query, for example, the previous user behavior in the same session before the sample query.
  • the query sequence and the clicked search result corresponding to each query in the query sequence but as a preferred embodiment, in addition to the clicked search result as a positive example in the training sample, the search result that is not clicked can also be obtained as a negative example.
  • the search result can be a webpage in a search result page or a related entity.
  • the search history information in the second time period before the user enters the sample query may include all user search behaviors in all sessions of the user during the second time period, including the entered query, the webpage clicked on the search result page, and the related entities clicked .
  • the ranking model is trained using the training samples to achieve a preset training goal.
  • the input of the ranking model includes the sample query, the search history information of the user in the first time period before entering the sample query, the search history information of the user in the second time period before entering the sample query, and the related entities corresponding to the sample query.
  • the output includes a score for each related entity.
  • the ranking model’s scoring of each related entity is determined based on the first similarity and the second similarity.
  • the first similarity is the integration of the vector representation of the sample query and the vector representation of the search history information in the first time period and the correlation between the sample query.
  • the similarity between the vector representations of the entities, the second similarity is the integration of the vector representation of the sample query and the vector representation of the search history information within the second time length and the similarity between the vector representations of the related entities corresponding to the sample query .
  • the training objectives include: maximizing the correlation between the clicked status of the related entity and the score of the related entity.
  • the model may be trained to sort shown in FIG. 3, the sample query q t as in FIG. 3, the user search history information in the first period of time as in FIG. 3, the input sample S t before the query ,
  • the search history information in the second time period before the user enters the sample query is taken as u in Figure 3, and after the vector sub- model processing, two integrated vector representations are obtained: v cq and v uq, where v cq is the vector of q t represents the vector v q and v c S t represents the integration obtained, v uq q t is represented by a vector and the vector v q v u u represents the integration obtained.
  • the relevant record in the first embodiment which will not be repeated here.
  • the sorting sub-model obtains the first similarity P(e
  • the model parameters can be updated iteratively through pairwise ranking learning and stochastic gradient descent.
  • the training target of the ranking sub-model may adopt a form of minimizing a preset loss function.
  • the loss function Loss can be determined by the negative log likelihood function of the clicked entity in the training sample, for example:
  • e + is the clicked related entity of the sample query.
  • the set of training samples used to sort the entities.
  • E t is a collection of related entities of the sample query
  • is a preset parameter
  • the iteration stop condition may include but is not limited to: loss e converges, loss e is less than a preset threshold, or the number of iterations reaches a preset threshold.
  • an entity ranking model is obtained by using the trained ranking model.
  • the model shown in FIG. 3 can be used as the entity sorting model.
  • the entity sorting model includes a vector sub-model and a sorting sub-model.
  • the present application may provide a preferred training method through the third embodiment, and propose a multi-task learning framework, that is, the entity ranking model is obtained by the method of multi-task model joint training.
  • the entity ranking of the entity ranking model tends to recommend entities based on the most frequently mentioned meaning of the query.
  • the entity click data corresponding to the less and rarely mentioned meanings are very sparse.
  • most search engines will provide users with diverse search results. Therefore, when users search, it is easier to find results that match their own information needs in web search results compared with entity recommendation results.
  • the overall model may include a shared vector sub-model, a first ranking sub-model, and a second ranking sub-model.
  • the first sorting sub-model uses the sorting sub-model described in the second embodiment as the main task for sorting related entities.
  • the second ranking sub-model is used as an auxiliary task for ranking web pages. This kind of multi-task learning model training can use the correlation between different task models to improve the scalability and ranking effect of the model.
  • the training sample further includes the webpage search result corresponding to the sample query and the clicked status corresponding to the webpage.
  • this model can be as shown in Figure 5.
  • the sample query as q t in FIG. 5 the user inputs the first prior before the sample query search history information in the first period of time as in FIG. 5 S t, a user input samples query
  • the search history information within two hours is taken as u in Figure 5, and after the vector sub- model processing, two integrated vector representations are obtained: v cq and v uq, where v cq is represented by the vector of q t and the vector of v q and S t v c represents the integration obtained, v uq represented by the vector q t u and vector v q v u represents the integration obtained.
  • the relevant record in the first embodiment which will not be repeated here.
  • the first sorting sub-model is similar to the sorting sub-model in the second embodiment, v cq , v uq and related entities e are used as the input of the first sorting sub-model, and the sorting sub-model obtains the first similarity according to the method described in the first embodiment After the degree P(e
  • the v cq and v uq output by the vector sub-model are also used as the input of the second ranking sub-model, and the web search result d (hereinafter referred to as the candidate web page for short) is also used as the input of the second ranking sub-model.
  • the second ranking sub-model uses two similarities to rank d: the first similarity and the second similarity.
  • the first similarity in the second ranking sub-model is the similarity between the integration of the vector representation of the current query and the vector representation of the user's search history information within the first time period and the vector representation of the candidate web page.
  • S t ,q t ) can be calculated using the following formula:
  • v d represents the vector representation of the candidate web page d.
  • v r is a vector representation obtained by mapping v cq through a fully connected layer (FC layer), which can be calculated using the following formula:
  • W d is the parameter matrix
  • b d is the offset vector
  • ⁇ ( ⁇ ) is the activation function
  • W d and b d are model parameters, which are learned during model training.
  • the second similarity is the similarity between the integration of the vector representation of the current query and the vector representation of the user's search history information within the second time period and the vector representation of the candidate webpage.
  • u,q t ) can be calculated using the following formula:
  • v m is a vector representation obtained by mapping v uq through a fully connected layer (FC layer), which can be calculated using the following formula:
  • W m is the parameter matrix
  • b m is the offset vector
  • ⁇ ( ⁇ ) is the activation function
  • W m and b m are model parameters, which are learned during model training.
  • the second ranking sub-model can comprehensively use the above-mentioned first similarity and second similarity when scoring the candidate webpage d, which can specifically be:
  • W g is the parameter matrix
  • b g is the offset value
  • ⁇ ( ⁇ ) is the activation function.
  • W g and b g are model parameters, which are learned during model training.
  • one of the first ranking sub-model and the second ranking sub-model can be randomly selected for training each time, or the first ranking sub-model can be alternately selected each time. Select one of the model and the second ranking sub-model for training; and then use the output of the selected sub-model to update the model parameters of the selected sub-model and the shared vector sub-model each time.
  • the first ranking sub-model when selecting the first ranking sub-model, use training samples to train to obtain P(e
  • the model parameters of the sub-model then select the second ranking sub-model, use the training sample to train to obtain P(d
  • d + is the clicked webpage of the sample query.
  • Sorting web pages is the set of training samples corresponding to the second ranking sub-model.
  • D t is the set of candidate web pages of the sample query, and ⁇ is the preset parameter.
  • an integrated loss function can be used, for example:
  • is a hyperparameter, which can be manually set as an experimental value or an empirical value.
  • the loss is calculated in each iteration process, and then the loss is used to update the model parameters of the shared vector sub-model, the first sorting sub-model, and the second sorting sub-model until the training goal is reached. For example, loss converges, loss is less than a preset threshold, or the number of iterations reaches the preset threshold.
  • the entity ranking model is obtained by using the shared vector sub-model and the first ranking sub-model. That is to say, although in the training process, the multi-task model is used for training, that is, the second ranking sub-model assists the training of the first ranking sub-model, but the final entity ranking model used for recommendation of related entities is not Use the second ordering sub-model.
  • a related web page ranking model can also be obtained, that is, a related web page ranking model can be obtained by using the shared sub-model and the second ranking sub-model.
  • the first ranking sub-model assists the training of the second ranking sub-model, that is, the recommendation of related entities assists the ranking of related web pages.
  • the related web page ranking model obtained in this way can obtain related web pages related to the current query after inputting the current query, the user's search history information in the first time period, the user's search history information in the second time period, and the related web page collection of the current query.
  • the scores of the relevant webpages in the collection can be used to determine the relevant webpages of the current query to be displayed based on the scores, and serve as a basis for selection and ranking of the relevant webpages.
  • the foregoing embodiment is described by taking the related entities and related webpages as the first-type search results and the second-type search results respectively as examples.
  • this application is not limited to these two types of search results, and other types of search results can be used as the first type of search result and the second type of search result.
  • FIG. 6 is a structural diagram of an apparatus for determining search results provided by an embodiment of the application.
  • the apparatus may include: an acquisition unit 01 and a determination unit 02, and may also include a display unit 03.
  • the main functions of each component are as follows:
  • the obtaining unit 01 is used to obtain the user's current query, the user's search history information in the first time period, the user's search history information in the second time period, and the candidate search results of the current query.
  • the determining unit 02 is used to input the current query, the user’s search history information in the first time period, the user’s search history information in the second time period, and the candidate search results of the current query into the search result ranking model, and the search results are ranked according to the search result ranking model.
  • the score of the candidate search result determines the search result corresponding to the current query, and the second duration is greater than the first duration.
  • the search result ranking model determines the score of the candidate results based on the first similarity and the second similarity.
  • the first similarity is the integration and candidate of the vector representation of the current query and the vector representation of the user’s search history information within the first time period.
  • the vector of the search results indicates the similarity between the vector representations
  • the second similarity is the similarity between the integration of the vector representation of the current query and the vector representation of the user's search history information within the second time period and the vector representation of the candidate search results.
  • the search history information of the user in the first time period includes: the query sequence before the current query in the same session and the clicked search result corresponding to each query in the query sequence.
  • the vector representation of the search history information of the user within the first time period is obtained by the following method: the vector representation of each query in the query sequence and the vector representation of the clicked search result corresponding to each query adopts an attention mechanism Perform weighting processing to obtain a vector representation of the search history information of the user in the first time period.
  • the search history information of the user in the second period of time may include the query searched by the user in the second period of time and the search result clicked (for example, the clicked webpage and related entities).
  • the vector representation of the search history information of the user in the second time period is obtained by: obtaining the query set and the search result set clicked by the user in the second time period; performing word segmentation processing on the query set and the search result set After the union set is obtained, the word set is obtained; the word set is encoded using PV-DBOW, and the vector representation of the user's search history information in the second time period is obtained.
  • the aforementioned candidate search results may include related webpages or related entities.
  • the vector representation of related entities is: an integrated vector representation of the identification, name, and entity description of the related entities.
  • the specific process of the determining unit 02 using the search ranking model to determine the search results can be found in the relevant records in the first embodiment, which is not described in detail here.
  • the display unit 03 is used to display the search result corresponding to the current query in the search result page, that is, the search result corresponding to the current query is included in the search result page and sent to the browser or client.
  • FIG. 7 is a structural diagram of an apparatus for training a search result ranking model provided by an embodiment of the application.
  • the apparatus may include: a sample acquisition unit 11, a model training unit 12, and a model acquisition unit 13.
  • the main functions of each component are as follows:
  • the sample obtaining unit 11 is used to obtain training samples by using the search log.
  • the training samples include: sample query, search history information in the first time period before the user enters the sample query, and search history information in the second time period before the user enters the sample query , The search results corresponding to the sample query and the clicked status of the search results.
  • the model training unit 12 is used to train the ranking model with training samples to achieve the preset training goals;
  • the input of the ranking model includes sample query, search history information of the user in the first time period before inputting the sample query, and user input samples
  • the output of the ranking model includes the score of each search result; the ranking model’s score of each search result is determined based on the first similarity and the second similarity.
  • the first similarity is the similarity between the vector representation of the sample query and the vector representation of the search history information within the first duration and the vector representation of the search results.
  • the second similarity is the vector representation of the sample query and the second The similarity between the integration of the vector representation of the search history information and the vector representation of the search result within the duration; the training objective includes: maximizing the correlation between the clicked condition of the search result and the score of the search result.
  • the model obtaining unit 13 is configured to obtain the search result ranking model by using the ranking model obtained through training.
  • the search history information in the first time period before the user inputs the sample query includes: the query sequence before the sample query in the same session and the clicked search result corresponding to each query in the query sequence.
  • the vector representation of the search history information in the first time period before the user enters the sample query is obtained by the following method: the vector representation of each query in the query sequence, and the vector representation of the clicked search result corresponding to each query is performed using the attention mechanism
  • the weighting process obtains the vector representation of the search history information within the first time period before the user enters the sample query.
  • the search history information of the user within the second time period before inputting the sample query includes: the query searched by the user during the second time period before inputting the sample query and the search result clicked.
  • the vector representation of the search history information in the second time period before the user enters the sample query is obtained by: obtaining the query set searched by the user in the second time period before entering the sample query and the search result set clicked; and the query set After performing word segmentation with the search result set, the union set is obtained to obtain the word set; the word set is encoded using PV-DBOW to obtain the vector representation of the search history information within the second time period before the user enters the sample query.
  • model training unit 12 to train the search result ranking model can be found in the relevant records in the second embodiment, which will not be described in detail here.
  • the above-mentioned search results include: first-type search results and second-type search results.
  • the sorting model includes: a shared vector sub-model, a first sorting sub-model, and a second sorting sub-model.
  • the model training unit 12 is specifically used to input and share the sample query, the search history information of the user in the first time period before inputting the sample query, the search history information of the user in the second time period before inputting the sample query, and the search result corresponding to the sample query.
  • the vector sub-model obtains the integration of the vector representation of the sample query output by the shared vector sub-model and the vector representation of the search history information in the first time period, as well as the vector representation of the sample query and the vector representation of the search history information in the second time period.
  • the model acquisition unit 13 is specifically configured to obtain the search result ranking model by using one of the first ranking sub-model and the second ranking sub-model and the shared vector sub-model after the training of the model training unit is completed.
  • model training unit 12 when the model training unit 12 performs joint training on the first ranking sub-model and the second ranking sub-model, it specifically executes:
  • the first ranking sub-model and the second ranking sub-model are trained each time, and the model parameters of all the sub-models are updated using the outputs of the first ranking sub-model and the second ranking sub-model.
  • the specific process of training the search result ranking model by the model training unit 12 in this manner can refer to the record in the third embodiment, which is not described in detail here.
  • the present application also provides an electronic device and a readable storage medium.
  • FIG. 8 it is a block diagram of an electronic device according to a method for determining a search result according to an embodiment of the present application.
  • Electronic devices are intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers.
  • Electronic devices can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices.
  • the components shown herein, their connections and relationships, and their functions are merely examples, and are not intended to limit the implementation of the application described and/or required herein.
  • the electronic device includes: one or more processors 801, a memory 802, and interfaces for connecting various components, including a high-speed interface and a low-speed interface.
  • the various components are connected to each other using different buses, and can be installed on a common motherboard or installed in other ways as needed.
  • the processor may process instructions executed in the electronic device, including instructions stored in or on the memory to display graphical information of the GUI on an external input/output device (such as a display device coupled to an interface).
  • an external input/output device such as a display device coupled to an interface.
  • multiple processors and/or multiple buses can be used with multiple memories and multiple memories.
  • multiple electronic devices can be connected, and each device provides part of the necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system).
  • a processor 801 is taken as an example.
  • the memory 802 is a non-transitory computer-readable storage medium provided by this application.
  • the memory stores instructions executable by at least one processor, so that the at least one processor executes the method for determining search results provided in this application.
  • the non-transitory computer-readable storage medium of the present application stores computer instructions, and the computer instructions are used to make a computer execute the method for determining search results provided by the present application.
  • the memory 802 as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs, non-transitory computer executable programs and modules, such as program instructions/modules corresponding to the method for determining search results in the embodiments of the present application.
  • the processor 801 executes various functional applications and data processing of the server by running non-transient software programs, instructions, and modules stored in the memory 802, that is, realizing the method of determining search results in the foregoing method embodiments.
  • the memory 802 may include a program storage area and a data storage area.
  • the program storage area may store an operating system and an application program required by at least one function; the data storage area may store data created according to the use of the electronic device.
  • the memory 802 may include a high-speed random access memory, and may also include a non-transitory memory, such as at least one magnetic disk storage device, a flash memory device, or other non-transitory solid-state storage devices.
  • the memory 802 may optionally include a memory remotely provided with respect to the processor 801, and these remote memories may be connected to the electronic device through a network. Examples of the aforementioned networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.
  • the electronic device of the method for determining search results may further include: an input device 803 and an output device 804.
  • the processor 801, the memory 802, the input device 803, and the output device 804 may be connected through a bus or in other ways. In FIG. 8, the connection through a bus is taken as an example.
  • the input device 803 can receive input digital or character information, and generate key signal input related to user settings and function control of the electronic device, such as touch screen, keypad, mouse, track pad, touch pad, indicator stick, one or more Input devices such as mouse buttons, trackballs, joysticks, etc.
  • the output device 804 may include a display device, an auxiliary lighting device (for example, LED), a tactile feedback device (for example, a vibration motor), and the like.
  • the display device may include, but is not limited to, a liquid crystal display (LCD), a light emitting diode (LED) display, and a plasma display. In some embodiments, the display device may be a touch screen.
  • Various implementations of the systems and techniques described herein can be implemented in digital electronic circuit systems, integrated circuit systems, application specific ASICs (application specific integrated circuits), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: being implemented in one or more computer programs, the one or more computer programs may be executed and/or interpreted on a programmable system including at least one programmable processor, the programmable processor It can be a dedicated or general-purpose programmable processor that can receive data and instructions from the storage system, at least one input device, and at least one output device, and transmit the data and instructions to the storage system, the at least one input device, and the at least one output device. An output device.
  • machine-readable medium and “computer-readable medium” refer to any computer program product, device, and/or device used to provide machine instructions and/or data to a programmable processor ( For example, magnetic disks, optical disks, memory, programmable logic devices (PLD)), including machine-readable media that receive machine instructions as machine-readable signals.
  • machine-readable signal refers to any signal used to provide machine instructions and/or data to a programmable processor.
  • the systems and techniques described here can be implemented on a computer that has: a display device for displaying information to the user (for example, a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) ); and a keyboard and a pointing device (for example, a mouse or a trackball) through which the user can provide input to the computer.
  • a display device for displaying information to the user
  • LCD liquid crystal display
  • keyboard and a pointing device for example, a mouse or a trackball
  • Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (for example, visual feedback, auditory feedback, or tactile feedback); and can be in any form (including Acoustic input, voice input, or tactile input) to receive input from the user.
  • the systems and technologies described herein can be implemented in a computing system that includes back-end components (for example, as a data server), or a computing system that includes middleware components (for example, an application server), or a computing system that includes front-end components (for example, A user computer with a graphical user interface or a web browser, through which the user can interact with the implementation of the system and technology described herein), or includes such back-end components, middleware components, Or any combination of front-end components in a computing system.
  • the components of the system can be connected to each other through any form or medium of digital data communication (for example, a communication network). Examples of communication networks include: local area network (LAN), wide area network (WAN), and the Internet.
  • the computer system can include clients and servers.
  • the client and server are generally far away from each other and usually interact through a communication network.
  • the relationship between the client and the server is generated by computer programs that run on the corresponding computers and have a client-server relationship with each other.
  • the method, device, device, and computer storage medium provided by the embodiments of the present application can have the following advantages:
  • This application comprehensively considers the search context information reflected in the user's short-term search history and the user's personalized preferences reflected in the long-term search history when determining search results, thereby improving the accuracy of search results and making them more in line with users Search needs.
  • entity recommendation it can eliminate the ambiguity of the current query and provide more accurate related entities that meet the user's search requirements.
  • the multi-task model learning framework is used to implement auxiliary training between different search results, for example, related web pages assist the training of the ranking model of related entities. In this way, the correlation between different tasks is used to improve the scalability and accuracy of the model.
  • the multi-task model learning framework adopted in this application can alleviate the problem of sparse click data in the main task with the help of auxiliary tasks (that is, the second ranking sub-model is used as the auxiliary task of the first ranking sub-model).
  • the multi-task model framework in this application implements knowledge transfer by sharing vector representations, and the joint learning of multiple related tasks can improve the generalization ability of the model. After experimental verification, a better training effect is obtained.

Landscapes

  • Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computational Linguistics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

一种确定搜索结果的方法、装置、设备和计算机存储介质,涉及智能搜索领域。具体实现方案为:获取用户的当前query、用户在第一时长内的搜索历史信息、用户在第二时长内的搜索历史信息以及当前query的候选搜索结果,并输入搜索结果排序模型,依据对候选搜索结果的评分,确定当前query对应的搜索结果,第二时长大于第一时长;其中搜索结果排序模型对候选结果的评分依据当前query的向量表示和用户在第一时长内的搜索历史信息的向量表示的整合与候选搜索结果的向量表示之间的相似度,以及当前query的向量表示和用户在第二时长内的搜索历史信息的向量表示的整合与候选搜索结果的向量表示之间的相似度确定。

Description

确定搜索结果的方法、装置、设备和计算机存储介质
本申请要求了申请日为2019年12月27日,申请号为201911373544.1发明名称为“确定搜索结果的方法、装置、设备和计算机存储介质”的中国专利申请的优先权。
技术领域
本申请涉及计算机应用技术领域,特别涉及智能搜索领域中确定搜索结果的方法、装置、设备和计算机存储介质。
背景技术
近年来,为了给用户提供更加丰富的搜索结果以及更好的搜索体验,主流搜索引擎都为用户的搜索提供了相关实体的推荐。例如,当用户利用搜索引擎搜索关键词“芝加哥”时,在搜索结果页面中提供如图1中所示的相关实体推荐。图1中左侧部分显示“芝加哥”的文档搜索结果,右侧部分显示“芝加哥”的实体推荐结果(实体推荐结果也可以看做是一种搜索结果,是与输入搜索关键词相关的实体)。推荐诸如“旧金山湾区”、“伊利诺伊州”、“得克萨斯州”、“奥黑尔国际机场”、“密歇根湖”等等相关实体。以百度为例,相关实体推荐的结果展现在搜索结果页的右侧区域,当然,也可以展现在搜索结果页的其他区域,也可以多个类别的形式展现相关实体。
然而,传统相关实体推荐仅仅考虑了用户当前的搜索关键词,对于同一个搜索关键词而言,针对所有用户进行相同的相关实体推荐。但这种情况无法解决具有歧义的搜索关键词的相关实体不准确的问题。例如,用户当前的搜索关键词是“芝加哥”,则无法获知用户指的是城市、电 影还是歌剧,因此必然在推荐相关实体时不能准确体现用户需求。
发明内容
有鉴于此,本申请提供了一种确定搜索结果的方法、装置、设备和计算机存储介质,以便于向用户提供更准确体现用户需求的搜索结果。
第一方面,本申请提供了一种确定搜索结果的方法,该方法包括:
获取用户的当前query、所述用户在第一时长内的搜索历史信息、所述用户在第二时长内的搜索历史信息以及当前query的候选搜索结果,并输入搜索结果排序模型,依据所述搜索结果排序模型对所述候选搜索结果的评分,确定所述当前query对应的搜索结果,所述第二时长大于所述第一时长;
其中所述搜索结果排序模型对所述候选结果的评分依据第一相似度和第二相似度确定,所述第一相似度为所述当前query的向量表示和所述用户在第一时长内的搜索历史信息的向量表示的整合与所述候选搜索结果的向量表示之间的相似度,所述第二相似度为所述当前query的向量表示和所述用户在第二时长内的搜索历史信息的向量表示的整合与所述候选搜索结果的向量表示之间的相似度。
根据本申请一优选实施方式,所述用户在第一时长内的搜索历史信息包括:同一会话中在所述当前query之前的query序列和query序列中各query对应的被点击搜索结果;
所述用户在第二时长内的搜索历史信息包括:所述用户在第二时长内搜索的query和点击的搜索结果。
根据本申请一优选实施方式,所述用户在第一时长内的搜索历史信息的向量表示由以下方式得到:
将所述query序列中各query的向量表示、所述各query对应的被点击搜索结果的向量表示采用注意力机制进行加权处理,得到所述用户在第一时长内的搜索历史信息的向量表示。
根据本申请一优选实施方式,所述用户在第二时长内的搜索历史信息的向量表示由以下方式得到:
获取用户在第二时长内搜索的query集合和点击的搜索结果集合;
将所述query集合和搜索结果集合进行切词处理后求并集,得到词集合;
对所述词集合使用句向量的分布词袋PV-DBOW进行编码处理,得到所述用户在第二时长内的搜索历史信息的向量表示。
根据本申请一优选实施方式,所述候选搜索结果包括相关网页或相关实体;
其中相关实体的向量表示为:所述相关实体的标识、名称以及实体描述的整合向量表示。
根据本申请一优选实施方式,该方法还包括:
在搜索结果页中展现所述当前query对应的搜索结果。
第二方面,本申请提供了一种训练搜索结果排序模型的方法,该方法包括:
利用搜索日志获取训练样本,所述训练样本包括:样本query、用户在输入样本query之前第一时长内的搜索历史信息、用户在输入样本query之前第二时长内的搜索历史信息、样本query对应的搜索结果以及搜索结果的被点击状况;
利用所述训练样本训练排序模型,以达到预设的训练目标;其中所 述排序模型的输入包括样本query、用户在输入样本query之前第一时长内的搜索历史信息、用户在输入样本query之前第二时长内的搜索历史信息以及样本query对应的搜索结果,所述排序模型的输出包括对各搜索结果的评分;所述排序模型对各搜索结果的评分依据第一相似度和第二相似度确定,所述第一相似度为所述样本query的向量表示和所述第一时长内的搜索历史信息的向量表示的整合与所述搜索结果的向量表示之间的相似度,所述第二相似度为所述样本query的向量表示和所述在第二时长内的搜索历史信息的向量表示的整合与所述搜索结果的向量表示之间的相似度;所述训练目标包括:最大化搜索结果被点击状况与搜索结果的评分之间的相关度;
利用训练得到的排序模型,获取搜索结果排序模型。
根据本申请一优选实施方式,所述用户在输入样本query之前第一时长内的搜索历史信息包括:同一会话中在所述样本query之前的query序列和query序列中各query对应的被点击搜索结果;
所述用户在输入样本query之前第二时长内的搜索历史信息包括:所述用户在输入样本query之前第二时长内搜索的query和点击的搜索结果。
根据本申请一优选实施方式,所述用户在输入样本query之前第一时长内的搜索历史信息的向量表示由以下方式得到:
将所述query序列中各query的向量表示、所述各query对应的被点击搜索结果的向量表示采用注意力机制进行加权处理,得到所述用户在第一时长内的搜索历史信息的向量表示。
根据本申请一优选实施方式,所述用户在输入样本query之前第二 时长内的搜索历史信息的向量表示由以下方式得到:
获取用户在输入样本query之前第二时长内搜索的query集合和点击的搜索结果集合;
将所述query集合和搜索结果集合进行切词处理后求并集,得到词集合;
对所述词集合使用句向量的分布词袋PV-DBOW进行编码处理,得到所述用户在输入样本query之前第二时长内的搜索历史信息的向量表示。
根据本申请一优选实施方式,所述搜索结果包括相关网页或相关实体;
其中相关实体的向量表示为:所述相关实体的标识、名称以及实体描述的整合向量表示。
根据本申请一优选实施方式,所述搜索结果包括:第一类搜索结果和第二类搜索结果;
所述排序模型包括:共享向量子模型、第一排序子模型和第二排序子模型;
将所述样本query、用户在输入样本query之前第一时长内的搜索历史信息、用户在输入样本query之前第二时长内的搜索历史信息以及样本query对应的搜索结果输入所述共享向量子模型,得到所述共享向量子模型输出的所述样本query的向量表示和所述第一时长内的搜索历史信息的向量表示的整合,以及所述样本query的向量表示和所述在第二时长内的搜索历史信息的向量表示的整合;
将所述共享向量子模型的输出以及样本query的第一类搜索结果输 入所述第一排序子模型,得到对所述第一搜索结果的评分;以及将所述共享向量子模型的输出以及样本query的第二类搜索结果输入所述第二排序子模型,得到对所述第二搜索结果的评分;
对所述第一排序子模型和第二排序子模型进行联合训练,以达到预设的训练目标,所述训练目标包括:最大化第一类搜索结果被点击状况与第一类搜索结果的评分之间的相关度,以及最大化第二类搜索结果被点击状况与第二类搜索结果的评分之间的相关度;
训练结束后,利用所述第一排序子模型和所述第二排序子模型中的一个以及所述共享向量子模型,得到所述搜索结果排序模型。
根据本申请一优选实施方式,对所述第一排序子模型和第二排序子模型进行联合训练包括:
在训练迭代过程中,每次随机从所述第一排序子模型和所述第二排序子模型中选择一个进行训练,利用被选择的子模型的输出更新被选择的子模型和共享向量子模型的模型参数;或者,
在训练迭代过程中,每次交替从所述第一排序子模型和所述第二排序子模型中选择一个进行训练,利用被选择的子模型的输出更新被选择的子模型和共享向量子模型的模型参数;或者,
在训练迭代过程中,每次均对所述第一排序子模型和所述第二排序子模型进行训练,利用所述第一排序子模型和所述第二排序子模型的输出更新所有子模型的模型参数。
第三方面,本申请提供了一种确定搜索结果的装置,该装置包括:
获取单元,用于获取用户的当前query、所述用户在第一时长内的搜索历史信息、所述用户在第二时长内的搜索历史信息以及当前query的 候选搜索结果;
确定单元,用于将所述当前query、所述用户在第一时长内的搜索历史信息、所述用户在第二时长内的搜索历史信息以及当前query的候选搜索结果输入搜索结果排序模型,依据所述搜索结果排序模型对所述候选搜索结果的评分,确定所述当前query对应的搜索结果,所述第二时长大于所述第一时长;
其中所述搜索结果排序模型对所述候选结果的评分依据第一相似度和第二相似度确定,所述第一相似度为所述当前query的向量表示和所述用户在第一时长内的搜索历史信息的向量表示的整合与所述候选搜索结果的向量表示之间的相似度,所述第二相似度为所述当前query的向量表示和所述用户在第二时长内的搜索历史信息的向量表示的整合与所述候选搜索结果的向量表示之间的相似度。
第四方面,本申请提供了一种训练搜索结果排序模型的装置,该装置包括:
样本获取单元,用于利用搜索日志获取训练样本,所述训练样本包括:样本query、用户在输入样本query之前第一时长内的搜索历史信息、用户在输入样本query之前第二时长内的搜索历史信息、样本query对应的搜索结果以及搜索结果的被点击状况;
模型训练单元,用于利用所述训练样本训练排序模型,以达到预设的训练目标;其中所述排序模型的输入包括样本query、用户在输入样本query之前第一时长内的搜索历史信息、用户在输入样本query之前第二时长内的搜索历史信息以及样本query对应的搜索结果,所述排序模型的输出包括对各搜索结果的评分;所述排序模型对各搜索结果的评分依 据第一相似度和第二相似度确定,所述第一相似度为所述样本query的向量表示和所述第一时长内的搜索历史信息的向量表示的整合与所述搜索结果的向量表示之间的相似度,所述第二相似度为所述样本query的向量表示和所述在第二时长内的搜索历史信息的向量表示的整合与所述搜索结果的向量表示之间的相似度;所述训练目标包括:最大化搜索结果被点击状况与搜索结果的评分之间的相关度;
模型获取单元,用于利用训练得到的排序模型,获取搜索结果排序模型。
第五方面,本申请提供了一种电子设备,包括:
至少一个处理器;以及
与所述至少一个处理器通信连接的存储器;其中,
所述存储器存储有可被所述至少一个处理器执行的指令,所述指令被所述至少一个处理器执行,以使所述至少一个处理器能够执行如上所述的方法。
第六方面,本申请提供了一种存储有计算机指令的非瞬时计算机可读存储介质,其特征在于,所述计算机指令用于使所述计算机执行如上所述的方法。
由以上技术方案可以看出,本申请在确定搜索结果时综合考虑了用户的短期搜索历史所体现的搜索上下文的信息以及长期搜索历史所体现的用户个性化偏好,从而提高了搜索结果的准确性,使其更加符合用户的搜索需求。当其应用于实体推荐时,能够消除当前query的歧义,提供更加准确的符合用户搜索需求的相关实体。
上述可选方式所具有的其他效果将在下文中结合具体实施例加以说 明。
附图说明
附图用于更好地理解本方案,不构成对本申请的限定。其中:
图1在搜索结果页面中提供相关实体推荐的实例图;
图2为本申请实施例一提供的相关实体推荐的方法流程图;
图3为本申请实施例一提供的实体排序模型的结构示意图;
图4为本申请实施例二提供的训练实体排序模型的方法流程图;
图5为本申请实施例三提供的实体排序模型的结构示意图;
图6为本申请实施例提供的确定搜索结果的装置结构图;
图7为本申请实施例提供的训练搜索结果排序模型的装置结构图;
图8是用来实现本申请实施例的电子设备的框图。
具体实施方式
以下结合附图对本申请的示范性实施例做出说明,其中包括本申请实施例的各种细节以助于理解,应当将它们认为仅仅是示范性的。因此,本领域普通技术人员应当认识到,可以对这里描述的实施例做出各种改变和修改,而不会背离本申请的范围和精神。同样,为了清楚和简明,以下的描述中省略了对公知功能和结构的描述。
本申请提供的方法应用于计算机系统的搜索引擎,由计算机或处理器执行,可以设置于服务器端,用于利用用户的历史查询来提高确定搜索结果的效果。当用户通过浏览器或客户端输入当前query后,浏览器或客户端将当前query发送给服务器端,由服务器端采用本申请实施例中提供的方法确定出搜索结果后,将搜索结果发送给浏览器或客户端。在本申请实施例中涉及的搜索结果可以包括相关实体或相关网页。也就 是说,通过本申请提供的方式可以用于针对当前query进行相关实体推荐,也可以用于针对当前query进行相关网页推荐。
在后续实施例中,均以针对当前query进行相关实体推荐为例,对于相关网页推荐的原理相似。下面结合实施例对本申请进行详细描述。
实施例一
图2为本申请实施例一提供的相关实体推荐的方法流程图,如图2中所示,该方法可以包括以下步骤:
在201中,获取用户的当前query(搜索关键词)、用户在第一时长内的搜索历史信息、用户在第二时长内的搜索历史信息以及当前query的候选相关实体,其中第二时长大于第一时长。
传统的实体推荐系统仅仅是基于当前query的推荐,当前query指的是用户当前输入的query,无法了解用户的真实搜索需求,从而造成相关实体推荐不准确,不符合用户需求。
通过研究后发现,搜索历史可以提供非常有价值的线索,这些线索可以更好地帮助捕捉用户的真实需求。搜索历史可以分为两种:短期(short-term)搜索历史和长期(long-term)搜索历史。其中短期搜索历史可以对应于本申请中的用户在第一时长内的搜索历史信息,长期搜索历史可以对应于本申请中的用户在第二时长内的搜索历史信息。
短期搜索历史可以包括与当前query处于同一个搜索会话中的前序用户行为,例如,同一会话中在当前query之前的query序列以及query序列中各query对应的被点击的搜索结果。其中被点击的搜索结果可以是搜索结果页中被点击的网页,也可以是被点击的相关实体。短期搜索历史可以看做是当前query的上下文信息,其反映了用户的短期即时兴 趣。如果用户搜索“芝加哥”之前,在同一会话中还搜索过“追梦女孩”,那么用户大概率对电影更感兴趣。同样地,如果之前用户点击了跟歌剧相关的搜索结果、推荐实体,那么用户可能会对歌剧更感兴趣。
其中,上述的“会话”(session)指的是搜索会话,在此可以使用一个被广泛采用的搜索会话的确定方式。如果用户在第一时长(例如30分钟)之前没有任何搜索行为,则可以将该第一时长之内首次搜索行为作为本次session的开始。也就是说,如果用户在30分钟内有连续的搜索行为,那么这30分钟内的连续搜索行为都属于同一session。
长期搜索历史指的是当前query之前的第二时长内用户所有的搜索行为,包括第二时长内该用户的所有session内的所有用户搜索行为,包括输入的query、在搜索结果页中点击的网页、点击的相关实体。长期搜索历史反映了用户长期的内在的兴趣偏好。如果一个用户经常搜索歌剧相关的query、点击歌剧相关的网页和相关实体,那么当用户搜索“芝加哥”,那么最好向用户推荐歌剧相关的实体。长期搜索历史对构建个性化的实体推荐系统非常有帮助。
在本申请中,上述第一时长可以选取分钟级别、小时级别,例如30分钟。上述第二时长可以选取天级别、月级别,例如3个月。
在申请实施例中不限定当前query的候选相关实体的获取方式,例如可以从文本集中选择在预设长度窗口内与当前query共现的实体,将满足预设共现次数的实体作为当前query的候选相关实体。
在202中,将用户的当前query、用户在第一时长内的搜索历史信息、用户在第二时长内的搜索历史信息以及当前query的候选相关实体输入实体排序模型,依据实体排序模型对候选相关实体的评分,确定当前 query的推荐相关实体。
其中搜索结果排序模型对候选结果的评分依据第一相似度和第二相似度确定,第一相似度为当前query的向量表示和用户在第一时长内的搜索历史信息的向量表示的整合与候选相关实体的向量表示之间的相似度,第二相似度为当前query的向量表示和用户在第二时长内的搜索历史信息的向量表示的整合与候选相关实体的向量表示之间的相似度。
在申请实施例中,采用实体排序模型对当前query的各候选相关实体进行评分,从而依据评分确定当前query的推荐相关实体。例如可以将评分满足一定要求的候选相关实体作为推荐相关实体,还可以进一步依据评分对推荐相关实体的展现位置进行排序。其中,评分满足一定要求可以包括:评分排在前M个,M为预设的正整数;或者,评分超过预设阈值。
在本申请实施例中,实体排序模型由训练数据预先训练得到,将在实施例二中对实体排序模型的训练方法进行详细描述。
训练得到的实体排序模型对于输入的用户的当前query、用户在第一时长内的搜索历史信息、用户在第二时长内的搜索历史信息以及当前query的候选相关实体,能够输出对各候选相关实体的评分。实体排序模型的结构可以如图3中所示,由一个向量子模型和一个排序子模型构成。
其中,当前搜索关键词query、用户在第一时长内的搜索历史信息、用户在第二时长内的搜索历史信息作为向量子模型的输入,向量子模型输出当前query的向量表示和用户在第一时长内的搜索历史信息的向量表示的整合。向量子模型的输出以及当前query的候选相关实体作为排序子模型的输入,由排序模型输出对候选相关实体的评分。
首先介绍向量子模型:
对于输入的当前query,图中表示为q t可以经过神经网络进行编码,获取该当前query的向量表示v q。其中神经网络优选BiLSTM(Bidirectional Long Short-Term Memory,双向长短期记忆网络)。具体地,给定搜索查询,q t=[w 1,w 2,…,w n],词w i通过词向量矩阵被转换成向量表示,然后使用一个前向LSTM和一个后向LSTM,将搜索查询q t分别编码成隐向量:
Figure PCTCN2020092742-appb-000001
Figure PCTCN2020092742-appb-000002
最后将
Figure PCTCN2020092742-appb-000003
Figure PCTCN2020092742-appb-000004
拼接起来作为搜索查询q t的向量表示
Figure PCTCN2020092742-appb-000005
其中,[;]表示向量的拼接。
对于用户在第一时长内的搜索历史信息,在图中表示为S t,S t={<q 1,C 1>,…<q t-1,C t-1>},即S t由同一会话中q t之前的query序列q 1,…,q t-1以及对应的被点击搜索结果组成C 1,…,C t-1。其中,C i可以包括被点击网页和/或被点击相关实体。
首先可将各q i通过神经网络(采用与q t一致的方式)进行编码得到向量表示v qi,然后将C i中的被点击网页表示成向量
Figure PCTCN2020092742-appb-000006
将C i中的被点击相关实体表示成向量
Figure PCTCN2020092742-appb-000007
其中,l为C i中被点击网页的数量,g为C i中被点击相关实体的数量。在确定被点击网页的各向量表示时,可以采用神经网络对各被点击网页的标题进行编码,分别得到各被点击网页的向量
Figure PCTCN2020092742-appb-000008
在确定被点击实体的各向量表示时,可以将实体的标识、名称以及实体描述的向量表示进行拼接后,结合一定的偏置参数进行激活处理后得到各被点击实体的向量表示
Figure PCTCN2020092742-appb-000009
这种实体的向量表示的确定方法能够有效解决OOV(Out-Of-Vocabulary,词表外)问题和歧义问题。
其中,实体描述可以理解为对实体的“描述文本”,用以描述一个 实体的含义。在本申请中可以采用实体所对应百科词条的正文首句话,也可以采用实体所对应百科词条的摘要等。
然后可以基于注意力机制的加权平均方法,利用v qi
Figure PCTCN2020092742-appb-000010
生成<q i,C i>的向量表示
Figure PCTCN2020092742-appb-000011
具体地,可以采用如下公式:
Figure PCTCN2020092742-appb-000012
最后,S t的向量表示v c可以通过如下公式得到:
Figure PCTCN2020092742-appb-000013
其中,函数符号Attention w(·,·)表示基于注意力机制的加权表示方法。v a是模型参数,在模型训练过程中学习得到。
对于用户在第二时长内的搜索历史信息,由于其表示的是用户的个性化偏好,因此在图中表示为u,看做用户表示。可以将用户的在第二时长内的query集合Q、被点击的网页集合D、被点击的相关实体集合E分别进行切词处理后分别得到词集合W q,W d,W e,计算并集得到W u,W u=W q∪W d∪W e。然后可以对词集合W u使用PV-DBOW(Distributed Bag of Words version of Paragraph Vector,句向量的分布词袋)进行编码处理,从而得到每个用户的向量表示(即用户在第二时长内的搜索历史的向量表示),在图中表示为v u。其中,PV-DBOW已经是目前比较成熟的处理方式,能够在输入词集合的情况下,输出对应的向量表示。
然后,将v q和v c进行拼接,得到整合向量表示v cq。当然,除了拼接之外,也可以采用其他向量整合方式。图中,
Figure PCTCN2020092742-appb-000014
表示对向量v q和v c进行整合。将v q和v u进行拼接,得到整合向量表示v uq。当然,除了拼接之外,也可以采用其他向量整合方式。图中,
Figure PCTCN2020092742-appb-000015
表示对向量v q和v u进行整合。
至此,向量子模型输出两个整合向量表示:v cq和v uq
下面介绍排序子模型:
v cq、v uq以及候选相关实体e作为排序子模型的输入。排序子模型利用两个相似度来对候选相关实体e进行排序:第一相似度和第二相似度。
其中,第一相似度为当前query的向量表示和用户在第一时长内的搜索历史信息的向量表示的整合与候选相关实体的向量表示之间的相似度。第一相似度P(e|S t,q t)可以采用以下公式计算:
Figure PCTCN2020092742-appb-000016
其中,v e表示相关实体e的向量表示,可以将实体e的标识、名称以及实体描述的向量表示进行拼接后,结合一定的偏置参数进行激活处理后得到实体e的向量表示v e
v s是将v cq经过全连接层(FC layer)映射后得到的向量表示,可以采用如下公式计算得到:
Figure PCTCN2020092742-appb-000017
其中,W s是参数矩阵,b s是偏移向量,φ(·)是激活函数。W s和b s是模型参数,在模型训练过程中学习得到。
第二相似度为当前query的向量表示和用户在第二时长内的搜索历史信息的向量表示的整合与候选相关实体的向量表示之间的相似度。第二相似度P(e|u,q t)可以采用以下公式计算:
Figure PCTCN2020092742-appb-000018
v p是将v uq经过全连接层(FC layer)映射后得到的向量表示,可以采用如下公式计算得到:
Figure PCTCN2020092742-appb-000019
其中,W u是参数矩阵,b u是偏移向量,φ(·)是激活函数。W u和b u是模型参数,在模型训练过程中学习得到。
最终,排序子模型在对候选相关实体e进行评分时,可以综合利用上述第一相似度和第二相似度,具体可以为:
Figure PCTCN2020092742-appb-000020
其中W f是参数矩阵,b f是偏移值,φ(·)是激活函数。W f和b f是模型参数,在模型训练过程中学习得到。
如果候选相关实体e的P(e|u,S t,q t)越高,对应的评分值越高。
在203中,在搜索结果页中展现确定出的推荐相关实体。
在本申请实施例中,可以在当前query的搜索结果页中展现推荐相关实体。例如,在当前query的搜索结果页的右侧区域展现推荐相关实体。当然,除此之外,也可以在搜索结果页的其他位置进行展现,本申请对推荐相关实体在搜索结果页中的展现位置并不加以限制。
举个例子,用户输入当前query“芝加哥”,用户同一session中还搜索了“泰坦尼克号”和“红磨坊”,在三个月内搜索并点击了大量与电影相关的内容。则通过本申请实施例的方法,在与query“芝加哥”相关的候选相关实体中,与电影相关的候选相关实体的评分较高,因此与电影相关的候选实体会被作为推荐相关实体。通过这种方式能够排除当前query中的歧义,既考虑了上下文的信息,又考虑了用户长期搜索历史所反映的个性化偏好,使得相关实体推荐能够更加符合用户的实际需求。
而在传统的相关实体推荐中,针对当前query“芝加哥”则会针对所 有用户均推荐相同的相关实体,例如默认均推荐与城市“芝加哥”相关的实体。
实施例二、
图4为本申请实施例二提供的训练实体排序模型的方法流程图,如图4中所示,该方法可以包括以下步骤:
在401中,利用搜索日志获取训练样本。
获取的训练样本包括样本query、用户在输入样本query之前第一时长内的搜索历史信息、用户在输入样本query之前第二时长内的搜索历史信息、样本query对应的搜索结果以及搜索结果的被点击状况,第二时长大于第一时长。
在本申请中获取连续一段时期内的搜索日志,从中抽取上述训练样本。
与实施例一中类似的含义,用户在输入样本query之前第一时长内的搜索历史信息可以包括与样本query处于同一个搜索会话中的前序用户行为,例如,同一会话中在样本query之前的query序列以及query序列中各query对应的被点击的搜索结果,但作为优选的实施方式,在训练样本中除了将被点击搜索结果作为正例之外,还可以获取未被点击的搜索结果作为负例。其中搜索结果可以是搜索结果页中的网页,也可以是相关实体。
用户在输入样本query之前第二时长内的搜索历史信息可以包括第二时长内该用户的所有session内的所有用户搜索行为,包括输入的query、在搜索结果页中点击的网页、点击的相关实体。
在402中,利用训练样本训练排序模型,以达到预设的训练目标。
其中,排序模型的输入包括样本query、用户在输入样本query之前第一时长内的搜索历史信息、用户在输入样本query之前第二时长内的搜索历史信息以及样本query对应的相关实体,排序模型的输出包括对各相关实体的评分。
排序模型对各相关实体的评分依据第一相似度和第二相似度确定,第一相似度为样本query的向量表示和第一时长内的搜索历史信息的向量表示的整合与样本query对应的相关实体的向量表示之间的相似度,第二相似度为样本query的向量表示和在第二时长内的搜索历史信息的向量表示的整合与样本query对应的相关实体的向量表示之间的相似度。
训练目标包括:最大化相关实体被点击状况与相关实体的评分之间的相关度。
在本实施例中,可以训练如图3中所示的排序模型,将样本query作为图3中的q t,用户在输入样本query之前第一时长内的搜索历史信息作为图3中的S t、用户在输入样本query之前第二时长内的搜索历史信息作为图3中的u,经过向量子模型的处理,得到两个整合向量表示:v cq和v uq,其中v cq由q t的向量表示v q与S t的向量表示v c的整合得到,v uq由q t的向量表示v q与u的向量表示v u的整合得到。向量子模型的具体处理过程可以参见实施例一中的相关记载,在此不做赘述。
v cq、v uq以及相关实体e作为排序子模型的输入,排序子模型按照实施例一中所述的方式得到第一相似度P(e|S t,q t)和第二相似度P(e|u,q t)后,进一步得到相关实体e的P(e|u,S t,q t),并依据P(e|u,S t,q t)输出相关实体e的评分。相关实体e的P(e|u,S t,q t)越高,对应的评分值越高。
在训练过程中,可以通过pairwise排序学习以及随机梯度下降法进 行模型参数的迭代更新。在本申请实施例中,该排序子模型的训练目标可以采用最小化预设的损失函数的形式。其中损失函数Loss可以利用训练样本中被点击实体的负的对数似然函数来确定,例如:
Figure PCTCN2020092742-appb-000021
其中,e +为样本query的被点击相关实体。
Figure PCTCN2020092742-appb-000022
为实体排序所采用的训练样本集合。
Figure PCTCN2020092742-appb-000023
E t为样本query的相关实体集合,γ为预设的参数。
训练过程中,利用loss e计算梯度,不断进行迭代更新排序子模型的参数,直至满足迭代停止条件。其中迭代停止条件可以包括但不限于:loss e收敛,loss e小于预设的阈值,或者迭代次数达到预设次数阈值。
在403中,利用训练得到的排序模型,获取实体排序模型。
训练结束后,可以利用如图3中所示的模型作为实体排序模型,该实体排序模型包括向量子模型和排序子模型。
除了上述训练方式之外,本申请可以通过实施例三提供一种优选的训练方式,提出一种多任务学习框架,即采用多任务模型联合训练的方式得到实体排序模型。
实施例三、
对于实体排序而言在一定程度上会存在实体点击数据稀疏的问题,因为受展现空间的限制,实体排序模型的实体排序倾向于根据query最常被提及的含义进行实体推荐。而对于具有歧义的query而言,除最常被提及的含义之外,较少以及很少被提及的含义所对应的实体点击数据都非常稀疏。而为了更好地满足用户的多元化信息需求,大多数搜索引 擎都会为用户提供多样化的搜索结果。因此,当用户搜索时,与实体推荐结果相比,更容易在网页搜索结果中找到与自己信息需求相匹配的结果。在本实施例中,整体模型可以包括共享向量子模型、第一排序子模型和第二排序子模型。第一排序子模型采用上述实施例二中所述的排序子模型,作为主任务用以进行相关实体排序。第二排序子模型作为辅助任务用以进行网页排序。这种多任务学习的模型训练能够利用不同任务模型之间的关联提高模型的可扩展性和排序效果。
在本实施例中,训练样本进一步包括样本query对应的网页搜索结果以及网页对应的被点击状况。
具体地,这种模型可以如图5中所示。其中,与实施例二中类似地,将样本query作为图5中的q t,用户在输入样本query之前第一时长内的搜索历史信息作为图5中的S t、用户在输入样本query之前第二时长内的搜索历史信息作为图5中的u,经过向量子模型的处理,得到两个整合向量表示:v cq和v uq,其中v cq由q t的向量表示v q与S t的向量表示v c的整合得到,v uq由q t的向量表示v q与u的向量表示v u的整合得到。向量子模型的具体处理过程可以参见实施例一中的相关记载,在此不做赘述。
第一排序子模型类似于实施例二中的排序子模型,v cq、v uq以及相关实体e作为第一排序子模型的输入,排序子模型按照实施例一中所述的方式得到第一相似度P(e|S t,q t)和第二相似度P(e|u,q t)后,进一步得到相关实体e的P(e|u,S t,q t),并依据P(e|u,S t,q t)输出相关实体e的评分。相关实体e的P(e|u,S t,q t)越高,对应的评分值越高。
向量子模型输出的v cq和v uq也作为第二排序子模型的输入,同时网页搜索结果d(后续简称为候选网页)也作为第二排序子模型的输入。 第二排序子模型利用两个相似度对d进行排序:第一相似度和第二相似度。
第二排序子模型中的第一相似度为当前query的向量表示和用户在第一时长内的搜索历史信息的向量表示的整合与候选网页的向量表示之间的相似度。
第一相似度P(d|S t,q t)可以采用以下公式计算:
Figure PCTCN2020092742-appb-000024
其中,v d表示候选网页d的向量表示。
v r是将v cq经过全连接层(FC layer)映射后得到的向量表示,可以采用如下公式计算得到:
Figure PCTCN2020092742-appb-000025
其中,W d是参数矩阵,b d是偏移向量,φ(·)是激活函数。W d和b d是模型参数,在模型训练过程中学习得到。
第二相似度为当前query的向量表示和用户在第二时长内的搜索历史信息的向量表示的整合与候选网页的向量表示之间的相似度。第二相似度P(d|u,q t)可以采用以下公式计算:
Figure PCTCN2020092742-appb-000026
v m是将v uq经过全连接层(FC layer)映射后得到的向量表示,可以采用如下公式计算得到:
Figure PCTCN2020092742-appb-000027
其中,W m是参数矩阵,b m是偏移向量,φ(·)是激活函数。W m和b m是模型参数,在模型训练过程中学习得到。
最终,第二排序子模型在对候选网页d进行评分时,可以综合利用上述第一相似度和第二相似度,具体可以为:
Figure PCTCN2020092742-appb-000028
其中W g是参数矩阵,b g是偏移值,φ(·)是激活函数。W g和b g是模型参数,在模型训练过程中学习得到。
如果候选网页d的P(d|u,S t,q t)越高,对应的评分值越高。
在对第一排序子模型和第二排序子模型进行联合训练时,可以每次随机从第一排序子模型和第二排序子模型中选择一个进行训练,也可以每次交替从第一排序子模型和第二排序子模型中选择一个进行训练;然后每次利用被选择的子模型的输出更新被选择的子模型和共享向量子模型的模型参数。
以交替选择为例,选择第一排序子模型时,利用训练样本训练得到P(e|u,S t,q t)后,计算loss e,利用loss e迭代更新共享向量子模型和第一排序子模型的模型参数;然后选择第二排序子模型,利用训练样本训练得到P(d|u,S t,q t)后,计算loss d,利用loss d迭代更新共享向量子模型和第二排序子模型的模型参数;以此类推,直至达到训练目标,例如loss e、loss d均收敛,loss e、loss d均小于预设的阈值,或者迭代次数达到预设次数阈值。
其中,
Figure PCTCN2020092742-appb-000029
其中,d +为样本query的被点击网页。
Figure PCTCN2020092742-appb-000030
为网页排序即第二排序子模型对应的训练样本集合。
Figure PCTCN2020092742-appb-000031
D t为样本query的候选网页集合,γ为预设的参数。
除了上述联合训练方式之外,还可以在训练迭代过程中,每次均对第一排序子模型和第二排序子模型进行训练,利用第一排序子模型和第二排序子模型的输出更新所有子模型的模型参数。
这种方式下,可以采用一个整合的损失函数,例如:
loss=loss d+αloss e
其中α为超参数,可以人工设置为实验值或经验值。
每次迭代过程计算出loss,然后利用loss更新共享向量子模型、第一排序子模型和第二排序子模型的模型参数,直至达到训练目标。例如loss收敛,loss小于预设的阈值,或者迭代次数达到预设次数阈值。
训练结束后,利用共享向量子模型和第一排序子模型得到实体排序模型。也就是说,虽然在训练过程中,采用多任务模型的方式进行训练,即第二排序子模型辅助第一排序子模型的训练,但最终得到的用于进行相关实体推荐的实体排序模型并不使用第二排序子模型。
需要说明的是,采用上述多任务模型的训练方式进行训练后,也可以得到相关网页排序模型,即利用共享子模型和第二排序子模型得到相关网页排序模型。这种方式是第一排序子模型辅助第二排序子模型的训练,即相关实体推荐辅助相关网页排序。这样得到的相关网页排序模型可以在输入当前query、用户在第一时长内的搜索历史信息、用户在第二时长内的搜索历史信息以及当前query的相关网页集合后,得到对当前query的相关网页集合中各相关网页的评分,从而能够依据该评分确定要展现的当前query的相关网页,作为相关网页的展现选择和排序的依据。
另外需要说明的是,上述实施例是以相关实体和相关网页分别作为第一类搜索结果和第二类搜索结果为例进行的描述。但本申请并不限于 这两种类型的搜索结果,还可以是其他类型的搜索结果作为第一类搜索结果和第二类搜索结果。
以上是对本申请所提供方法进行的详细描述,下面结合实施例对本申请提供的装置进行详细描述。
实施例四、
图6为本申请实施例提供的确定搜索结果的装置结构图,如图6中所示,该装置可以包括:获取单元01和确定单元02,还可以包括展现单元03。其中各组成单元的主要功能如下:
获取单元01,用于获取用户的当前query、用户在第一时长内的搜索历史信息、用户在第二时长内的搜索历史信息以及当前query的候选搜索结果。
确定单元02,用于将当前query、用户在第一时长内的搜索历史信息、用户在第二时长内的搜索历史信息以及当前query的候选搜索结果输入搜索结果排序模型,依据搜索结果排序模型对候选搜索结果的评分,确定当前query对应的搜索结果,第二时长大于第一时长。
其中搜索结果排序模型对候选结果的评分依据第一相似度和第二相似度确定,第一相似度为当前query的向量表示和用户在第一时长内的搜索历史信息的向量表示的整合与候选搜索结果的向量表示之间的相似度,第二相似度为当前query的向量表示和用户在第二时长内的搜索历史信息的向量表示的整合与候选搜索结果的向量表示之间的相似度。
其中,用户在第一时长内的搜索历史信息包括:同一会话中在当前query之前的query序列和query序列中各query对应的被点击搜索结果。优选地,用户在第一时长内的搜索历史信息的向量表示由以下方式得到: 将所述query序列中各query的向量表示、所述各query对应的被点击搜索结果的向量表示采用注意力机制进行加权处理,得到用户在第一时长内的搜索历史信息的向量表示。
用户在第二时长内的搜索历史信息可以包括用户在第二时长内搜索的query和点击的搜索结果(例如点击的网页和相关实体)。优选地,用户在第二时长内的搜索历史信息的向量表示由以下方式得到:获取用户在第二时长内搜索的query集合和点击的搜索结果集合;将query集合和搜索结果集合进行切词处理后求并集,得到词集合;对词集合使用PV-DBOW进行编码处理,得到用户在第二时长内的搜索历史信息的向量表示。
其中,上述候选搜索结果可以包括相关网页或相关实体。
其中相关实体的向量表示为:相关实体的标识、名称以及实体描述的整合向量表示。
确定单元02利用搜索排序模型确定搜索结果的具体过程参见实施例一中的相关记载,在此不做详述。
展现单元03,用于在搜索结果页中展现当前query对应的搜索结果,即将当前query对应的搜索结果包含在搜索结果页中发送给浏览器或客户端。
实施例五、
图7为本申请实施例提供的训练搜索结果排序模型的装置结构图,如图7所示,该装置可以包括:样本获取单元11、模型训练单元12和模型获取单元13。其中各组成单元的主要功能如下:
样本获取单元11,用于利用搜索日志获取训练样本,训练样本包括: 样本query、用户在输入样本query之前第一时长内的搜索历史信息、用户在输入样本query之前第二时长内的搜索历史信息、样本query对应的搜索结果以及搜索结果的被点击状况。
模型训练单元12,用于利用训练样本训练排序模型,以达到预设的训练目标;其中排序模型的输入包括样本query、用户在输入样本query之前第一时长内的搜索历史信息、用户在输入样本query之前第二时长内的搜索历史信息以及样本query对应的搜索结果,排序模型的输出包括对各搜索结果的评分;排序模型对各搜索结果的评分依据第一相似度和第二相似度确定,第一相似度为样本query的向量表示和第一时长内的搜索历史信息的向量表示的整合与搜索结果的向量表示之间的相似度,第二相似度为样本query的向量表示和在第二时长内的搜索历史信息的向量表示的整合与搜索结果的向量表示之间的相似度;训练目标包括:最大化搜索结果被点击状况与搜索结果的评分之间的相关度。
模型获取单元13,用于利用训练得到的排序模型,获取搜索结果排序模型。
其中,用户在输入样本query之前第一时长内的搜索历史信息包括:同一会话中在样本query之前的query序列和query序列中各query对应的被点击搜索结果。
用户在输入样本query之前第一时长内的搜索历史信息的向量表示由以下方式得到:将query序列中各query的向量表示、所述各query对应的被点击搜索结果的向量表示采用注意力机制进行加权处理,得到用户在输入样本query之前第一时长内的搜索历史信息的向量表示。
用户在输入样本query之前第二时长内的搜索历史信息包括:用户 在输入样本query之前第二时长内搜索的query和点击的搜索结果。
优选地,用户在输入样本query之前第二时长内的搜索历史信息的向量表示由以下方式得到:获取用户在输入样本query之前第二时长内搜索的query集合和点击的搜索结果集合;将query集合和搜索结果集合进行切词处理后求并集,得到词集合;对词集合使用PV-DBOW进行编码处理,得到用户在输入样本query之前第二时长内的搜索历史信息的向量表示。
模型训练单元12训练搜索结果排序模型的具体方式可以参见实施例二中的相关记载,在此不做详述。
作为一种优选的实施方式,上述搜索结果包括:第一类搜索结果和第二类搜索结果。排序模型包括:共享向量子模型、第一排序子模型和第二排序子模型。
模型训练单元12,具体用于将样本query、用户在输入样本query之前第一时长内的搜索历史信息、用户在输入样本query之前第二时长内的搜索历史信息以及样本query对应的搜索结果输入共享向量子模型,得到共享向量子模型输出的样本query的向量表示和第一时长内的搜索历史信息的向量表示的整合,以及样本query的向量表示和在第二时长内的搜索历史信息的向量表示的整合;将共享向量子模型的输出以及样本query的第一类搜索结果输入第一排序子模型,得到对第一搜索结果的评分;以及将共享向量子模型的输出以及样本query的第二类搜索结果输入第二排序子模型,得到对第二搜索结果的评分;对第一排序子模型和第二排序子模型进行联合训练,以达到预设的训练目标,训练目标包括:最大化第一类搜索结果被点击状况与第一类搜索结果的评分之间 的相关度,以及最大化第二类搜索结果被点击状况与第二类搜索结果的评分之间的相关度。
模型获取单元13,具体用于在模型训练单元训练结束后,利用第一排序子模型和第二排序子模型中的一个以及共享向量子模型,得到搜索结果排序模型。
其中,模型训练单元12在对第一排序子模型和第二排序子模型进行联合训练时,具体执行:
在训练迭代过程中,每次随机从第一排序子模型和第二排序子模型中选择一个进行训练,利用被选择的子模型的输出更新被选择的子模型和共享向量子模型的模型参数;或者,
在训练迭代过程中,每次交替从第一排序子模型和第二排序子模型中选择一个进行训练,利用被选择的子模型的输出更新被选择的子模型和共享向量子模型的模型参数;或者,
在训练迭代过程中,每次均对第一排序子模型和第二排序子模型进行训练,利用第一排序子模型和第二排序子模型的输出更新所有子模型的模型参数。
这种方式下模型训练单元12训练搜索结果排序模型的具体过程可以参见实施例三中的记载,在此不做详述。
根据本申请的实施例,本申请还提供了一种电子设备和一种可读存储介质。
如图8所示,是根据本申请实施例的确定搜索结果的方法的电子设备的框图。电子设备旨在表示各种形式的数字计算机,诸如,膝上型计算机、台式计算机、工作台、个人数字助理、服务器、刀片式服务器、 大型计算机、和其它适合的计算机。电子设备还可以表示各种形式的移动装置,诸如,个人数字处理、蜂窝电话、智能电话、可穿戴设备和其它类似的计算装置。本文所示的部件、它们的连接和关系、以及它们的功能仅仅作为示例,并且不意在限制本文中描述的和/或者要求的本申请的实现。
如图8所示,该电子设备包括:一个或多个处理器801、存储器802,以及用于连接各部件的接口,包括高速接口和低速接口。各个部件利用不同的总线互相连接,并且可以被安装在公共主板上或者根据需要以其它方式安装。处理器可以对在电子设备内执行的指令进行处理,包括存储在存储器中或者存储器上以在外部输入/输出装置(诸如,耦合至接口的显示设备)上显示GUI的图形信息的指令。在其它实施方式中,若需要,可以将多个处理器和/或多条总线与多个存储器和多个存储器一起使用。同样,可以连接多个电子设备,各个设备提供部分必要的操作(例如,作为服务器阵列、一组刀片式服务器、或者多处理器系统)。图8中以一个处理器801为例。
存储器802即为本申请所提供的非瞬时计算机可读存储介质。其中,所述存储器存储有可由至少一个处理器执行的指令,以使所述至少一个处理器执行本申请所提供的确定搜索结果的方法。本申请的非瞬时计算机可读存储介质存储计算机指令,该计算机指令用于使计算机执行本申请所提供的确定搜索结果的方法。
存储器802作为一种非瞬时计算机可读存储介质,可用于存储非瞬时软件程序、非瞬时计算机可执行程序以及模块,如本申请实施例中的确定搜索结果的方法对应的程序指令/模块。处理器801通过运行存储在 存储器802中的非瞬时软件程序、指令以及模块,从而执行服务器的各种功能应用以及数据处理,即实现上述方法实施例中的确定搜索结果的方法。
存储器802可以包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需要的应用程序;存储数据区可存储根据电子设备的使用所创建的数据等。此外,存储器802可以包括高速随机存取存储器,还可以包括非瞬时存储器,例如至少一个磁盘存储器件、闪存器件、或其他非瞬时固态存储器件。在一些实施例中,存储器802可选包括相对于处理器801远程设置的存储器,这些远程存储器可以通过网络连接至电子设备。上述网络的实例包括但不限于互联网、企业内部网、局域网、移动通信网及其组合。
确定搜索结果的方法的电子设备还可以包括:输入装置803和输出装置804。处理器801、存储器802、输入装置803和输出装置804可以通过总线或者其他方式连接,图8中以通过总线连接为例。
输入装置803可接收输入的数字或字符信息,以及产生与电子设备的用户设置以及功能控制有关的键信号输入,例如触摸屏、小键盘、鼠标、轨迹板、触摸板、指示杆、一个或者多个鼠标按钮、轨迹球、操纵杆等输入装置。输出装置804可以包括显示设备、辅助照明装置(例如,LED)和触觉反馈装置(例如,振动电机)等。该显示设备可以包括但不限于,液晶显示器(LCD)、发光二极管(LED)显示器和等离子体显示器。在一些实施方式中,显示设备可以是触摸屏。
此处描述的系统和技术的各种实施方式可以在数字电子电路系统、集成电路系统、专用ASIC(专用集成电路)、计算机硬件、固件、软件、 和/或它们的组合中实现。这些各种实施方式可以包括:实施在一个或者多个计算机程序中,该一个或者多个计算机程序可在包括至少一个可编程处理器的可编程系统上执行和/或解释,该可编程处理器可以是专用或者通用可编程处理器,可以从存储系统、至少一个输入装置、和至少一个输出装置接收数据和指令,并且将数据和指令传输至该存储系统、该至少一个输入装置、和该至少一个输出装置。
这些计算程序(也称作程序、软件、软件应用、或者代码)包括可编程处理器的机器指令,并且可以利用高级过程和/或面向对象的编程语言、和/或汇编/机器语言来实施这些计算程序。如本文使用的,术语“机器可读介质”和“计算机可读介质”指的是用于将机器指令和/或数据提供给可编程处理器的任何计算机程序产品、设备、和/或装置(例如,磁盘、光盘、存储器、可编程逻辑装置(PLD)),包括,接收作为机器可读信号的机器指令的机器可读介质。术语“机器可读信号”指的是用于将机器指令和/或数据提供给可编程处理器的任何信号。
为了提供与用户的交互,可以在计算机上实施此处描述的系统和技术,该计算机具有:用于向用户显示信息的显示装置(例如,CRT(阴极射线管)或者LCD(液晶显示器)监视器);以及键盘和指向装置(例如,鼠标或者轨迹球),用户可以通过该键盘和该指向装置来将输入提供给计算机。其它种类的装置还可以用于提供与用户的交互;例如,提供给用户的反馈可以是任何形式的传感反馈(例如,视觉反馈、听觉反馈、或者触觉反馈);并且可以用任何形式(包括声输入、语音输入或者、触觉输入)来接收来自用户的输入。
可以将此处描述的系统和技术实施在包括后台部件的计算系统(例 如,作为数据服务器)、或者包括中间件部件的计算系统(例如,应用服务器)、或者包括前端部件的计算系统(例如,具有图形用户界面或者网络浏览器的用户计算机,用户可以通过该图形用户界面或者该网络浏览器来与此处描述的系统和技术的实施方式交互)、或者包括这种后台部件、中间件部件、或者前端部件的任何组合的计算系统中。可以通过任何形式或者介质的数字数据通信(例如,通信网络)来将系统的部件相互连接。通信网络的示例包括:局域网(LAN)、广域网(WAN)和互联网。
计算机系统可以包括客户端和服务器。客户端和服务器一般远离彼此并且通常通过通信网络进行交互。通过在相应的计算机上运行并且彼此具有客户端-服务器关系的计算机程序来产生客户端和服务器的关系。
由以上描述可以看出,本申请实施例提供的方法、装置、设备和计算机存储介质可以具备以下优点:
1)本申请在确定搜索结果时综合考虑了用户的短期搜索历史所体现的搜索上下文的信息以及长期搜索历史所体现的用户个性化偏好,从而提高了搜索结果的准确性,使其更加符合用户的搜索需求。当其应用于实体推荐时,能够消除当前query的歧义,提供更加准确的符合用户搜索需求的相关实体。
2)本申请在进行搜索结果排序模型训练时,通过多任务模型学习框架,实现不同搜索结果之间的辅助训练,例如相关网页辅助相关实体的排序模型训练。从而利用不同任务之间的关联来提高模型的可扩展性和准确性。
3)本申请中所采用的多任务模型学习框架,能够借助辅助任务(即 第二排序子模型作为第一排序子模型的辅助任务)来缓解主任务中点击数据稀疏的问题。本申请中的多任务模型框架通过共享向量表示来实现知识迁移,多个相关任务的联合学习能够提升模型的泛化能力,经过实验验证,得到了更好的训练效果。
4)在短期搜索历史所体现的搜索上下文信息的向量化表示和长期搜索历史所体现的用户个性化偏好的向量化表示中,融合了query、被点击相关实体和被点击网页,从而更好地建模上下文和用户个性化偏好,且使得数据稀疏性问题得到很好地缓解。
应该理解,可以使用上面所示的各种形式的流程,重新排序、增加或删除步骤。例如,本发申请中记载的各步骤可以并行地执行也可以顺序地执行也可以不同的次序执行,只要能够实现本申请公开的技术方案所期望的结果,本文在此不进行限制。
上述具体实施方式,并不构成对本申请保护范围的限制。本领域技术人员应该明白的是,根据设计要求和其他因素,可以进行各种修改、组合、子组合和替代。任何在本申请的精神和原则之内所作的修改、等同替换和改进等,均应包含在本申请保护范围之内。

Claims (22)

  1. 一种确定搜索结果的方法,其特征在于,该方法包括:
    获取用户的当前query、所述用户在第一时长内的搜索历史信息、所述用户在第二时长内的搜索历史信息以及当前query的候选搜索结果,并输入搜索结果排序模型,依据所述搜索结果排序模型对所述候选搜索结果的评分,确定所述当前query对应的搜索结果,所述第二时长大于所述第一时长;
    其中所述搜索结果排序模型对所述候选结果的评分依据第一相似度和第二相似度确定,所述第一相似度为所述当前query的向量表示和所述用户在第一时长内的搜索历史信息的向量表示的整合与所述候选搜索结果的向量表示之间的相似度,所述第二相似度为所述当前query的向量表示和所述用户在第二时长内的搜索历史信息的向量表示的整合与所述候选搜索结果的向量表示之间的相似度。
  2. 根据权利要求1所述的方法,其特征在于,所述用户在第一时长内的搜索历史信息包括:同一会话中在所述当前query之前的query序列和query序列中各query对应的被点击搜索结果;
    所述用户在第二时长内的搜索历史信息包括:所述用户在第二时长内搜索的query和点击的搜索结果。
  3. 根据权利要求2所述的方法,其特征在于,所述用户在第一时长内的搜索历史信息的向量表示由以下方式得到:
    将所述query序列中各query的向量表示、所述各query对应的被点击搜索结果的向量表示采用注意力机制进行加权处理,得到所述用户在第一时长内的搜索历史信息的向量表示。
  4. 根据权利要求2所述的方法,其特征在于,所述用户在第二时长内的搜索历史信息的向量表示由以下方式得到:
    获取用户在第二时长内搜索的query集合和点击的搜索结果集合;
    将所述query集合和搜索结果集合进行切词处理后求并集,得到词集合;
    对所述词集合使用句向量的分布词袋PV-DBOW进行编码处理,得到所述用户在第二时长内的搜索历史信息的向量表示。
  5. 根据权利要求1所述的方法,其特征在于,所述候选搜索结果包括相关网页或相关实体;
    其中相关实体的向量表示为:所述相关实体的标识、名称以及实体描述的整合向量表示。
  6. 根据权利要求1或5所述的方法,其特征在于,该方法还包括:
    在搜索结果页中展现所述当前query对应的搜索结果。
  7. 一种训练搜索结果排序模型的方法,其特征在于,该方法包括:
    利用搜索日志获取训练样本,所述训练样本包括:样本query、用户在输入样本query之前第一时长内的搜索历史信息、用户在输入样本query之前第二时长内的搜索历史信息、样本query对应的搜索结果以及搜索结果的被点击状况;
    利用所述训练样本训练排序模型,以达到预设的训练目标;其中所述排序模型的输入包括样本query、用户在输入样本query之前第一时长内的搜索历史信息、用户在输入样本query之前第二时长内的搜索历史信息以及样本query对应的搜索结果,所述排序模型的输出包括对各搜索结果的评分;所述排序模型对各搜索结果的评分依据第一相似度和第 二相似度确定,所述第一相似度为所述样本query的向量表示和所述第一时长内的搜索历史信息的向量表示的整合与所述搜索结果的向量表示之间的相似度,所述第二相似度为所述样本query的向量表示和所述在第二时长内的搜索历史信息的向量表示的整合与所述搜索结果的向量表示之间的相似度;所述训练目标包括:最大化搜索结果被点击状况与搜索结果的评分之间的相关度;
    利用训练得到的排序模型,获取搜索结果排序模型。
  8. 根据权利要求7所述的方法,其特征在于,所述用户在输入样本query之前第一时长内的搜索历史信息包括:同一会话中在所述样本query之前的query序列和query序列中各query对应的被点击搜索结果;
    所述用户在输入样本query之前第二时长内的搜索历史信息包括:所述用户在输入样本query之前第二时长内搜索的query和点击的搜索结果。
  9. 根据权利要求8所述的方法,其特征在于,所述用户在输入样本query之前第一时长内的搜索历史信息的向量表示由以下方式得到:
    将所述query序列中各query的向量表示、所述各query对应的被点击搜索结果的向量表示采用注意力机制进行加权处理,得到所述用户在第一时长内的搜索历史信息的向量表示。
  10. 根据权利要求8所述的方法,其特征在于,所述用户在输入样本query之前第二时长内的搜索历史信息的向量表示由以下方式得到:
    获取用户在输入样本query之前第二时长内搜索的query集合和点击的搜索结果集合;
    将所述query集合和搜索结果集合进行切词处理后求并集,得到词 集合;
    对所述词集合使用句向量的分布词袋PV-DBOW进行编码处理,得到所述用户在输入样本query之前第二时长内的搜索历史信息的向量表示。
  11. 根据权利要求7所述的方法,其特征在于,所述搜索结果包括相关网页或相关实体;
    其中相关实体的向量表示为:所述相关实体的标识、名称以及实体描述的整合向量表示。
  12. 根据权利要求7至11中任一项所述的方法,其特征在于,所述搜索结果包括:第一类搜索结果和第二类搜索结果;
    所述排序模型包括:共享向量子模型、第一排序子模型和第二排序子模型;
    将所述样本query、用户在输入样本query之前第一时长内的搜索历史信息、用户在输入样本query之前第二时长内的搜索历史信息以及样本query对应的搜索结果输入所述共享向量子模型,得到所述共享向量子模型输出的所述样本query的向量表示和所述第一时长内的搜索历史信息的向量表示的整合,以及所述样本query的向量表示和所述在第二时长内的搜索历史信息的向量表示的整合;
    将所述共享向量子模型的输出以及样本query的第一类搜索结果输入所述第一排序子模型,得到对所述第一搜索结果的评分;以及将所述共享向量子模型的输出以及样本query的第二类搜索结果输入所述第二排序子模型,得到对所述第二搜索结果的评分;
    对所述第一排序子模型和第二排序子模型进行联合训练,以达到预 设的训练目标,所述训练目标包括:最大化第一类搜索结果被点击状况与第一类搜索结果的评分之间的相关度,以及最大化第二类搜索结果被点击状况与第二类搜索结果的评分之间的相关度;
    训练结束后,利用所述第一排序子模型和所述第二排序子模型中的一个以及所述共享向量子模型,得到所述搜索结果排序模型。
  13. 根据权利要求12所述的方法,其特征在于,对所述第一排序子模型和第二排序子模型进行联合训练包括:
    在训练迭代过程中,每次随机从所述第一排序子模型和所述第二排序子模型中选择一个进行训练,利用被选择的子模型的输出更新被选择的子模型和共享向量子模型的模型参数;或者,
    在训练迭代过程中,每次交替从所述第一排序子模型和所述第二排序子模型中选择一个进行训练,利用被选择的子模型的输出更新被选择的子模型和共享向量子模型的模型参数;或者,
    在训练迭代过程中,每次均对所述第一排序子模型和所述第二排序子模型进行训练,利用所述第一排序子模型和所述第二排序子模型的输出更新所有子模型的模型参数。
  14. 一种确定搜索结果的装置,其特征在于,该装置包括:
    获取单元,用于获取用户的当前query、所述用户在第一时长内的搜索历史信息、所述用户在第二时长内的搜索历史信息以及当前query的候选搜索结果;
    确定单元,用于将所述当前query、所述用户在第一时长内的搜索历史信息、所述用户在第二时长内的搜索历史信息以及当前query的候选搜索结果输入搜索结果排序模型,依据所述搜索结果排序模型对所述候 选搜索结果的评分,确定所述当前query对应的搜索结果,所述第二时长大于所述第一时长;
    其中所述搜索结果排序模型对所述候选结果的评分依据第一相似度和第二相似度确定,所述第一相似度为所述当前query的向量表示和所述用户在第一时长内的搜索历史信息的向量表示的整合与所述候选搜索结果的向量表示之间的相似度,所述第二相似度为所述当前query的向量表示和所述用户在第二时长内的搜索历史信息的向量表示的整合与所述候选搜索结果的向量表示之间的相似度。
  15. 根据权利要求14所述的装置,其特征在于,所述用户在第一时长内的搜索历史信息包括:同一会话中在所述当前query之前的query序列和query序列中各query对应的被点击搜索结果;
    所述用户在第二时长内的搜索历史信息包括:用户在第二时长内搜索的query和点击的搜索结果。
  16. 根据权利要求14所述的装置,其特征在于,所述候选搜索结果包括相关网页或相关实体;
    其中相关实体的向量表示为:所述相关实体的标识、名称以及实体描述的整合向量表示。
  17. 一种训练搜索结果排序模型的装置,其特征在于,该装置包括:
    样本获取单元,用于利用搜索日志获取训练样本,所述训练样本包括:样本query、用户在输入样本query之前第一时长内的搜索历史信息、用户在输入样本query之前第二时长内的搜索历史信息、样本query对应的搜索结果以及搜索结果的被点击状况;
    模型训练单元,用于利用所述训练样本训练排序模型,以达到预设 的训练目标;其中所述排序模型的输入包括样本query、用户在输入样本query之前第一时长内的搜索历史信息、用户在输入样本query之前第二时长内的搜索历史信息以及样本query对应的搜索结果,所述排序模型的输出包括对各搜索结果的评分;所述排序模型对各搜索结果的评分依据第一相似度和第二相似度确定,所述第一相似度为所述样本query的向量表示和所述第一时长内的搜索历史信息的向量表示的整合与所述搜索结果的向量表示之间的相似度,所述第二相似度为所述样本query的向量表示和所述在第二时长内的搜索历史信息的向量表示的整合与所述搜索结果的向量表示之间的相似度;所述训练目标包括:最大化搜索结果被点击状况与搜索结果的评分之间的相关度;
    模型获取单元,用于利用训练得到的排序模型,获取搜索结果排序模型。
  18. 根据权利要求17所述的装置,其特征在于,所述用户在输入样本query之前第一时长内的搜索历史信息包括:同一会话中在所述样本query之前的query序列和query序列中各query对应的被点击搜索结果;
    所述用户在输入样本query之前第二时长内的搜索历史信息包括:用户在输入样本query之前第二时长内搜索的query和点击的搜索结果。
  19. 根据权利要求17或18所述的装置,其特征在于,所述搜索结果包括:第一类搜索结果和第二类搜索结果;
    所述排序模型包括:共享向量子模型、第一排序子模型和第二排序子模型;
    所述模型训练单元,具体用于将所述样本query、用户在输入样本query之前第一时长内的搜索历史信息、用户在输入样本query之前第二 时长内的搜索历史信息以及样本query对应的搜索结果输入所述共享向量子模型,得到所述共享向量子模型输出的所述样本query的向量表示和所述第一时长内的搜索历史信息的向量表示的整合,以及所述样本query的向量表示和所述在第二时长内的搜索历史信息的向量表示的整合;将所述共享向量子模型的输出以及样本query的第一类搜索结果输入所述第一排序子模型,得到对所述第一搜索结果的评分;以及将所述共享向量子模型的输出以及样本query的第二类搜索结果输入所述第二排序子模型,得到对所述第二搜索结果的评分;对所述第一排序子模型和第二排序子模型进行联合训练,以达到预设的训练目标,所述训练目标包括:最大化第一类搜索结果被点击状况与第一类搜索结果的评分之间的相关度,以及最大化第二类搜索结果被点击状况与第二类搜索结果的评分之间的相关度;
    所述模型获取单元,具体用于在所述模型训练单元训练结束后,利用所述第一排序子模型和所述第二排序子模型中的一个以及所述共享向量子模型,得到所述搜索结果排序模型。
  20. 根据权利要求19所述的装置,其特征在于,所述模型训练单元在对所述第一排序子模型和第二排序子模型进行联合训练时,具体执行:
    在训练迭代过程中,每次随机从所述第一排序子模型和所述第二排序子模型中选择一个进行训练,利用被选择的子模型的输出更新被选择的子模型和共享向量子模型的模型参数;或者,
    在训练迭代过程中,每次交替从所述第一排序子模型和所述第二排序子模型中选择一个进行训练,利用被选择的子模型的输出更新被选择的子模型和共享向量子模型的模型参数;或者,
    在训练迭代过程中,每次均对所述第一排序子模型和所述第二排序子模型进行训练,利用所述第一排序子模型和所述第二排序子模型的输出更新所有子模型的模型参数。
  21. 一种电子设备,其特征在于,包括:
    至少一个处理器;以及
    与所述至少一个处理器通信连接的存储器;其中,
    所述存储器存储有可被所述至少一个处理器执行的指令,所述指令被所述至少一个处理器执行,以使所述至少一个处理器能够执行权利要求1-13中任一项所述的方法。
  22. 一种存储有计算机指令的非瞬时计算机可读存储介质,其特征在于,所述计算机指令用于使所述计算机执行权利要求1-13中任一项所述的方法。
PCT/CN2020/092742 2019-12-27 2020-05-28 确定搜索结果的方法、装置、设备和计算机存储介质 WO2021128729A1 (zh)

Priority Applications (4)

Application Number Priority Date Filing Date Title
US17/602,304 US11734373B2 (en) 2019-12-27 2020-05-28 Method, apparatus, device and computer storage medium for determining search result
EP20904682.0A EP3937032A4 (en) 2019-12-27 2020-05-28 Search result determination method, device, apparatus, and computer storage medium
JP2022506430A JP7379804B2 (ja) 2019-12-27 2020-05-28 検索結果を決定する方法、装置、機器、及びコンピュータ記憶媒体
KR1020217039536A KR20220003085A (ko) 2019-12-27 2020-05-28 검색 결과를 결정하는 방법, 장치, 기기 및 컴퓨터 기록 매체

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201911373544.1 2019-12-27
CN201911373544.1A CN111177551B (zh) 2019-12-27 2019-12-27 确定搜索结果的方法、装置、设备和计算机存储介质

Publications (2)

Publication Number Publication Date
WO2021128729A1 true WO2021128729A1 (zh) 2021-07-01
WO2021128729A9 WO2021128729A9 (zh) 2021-11-04

Family

ID=70655783

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/092742 WO2021128729A1 (zh) 2019-12-27 2020-05-28 确定搜索结果的方法、装置、设备和计算机存储介质

Country Status (6)

Country Link
US (1) US11734373B2 (zh)
EP (1) EP3937032A4 (zh)
JP (1) JP7379804B2 (zh)
KR (1) KR20220003085A (zh)
CN (1) CN111177551B (zh)
WO (1) WO2021128729A1 (zh)

Families Citing this family (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111177551B (zh) 2019-12-27 2021-04-16 百度在线网络技术(北京)有限公司 确定搜索结果的方法、装置、设备和计算机存储介质
CN112163147A (zh) * 2020-06-09 2021-01-01 中森云链(成都)科技有限责任公司 一种用于网站会话场景的推荐方法
CN111783452B (zh) * 2020-06-30 2024-04-02 北京百度网讯科技有限公司 模型训练方法、信息处理方法、装置、设备及存储介质
CN111897943A (zh) * 2020-08-17 2020-11-06 腾讯科技(深圳)有限公司 会话记录搜索方法、装置、电子设备及存储介质
CN112100480B (zh) * 2020-09-15 2024-07-30 北京百度网讯科技有限公司 搜索方法、装置、设备及存储介质
CN112231545B (zh) * 2020-09-30 2023-12-22 北京三快在线科技有限公司 聚块集合的排序方法、装置、设备及存储介质
CN112632406B (zh) * 2020-10-10 2024-04-09 咪咕文化科技有限公司 查询方法、装置、电子设备及存储介质
CN112364235A (zh) * 2020-11-19 2021-02-12 北京字节跳动网络技术有限公司 搜索处理方法、模型训练方法、装置、介质及设备
KR102373486B1 (ko) * 2021-08-09 2022-03-14 쿠팡 주식회사 브랜드 정보 제공 방법 및 그 장치
CN116501951A (zh) * 2022-01-19 2023-07-28 南京中兴新软件有限责任公司 搜索结果排序方法、搜索系统、计算机可读存储介质
CN115238126A (zh) * 2022-07-28 2022-10-25 腾讯科技(深圳)有限公司 搜索结果重排序方法、装置、设备及计算机存储介质
WO2024096370A1 (ko) * 2022-11-01 2024-05-10 한화솔루션(주) 분산된 지식 정보의 싱글 윈도우 내 통합 검색 및 사용자 검색 패턴 기반 지식 정보의 추천을 수행하는 플랫폼 서버, 이를 포함하는 서비스 제공 시스템 및 서비스 제공 방법
CN115994664B (zh) * 2023-01-04 2023-08-08 浙江中兴慧农信息科技有限公司 一种共享冷库模式的智能推荐的方法、装置及设备
CN117331893B (zh) * 2023-09-20 2024-10-15 中移互联网有限公司 搜索方法、装置、电子设备和存储介质

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103577489A (zh) * 2012-08-08 2014-02-12 百度在线网络技术(北京)有限公司 一种网页浏览历史查询方法及装置
CN105677780A (zh) * 2014-12-31 2016-06-15 Tcl集团股份有限公司 可拓展的用户意图挖掘方法及其系统
CN109033140A (zh) * 2018-06-08 2018-12-18 北京百度网讯科技有限公司 一种确定搜索结果的方法、装置、设备和计算机存储介质
US20190130013A1 (en) * 2017-10-26 2019-05-02 Salesforce.com. inc. User clustering based on query history
CN111177551A (zh) * 2019-12-27 2020-05-19 百度在线网络技术(北京)有限公司 确定搜索结果的方法、装置、设备和计算机存储介质

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8719025B2 (en) * 2012-05-14 2014-05-06 International Business Machines Corporation Contextual voice query dilation to improve spoken web searching
CN105528388B (zh) * 2015-11-04 2020-12-11 百度在线网络技术(北京)有限公司 搜索推荐方法和装置
CN106649605B (zh) * 2016-11-28 2020-09-29 百度在线网络技术(北京)有限公司 一种推广关键词的触发方法及装置
JP6744353B2 (ja) 2017-04-06 2020-08-19 ネイバー コーポレーションNAVER Corporation ディープラーニングを活用した個人化商品推薦
CN107506402B (zh) * 2017-08-03 2021-06-11 北京百度网讯科技有限公司 搜索结果的排序方法、装置、设备及计算机可读存储介质
CN110196904B (zh) * 2018-02-26 2023-04-18 佛山市顺德区美的电热电器制造有限公司 一种获取推荐信息的方法、装置及计算机可读存储介质
CN108345702A (zh) * 2018-04-10 2018-07-31 北京百度网讯科技有限公司 实体推荐方法和装置
CN110245289A (zh) * 2019-05-20 2019-09-17 中国平安财产保险股份有限公司 一种信息搜索方法以及相关设备

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103577489A (zh) * 2012-08-08 2014-02-12 百度在线网络技术(北京)有限公司 一种网页浏览历史查询方法及装置
CN105677780A (zh) * 2014-12-31 2016-06-15 Tcl集团股份有限公司 可拓展的用户意图挖掘方法及其系统
US20190130013A1 (en) * 2017-10-26 2019-05-02 Salesforce.com. inc. User clustering based on query history
CN109033140A (zh) * 2018-06-08 2018-12-18 北京百度网讯科技有限公司 一种确定搜索结果的方法、装置、设备和计算机存储介质
CN111177551A (zh) * 2019-12-27 2020-05-19 百度在线网络技术(北京)有限公司 确定搜索结果的方法、装置、设备和计算机存储介质

Also Published As

Publication number Publication date
EP3937032A4 (en) 2022-06-29
WO2021128729A9 (zh) 2021-11-04
JP7379804B2 (ja) 2023-11-15
KR20220003085A (ko) 2022-01-07
US11734373B2 (en) 2023-08-22
CN111177551A (zh) 2020-05-19
CN111177551B (zh) 2021-04-16
JP2022540508A (ja) 2022-09-15
EP3937032A1 (en) 2022-01-12
US20220237251A1 (en) 2022-07-28

Similar Documents

Publication Publication Date Title
WO2021128729A1 (zh) 确定搜索结果的方法、装置、设备和计算机存储介质
AU2020321751B2 (en) Neural network system for text classification
CN109033140B (zh) 一种确定搜索结果的方法、装置、设备和计算机存储介质
KR102354716B1 (ko) 딥 러닝 모델을 이용한 상황 의존 검색 기법
US11232154B2 (en) Neural related search query generation
Wu et al. Fine-grained image captioning with global-local discriminative objective
US8984012B2 (en) Self-tuning alterations framework
US20190251422A1 (en) Deep neural network architecture for search
WO2018018626A1 (en) Conversation oriented machine-user interaction
JP6361351B2 (ja) 発話ワードをランク付けする方法、プログラム及び計算処理システム
CN110297890B (zh) 使用交互式自然语言对话的图像获取
US20170255693A1 (en) Providing images for search queries
WO2021139209A1 (zh) 查询自动补全的方法、装置、设备和计算机存储介质
CN110929114A (zh) 利用动态记忆网络来跟踪数字对话状态并生成响应
WO2020086131A1 (en) Method and system for decoding user intent from natural language queries
CN111125538B (zh) 一个利用实体信息增强个性化检索效果的搜索方法
CN112507091A (zh) 检索信息的方法、装置、设备以及存储介质
CN112579750A (zh) 相似病案的检索方法、装置、设备及存储介质
WO2021051587A1 (zh) 基于语意识别的搜索结果排序方法、装置、电子设备及存储介质
US12099803B2 (en) Training a model in a data-scarce environment using added parameter information
CN113595770B (zh) 群组点击率预估方法、装置、电子设备和存储介质
US8577909B1 (en) Query translation using bilingual search refinements
CN111881255B (zh) 同义文本获取方法、装置、电子设备及存储介质
US20240338553A1 (en) Recommending backgrounds based on user intent
CN117668342A (zh) 双塔模型的训练方法及商品召回方法

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20904682

Country of ref document: EP

Kind code of ref document: A1

ENP Entry into the national phase

Ref document number: 2020904682

Country of ref document: EP

Effective date: 20211006

ENP Entry into the national phase

Ref document number: 20217039536

Country of ref document: KR

Kind code of ref document: A

ENP Entry into the national phase

Ref document number: 2022506430

Country of ref document: JP

Kind code of ref document: A

NENP Non-entry into the national phase

Ref country code: DE