Model training method, device, electronic device and readable storage medium for determining matching degree
By training the target model used to determine the matching degree, use the semantic correlation vector in the POI comment to solve the problem of judgment with the correlation with merchants or merchants in the O2O search scenario, and improve the accuracy and user experience.
Patent Information
- Application Number
- CN202010990380.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-09-18
- Publication Date
- 2025-01-24
- Estimated Expiration
- 2040-09-18
AI Technical Summary
In the O2O search scenario, it is difficult to accurately judge the correlation between user query terms and merchants or products, resulting in inaccurate search results and poor user experience.
By obtaining user query information, related POI search results and comment collections, the semantic correlation between the target comments and the query information is determined, a vector representation is generated, and these vectors are used as training data to train the target model for determining the matching degree. .
The success rate and accuracy of the search results can be improved. If the title or profile of the POI is not included, the deeper relationship between the query information and the POI can be identified and the user experience is enhanced.
Smart Images

Figure CN112182126B_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present disclosure relate to the field of Internet technology, and in particular, to a model training method, device, electronic device, and readable storage medium for determining a matching degree. Background Art
[0002] Determining the relevance of text is a fundamental problem in natural language processing. In areas such as information retrieval systems and dialogue systems, how to measure the relevance between sentences or phrases is particularly important.
[0003] O2O (Online to Offline) combines offline business opportunities with the Internet, making the Internet the front desk of offline transactions. In O2O search scenarios, user search requests are relatively clear, usually focusing on structured merchants and products. Merchant searches and product searches account for about 40% of the entire search traffic. Therefore, how to more accurately judge the relevance between the user's query terms and the merchant or product being searched is a key factor affecting search accuracy and user search experience.
[0004] However, since the merchant name or merchant profile often contains relatively little information, it is difficult to retrieve matching search results when the query term (Query) is long and complex. Summary of the invention
[0005] Embodiments of the present disclosure provide a model training method, device, electronic device, and readable storage medium for determining a degree of matching, so as to improve the success rate and accuracy of searches.
[0006] According to a first aspect of an embodiment of the present disclosure, a model training method for determining a matching degree is provided, the method comprising:
[0007] Obtain query information, POI search results related to the query information, and a comment set corresponding to each POI in the POI search results;
[0008] Determine, in the comment set corresponding to each POI, a target comment corresponding to each POI, wherein the target comment satisfies a preset correlation condition with the query information;
[0009] Generate a first vector according to the target comments corresponding to each POI, where the first vector is used to represent the semantic relevance between the target comments and the query information;
[0010] The first vector, the second vector corresponding to the query information, the third vector corresponding to each POI in the POI search result, and the correlation annotation information between the query information and each POI are used as training data to train a target model for determining a matching degree.
[0011] According to a second aspect of an embodiment of the present disclosure, a model training device for determining a matching degree is provided, the device comprising:
[0012] Receive current query information input by the user;
[0013] Acquire a set of candidate POIs related to the current query information;
[0014] Each candidate POI in the candidate POI set and the current query information are respectively input into a target model, and the matching degree between each candidate POI and the current query information is output through the target model, and the target model is trained according to the above-mentioned model training method for determining the matching degree.
[0015] According to a third aspect of an embodiment of the present disclosure, a model training device for determining a matching degree is provided, comprising:
[0016] A data acquisition module, used to acquire query information, POI search results related to the query information, and a comment set corresponding to each POI in the POI search results;
[0017] A target determination module, used to determine a target comment corresponding to each POI in the comment set corresponding to each POI, wherein the target comment satisfies a preset correlation condition with the query information;
[0018] A vector representation module, used to generate a first vector according to the target comment corresponding to each POI, wherein the first vector is used to represent the semantic relevance between the target comment and the query information;
[0019] The model training module is used to train a target model for determining a matching degree by using the first vector, the second vector corresponding to the query information, the third vector corresponding to each POI in the POI search result, and the correlation annotation information between the query information and each POI as training data.
[0020] According to a fourth aspect of an embodiment of the present disclosure, there is provided a device for determining a matching degree, including:
[0021] An information receiving module, used for receiving current query information input by a user;
[0022] A candidate acquisition module, used to acquire a set of candidate POIs related to the current query information;
[0023] A matching calculation module is used to input each candidate POI in the candidate POI set and the current query information into a target model respectively, and output the matching degree between each candidate POI and the current query information through the target model, and the target model is trained according to the above-mentioned model training method for determining the matching degree.
[0024] According to a fifth aspect of an embodiment of the present disclosure, there is provided an electronic device, including:
[0025] A processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the processor implements the aforementioned model training method for determining the degree of matching when executing the program.
[0026] According to a sixth aspect of an embodiment of the present disclosure, a readable storage medium is provided. When instructions in the storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute the aforementioned model training method for determining a degree of matching.
[0027] The embodiments of the present disclosure provide a model training method, device, electronic device and readable storage medium for determining a matching degree, the method comprising:
[0028] In the process of training the target model for determining the matching degree, the disclosed embodiment determines the training data according to the query information, the POI search results related to the query information, and the comment information corresponding to each POI in the POI search results, and integrates the target comment information with semantic relevance to the query information during the training process. Thus, the trained target model can identify the deeper (implicit in the comment information) association between the POI search results and the query information on the basis of the correlation between the POI search results and the query information text, and the comment information comes from a large number of users and can reflect the user's true intention. Therefore, in the case of more complex query information, even if the title or introduction of the POI does not contain content related to the query information, the target model of the disclosed embodiment can still retrieve the POI search results related to the query information, which can improve the success rate and accuracy of the search, and improve the user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] In order to more clearly illustrate the technical solutions of the embodiments of the present disclosure, the drawings required for use in the description of the embodiments of the present disclosure will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the embodiments of the present disclosure. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0030] Figure 1A flowchart of the steps of a model training method for determining a matching degree in one embodiment of the present disclosure is shown;
[0031] Figure 2 A flowchart of the steps of a method for determining a matching degree in one embodiment of the present disclosure is shown;
[0032] Figure 3 A structural diagram of a model training device for determining a matching degree in one embodiment of the present disclosure is shown;
[0033] Figure 4 A structural diagram of a device for determining a matching degree in one embodiment of the present disclosure is shown;
[0034] Figure 5 A structural diagram of an electronic device provided by an embodiment of the present disclosure is shown. DETAILED DESCRIPTION
[0035] The following will be combined with the drawings in the embodiments of the present disclosure to clearly and completely describe the technical solutions in the embodiments of the present disclosure. Obviously, the described embodiments are part of the embodiments of the present disclosure, rather than all of the embodiments. Based on the embodiments in the embodiments of the present disclosure, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the embodiments of the present disclosure.
[0036] Embodiment 1
[0037] Reference Figure 1 , which shows a flowchart of the steps of a model training method for determining a matching degree in one embodiment of the present disclosure, the method comprising:
[0038] Step 101: Obtain query information, POI search results related to the query information, and a comment set corresponding to each POI in the POI search results;
[0039] Step 102: Determine, in the comment set corresponding to each POI, a target comment corresponding to each POI, wherein the target comment satisfies a preset correlation condition with the query information;
[0040] Step 103: Generate a first vector according to the target comments corresponding to each POI, where the first vector is used to represent the semantic relevance between the target comments and the query information;
[0041] Step 104: Use the first vector, the second vector corresponding to the query information, the third vector corresponding to each POI in the POI search result, and the correlation annotation information between the query information and each POI as training data to train a target model for determining a matching degree.
[0042] The disclosed embodiment provides a model training method for determining the matching degree. In the POI search scenario, the target model can be used to calculate the matching degree between the query information and the POI (Point of Information) search results. It can be understood that the disclosed embodiment takes the e-commerce search scenario as an example. In actual applications, a POI can be a house, a merchant, a commodity, a mailbox, a bus stop, etc.
[0043] The query information is the information entered by the user in the search box of the search engine. It should be noted that the embodiments of the present disclosure do not limit the specific type of the query information. The query information may be text information, voice information, image information, etc. When the query information is text information, the text information may be analyzed to obtain a query word or a query statement; when the query information is voice information, the voice information may be subjected to voice recognition to obtain the corresponding text information, and then the text information may be analyzed; when the query information is image information, if the image information contains text content, the image information may be subjected to text recognition to obtain the corresponding text information, and then the text information may be analyzed; if the image information does not contain text content, the image information may be subjected to image processing to identify the content contained in the image information, and the content may be used as the query information.
[0044] The embodiments of the present disclosure can collect historical operation data of users to construct training data for training the target model. The historical operation data includes user-generated content data and user search behavior data. The historical operation data can be derived from user logs, for example, user search logs and / or click logs can be obtained.
[0045] The user's historical operation data includes the user's search data, and each piece of search data includes query information and search results. Therefore, for each piece of search data, the query information, the POI search results related to the query information, and the comment set corresponding to each POI in the POI search results can be extracted.
[0046] In one example, the query information is "a place suitable for couples to chat and drink coffee". Since the query information is relatively complex, it is difficult to find POI search results that match the query information based on the POI name and POI profile. To solve this problem, in the process of constructing training data, the disclosed embodiment uses the feature that the comment information contains richer and more user-intent content, fully mines the comment information of POIs, and mines the association between the comment information of POIs and the query information, so that the constructed training data contains deeper associations (implicit in the comment information), and the trained target model can identify deeper correlations between the query information and the search results.
[0047] Since the data volume of the comment information corresponding to each POI is large, and some comments have little relevance to the query information. Therefore, in the embodiment of the present disclosure, in the comment set corresponding to each POI, a target comment that satisfies a preset correlation condition with the query information is determined. Among them, satisfying the preset correlation condition indicates that the target comment has a strong correlation with the query information. For example, for a certain POI, assuming that the POI includes the following comment information: "The coffee here is very good, the environment is quiet, and it is suitable for couples to chat", then the POI has a strong correlation with the query information "a place suitable for couples to chat and drink coffee", and the comment information can be used as the target comment of the POI.
[0048] In an optional embodiment of the present disclosure, determining the target comment corresponding to each POI in the comment set corresponding to each POI in step 102 may include:
[0049] Step S11: for each comment set corresponding to each POI, semantic matching is performed on each comment therein with the query information one by one to obtain the semantic relevance of each comment with the query information;
[0050] Step S12: sorting the comment sets corresponding to each POI according to the semantic relevance to obtain a sorting result for each comment set;
[0051] Step S13: For the sorting results of the comment set corresponding to each POI, at least one comment whose sorting results meet preset requirements is used as the target comment corresponding to each POI.
[0052] Semantic matching, i.e. identifying the semantic relationship between two texts, is one of the basic tasks of natural language processing. In the embodiment of the present disclosure, for each set of comments corresponding to each POI, each comment therein is semantically matched with the query information one by one to obtain the semantic relevance of each comment with the query information.
[0053] It should be noted that the embodiments of the present disclosure do not limit the semantic matching method. For example, a semantic matching method based on keywords can be used, and word level information such as word weight can be used to assist in the judgment. Alternatively, a semantic matching method based on a semantic matching model can also be used, which can better calculate the semantic relevance of non-keyword hits.
[0054] After calculating the semantic relevance between each comment and the query information, the comment set corresponding to each POI is sorted according to the semantic relevance to obtain the sorting result of each comment set. In an example, the query information is "a place suitable for couples to chat and drink coffee". Since the query information is relatively complex, it is difficult to retrieve matching POI search results based on the name and introduction of the POI. Therefore, the embodiment of the present disclosure can extract keywords in the query information and retrieve POI search results related to the query information according to the keywords. For example, the keyword "drinking coffee" in the query information can be extracted, and then the POI search results related to "drinking coffee" can be retrieved. For example, the POI search results related to the query information retrieved include the following POIs: Carving Time Cafe, Youjian Coffee, Zhiyi Cafe, etc. Each POI in the POI search results corresponds to its own comment set. The embodiment of the present disclosure sorts the comment set corresponding to each POI in the POI search results to obtain the sorting result of each comment set. For example, for the comment set corresponding to the POI "Carving Time Cafe", the comment set is sorted according to the semantic relevance between each comment and the query information to obtain the sorting result. At least one comment that meets the preset requirements in the sorting results is used as the target comment that meets the preset related conditions with the query information. For example, for the sorting results of the comment set corresponding to the POI "Carving Time Cafe", the topK (K is a positive integer, such as K=10) comments are used as the target comments of the POI "Carving Time Cafe". Similarly, for the POI "Youjian Coffee", for the sorting results of the comment set corresponding to the POI "Youjian Coffee", the topK comments are used as the target comments of the POI "Youjian Coffee". Similarly, the comment set corresponding to each POI in the POI search results corresponding to the query information "A place suitable for couples to chat and drink coffee" is sorted to determine the target comments corresponding to each POI. The number of target comments corresponding to each POI can be one or more.
[0055] In the comment set corresponding to each POI, after determining the target comment corresponding to each POI, the target comment corresponding to each POI is vectorized to generate a first vector, the first vector is used to represent the semantic relevance between the target comment and the query information, and the query information is vectorized to generate a second vector, and each POI in the POI search results is vectorized to generate a third vector corresponding to each POI. In addition, after obtaining the query information, the POI search results related to the query information, and the comment set corresponding to each POI in the POI search results, the embodiment of the present disclosure performs correlation annotation on the query information and each POI in the POI search results to obtain correlation annotation information.
[0056] Therefore, the first vector, the second vector corresponding to the query information, the third vector corresponding to each POI in the POI search results, and the correlation annotation information between the query information and the POIs can be used as training data to train a target model for determining the matching degree.
[0057] In an optional embodiment of the present disclosure, generating a first vector according to the target comments corresponding to each POI in step 103 may include:
[0058] Step S21, inputting the target comments corresponding to each POI and the query information into a deep reading comprehension model, and outputting a relevance vector representation of each target comment corresponding to each POI and the query information through the deep reading comprehension model;
[0059] Step S22: Generate a first vector for representing the relevance between all target comments corresponding to each POI and the query information according to the relevance vector representation between each target comment corresponding to each POI and the query information.
[0060] Machine reading comprehension is one of the core tasks of natural language processing and an important task for evaluating the model's ability to understand text. Its essence can be regarded as a sentence relationship matching task.
[0061] For POI search results related to the query information, the target comments corresponding to each POI and the query information are input into a deep reading comprehension model, and the deep reading comprehension model outputs a relevance vector representation of each target comment corresponding to each POI and the query information.
[0062] The deep reading comprehension model mainly includes the following functional modules: input encoding module, content interaction module, and output prediction module. Among them, the input encoding module receives the input query information and the target comment corresponding to the current POI, and performs word vector conversion on the query information and each of the target comments to obtain the word vector representation of the query information and each of the target comments respectively. The content interaction module is used to extract the correlation between the query information and each target comment. Specifically, the similarity is calculated for each word in the query information and each word in the target comment, so that a similarity matrix can be generated, and then the correlation vector representation of each target comment corresponding to each POI and the query information can be output.
[0063] Next, according to the relevance vector representation between each target comment corresponding to each POI and the query information, a first vector for representing the relevance between all target comments corresponding to each POI and the query information is generated.
[0064] In an optional embodiment of the present disclosure, the step S22 generates a first vector representing the relevance of all target comments corresponding to each POI and the query information according to the relevance vector representation of each target comment corresponding to each POI and the query information, including:
[0065] Attention calculation is performed on a relevance vector representation of each target comment corresponding to each POI and the query information to obtain a first vector for representing the relevance of all target comments corresponding to each POI and the query information.
[0066] The embodiment of the present disclosure introduces an attention mechanism in the process of calculating the first vector. The reason for using the attention mechanism is that when using a deep neural network to process complex tasks (for example, when processing a large amount of input information), if the input is only converted into a corresponding vector representation through a deep neural network, then the vector representation is difficult to reflect all the semantic information of the input. Accordingly, the attention mechanism can be used to encode only relevant information according to the needs of the task, ignoring minor information to reduce the amount of input. Based on the attention mechanism, it is possible to focus on the relevant parts of the query information and the target comments, so that the useless information part is ignored and the important information part is strengthened.
[0067] In addition, the disclosed embodiment can also utilize the multi-document cross-verification function of the deep reading comprehension model to perform multi-document cross-verification on all target comments corresponding to each POI, and finally calculate the vector representation of the target comments corresponding to each POI.
[0068] After vectorizing the target comments corresponding to each POI to obtain a first vector, vectorizing the query information to obtain a second vector, and vectorizing each POI in the POI search results to obtain a third vector corresponding to each POI, the first vector, the second vector, the third vector, and the correlation annotation information between the query information and the POIs can be used as training data to train a target model for determining a matching degree.
[0069] It should be noted that the embodiment of the present disclosure does not limit the model structure and training method of the target model. The target model can be a classification model that integrates multiple neural networks. The neural network includes but is not limited to the combination, superposition, and nesting of at least one or at least two of the following: CNN (Convolutional Neural Network), LSTM (Long Short-Term Memory), RNN (Simple Recurrent Neural Network), attention neural network, etc.
[0070] In an optional embodiment of the present disclosure, the training of a target model for determining a matching degree using the first vector, the second vector corresponding to the query information, the third vector corresponding to each POI in the POI search result, and the correlation annotation information between the query information and each POI as training data may include:
[0071] Step S31, based on the initial model parameters, according to the first vector, the second vector, and the third vector, calculating the matching degree between the query information and each POI in the POI search result;
[0072] Step S32: adjusting the initial model parameters according to the error between the matching degree and the correlation annotation information, iterating until the error meets a preset condition, and obtaining a trained target model.
[0073] First, the embodiment of the present disclosure can construct and initialize the target model and set the initial model parameters of the initial model; then, the training data are input into the initial model one by one, and the initial model is iteratively optimized according to the error between the output result of the initial model and the correlation annotation information in the training data, and the gradient descent algorithm, and the initial model parameters are adjusted until the error generated by the optimized model meets the preset conditions, and the iterative optimization is stopped, and the model obtained by the last optimization is used as the target model after the training is completed.
[0074] The disclosed embodiment extracts features related to the query information in user comments through a deep reading comprehension model, and then uses these features to further obtain a vector representation of the target comments related to the query information, thereby realizing the correlation calculation between the query information and the POI search results. Since the business name and business profile usually only contain basic information, and the user's comments may contain more diverse information, therefore, through the disclosed embodiment, when the input query information is a query information with complex requirements such as "a place suitable for couples to chat and drink coffee", the disclosed embodiment can match the query information to the POI search results that meet the user's needs.
[0075] In an optional embodiment of the present disclosure, after obtaining the trained target model, the method may further include:
[0076] Reinforcement learning is performed on the target model based on policy gradient to obtain an optimized target model, wherein the reward value of the reinforcement learning is the matching degree of the target model output, the action of the reinforcement learning is whether to select the current comment as the target comment, and the state of the reinforcement learning is the target comment selected historically.
[0077] In the embodiment of the present disclosure, in the process of semantically matching each comment in the comment set corresponding to each POI with the query information one by one, an unsupervised semantic matching model can be used to reduce data processing costs. After calculating the matching degree between the query information and each POI in the POI search results according to the first vector, the second vector, and the third vector, the calculated matching degree is further subjected to reinforcement learning joint training to optimize the model parameters of the target model.
[0078] Preferably, the embodiment of the present disclosure adopts a reinforcement learning algorithm based on PolicyGradient. Reward is the matching degree calculated by the target model, action is whether to select the current comment as the target comment, and status is the target comment selected in history, which is solved by the PolicyGradient algorithm.
[0079] PolicyGradient can directly output actions or the probability of actions based on the state, and use the reward value to enhance or weaken the possibility of selecting actions. Good actions will increase the probability of being selected next time, and bad actions will reduce the probability of being selected next time.
[0080] In summary, in the process of training the target model for determining the matching degree, the embodiment of the present disclosure determines the training data according to the query information, the POI search results related to the query information, and the comment information corresponding to each POI in the POI search results, and integrates the target comment information with semantic relevance to the query information during the training process. As a result, the trained target model can identify the deeper (implicit in the comment information) association between the POI search results and the query information on the basis of the correlation between the POI search results and the query information text, and the comment information comes from a large number of users and can reflect the user's true intention. Therefore, in the case of more complex query information, even if the title or introduction of the POI does not contain content related to the query information, the target model of the embodiment of the present disclosure can still retrieve the POI search results related to the query information, which can improve the success rate and accuracy of the search, so as to improve the user experience.
[0081] Embodiment 2
[0082] Reference Figure 2 , which shows a flowchart of the steps of a method for determining a matching degree in an embodiment of the present disclosure, the method comprising:
[0083] Step 201: receiving current query information input by a user;
[0084] Step 202: Obtain a set of candidate POIs related to the current query information;
[0085] Step 203: input each candidate POI in the candidate POI set and the current query information into a target model respectively, and output the matching degree between each candidate POI and the current query information through the target model, wherein the target model is trained according to the above-mentioned model training method for determining the matching degree.
[0086] After the target model is trained by the model training method for determining the matching degree according to the embodiment of the present disclosure, the matching degree between the query information and the POI can be calculated using the target model.
[0087] The method for determining the degree of matching provided by the present disclosure can be applied to electronic devices, which specifically include but are not limited to: smart phones, tablet computers, e-book readers, MP3 (Moving Picture Experts Group Audio Layer III) players, MP4 (Moving Picture Experts Group Audio Layer IV) players, laptop computers, car computers, desktop computers, set-top boxes, smart TVs, wearable devices, etc.
[0088] The current query information may be the search information input by the user, such as Query (query word). Optionally, the current query information may be part of or all of the search information input by the user. For example, if the search information input by the user is "red wine recommendation", the current query information may be "red wine recommendation" or "red wine".
[0089] The candidate POI set may be the recall result of the search engine for the current query information. Based on the method for determining the matching degree provided in the embodiment of the present disclosure, the matching degree between the current query information and each candidate POI in the candidate POI set may be determined, and then the recall result may be sorted according to the matching degree between the current query information and each candidate POI in the candidate POI set to obtain the target POI recommended to the user.
[0090] In specific applications, the number of recall results is usually large and contains a large number of search results with low relevance. In order to improve search efficiency, the candidate POI set can optionally be a rough sorting result obtained after preliminary sorting of the recall results. Then, based on the method for determining the matching degree provided in the embodiment of the present disclosure, the matching degree between the current query information and each candidate POI in the candidate POI set is determined on the basis of the rough sorting result. According to the matching degree, the rough sorting result is further sorted to obtain the target POI recommended to the user.
[0091] The application scenarios of the embodiments of the present disclosure include but are not limited to natural language processing, spam filtering, web search, chatbots, etc. It is particularly suitable for determining the matching degree between the query term Query and the searched merchant POI / SPU (Standard Product Unit) in the O2O search scenario to improve the accuracy of the search results in the O2O search scenario.
[0092] It should be noted that, for the method embodiments, for the sake of simplicity, they are all described as a series of action combinations, but those skilled in the art should be aware that the embodiments of the present disclosure are not limited by the order of the actions described, because according to the embodiments of the present disclosure, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily required by the embodiments of the present disclosure.
[0093] Embodiment 3
[0094] Reference Figure 3 , which shows a structural diagram of a model training device for determining a matching degree in an embodiment of the present disclosure, as follows.
[0095] A data acquisition module 301 is used to acquire query information, POI search results related to the query information, and a comment set corresponding to each POI in the POI search results;
[0096] A target determination module 302 is used to determine a target comment corresponding to each POI in the comment set corresponding to each POI, wherein the target comment satisfies a preset correlation condition with the query information;
[0097] A vector representation module 303, configured to generate a first vector according to the target comment corresponding to each POI, wherein the first vector is used to represent the semantic relevance between the target comment and the query information;
[0098] The model training module 304 is used to train a target model for determining a matching degree by using the first vector, the second vector corresponding to the query information, the third vector corresponding to each POI in the POI search results, and the correlation annotation information between the query information and each POI as training data.
[0099] Optionally, the target determination module 302 includes:
[0100] A semantic matching submodule is used to semantically match each comment in the comment set corresponding to each POI with the query information one by one to obtain the semantic relevance of each comment with the query information;
[0101] A comment sorting submodule, used to sort the comment sets corresponding to each POI according to the semantic relevance, and obtain a sorting result for each comment set;
[0102] The target determination submodule is used to, for the sorting results of the comment set corresponding to each POI, take at least one comment whose sorting results meet preset requirements as the target comment corresponding to each POI.
[0103] Optionally, the vector representation module 303 includes:
[0104] A first calculation submodule is used to input the target comment corresponding to each POI and the query information into a deep reading comprehension model, and output a relevance vector representation of each target comment corresponding to each POI and the query information through the deep reading comprehension model;
[0105] The second calculation submodule is used to generate a first vector representing the relevance between all target comments corresponding to each POI and the query information according to the relevance vector representation between each target comment corresponding to each POI and the query information.
[0106] Optionally, the second calculation submodule is specifically used to perform attention calculation on the relevance vector representation of each target comment corresponding to each POI and the query information, so as to obtain a first vector representing the relevance of all target comments corresponding to each POI and the query information.
[0107] Optionally, the model training module 304 includes:
[0108] An initial calculation submodule, configured to calculate a matching degree between the query information and each POI in the POI search result based on initial model parameters, the first vector, the second vector, and the third vector;
[0109] The iterative optimization submodule is used to adjust the initial model parameters according to the error between the matching degree and the correlation annotation information, and iterate until the error meets the preset conditions to obtain the trained target model.
[0110] Optionally, the device further comprises:
[0111] A reinforcement learning module is used to perform reinforcement learning on the target model based on policy gradient to obtain an optimized target model, wherein the reward value of the reinforcement learning is the matching degree of the target model output, the action of the reinforcement learning is whether to select the current comment as the target comment, and the state of the reinforcement learning is the target comment selected historically.
[0112] The target model trained by the model training device for determining the degree of matching in the embodiment of the present disclosure can still retrieve POI search results related to the query information when the query information is relatively complex, even if the title or introduction of the POI does not contain content related to the query information, thereby improving the search success rate and accuracy to enhance the user experience.
[0113] Embodiment 4
[0114] Reference Figure 4 , which shows a structural diagram of a device for determining a matching degree in an embodiment of the present disclosure, as follows.
[0115] The information receiving module 401 is used to receive the current query information input by the user;
[0116] A candidate acquisition module 402 is used to acquire a candidate POI set related to the current query information;
[0117] The matching calculation module 403 is used to input each candidate POI in the candidate POI set and the current query information into a target model respectively, and output the matching degree between each candidate POI and the current query information through the target model. The target model is trained according to the above-mentioned model training method for determining the matching degree.
[0118] As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0119] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.
[0120] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.
[0121] The embodiment of the present disclosure also provides an electronic device, see Figure 5 , including: a processor 501, a memory 502, and a computer program 5021 stored in the memory and executable on the processor, wherein when the processor executes the program, the model training method for determining the degree of matching of the aforementioned embodiment is implemented.
[0122] An embodiment of the present disclosure also provides a readable storage medium. When the instructions in the storage medium are executed by a processor of an electronic device, the electronic device can execute the model training method for determining the degree of matching of the aforementioned embodiment.
[0123] As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0124] The algorithms and displays provided herein are not inherently related to any particular computer, virtual system or other device. Various general purpose systems may also be used together with the teachings based thereon. According to the above description, it is apparent that the structure required for constructing such systems is. In addition, the embodiments of the present disclosure are not directed to any particular programming language either. It should be understood that the contents of the embodiments of the present disclosure described herein may be realized using various programming languages, and the description of the specific languages above is intended to disclose the best mode of implementation of the embodiments of the present disclosure.
[0125] In the description provided herein, a large number of specific details are described. However, it is understood that the embodiments of the embodiments of the present disclosure can be practiced without these specific details. In some instances, well-known methods, structures and techniques are not shown in detail so as not to obscure the understanding of this description.
[0126] Similarly, it should be understood that in order to streamline the present disclosure and aid in understanding one or more of the various inventive aspects, in the above description of the exemplary embodiments of the present disclosure, the various features of the embodiments of the present disclosure are sometimes grouped together into a single embodiment, figure, or description thereof. However, the disclosed method should not be interpreted as reflecting the following intention: that the claimed embodiments of the present disclosure require more features than the features explicitly recited in each claim. More specifically, as reflected in the claims below, the inventive aspects lie in less than all the features of the single embodiment disclosed above. Therefore, the claims that follow the specific embodiment are hereby expressly incorporated into the specific embodiment, with each claim itself as a separate embodiment of the embodiments of the present disclosure.
[0127] Those skilled in the art will appreciate that the modules in the devices in the embodiments may be adaptively changed and arranged in one or more devices different from the embodiments. The modules or units or components in the embodiments may be combined into one module or unit or component, and in addition they may be divided into a plurality of submodules or subunits or subcomponents. Except that at least some of such features and / or processes or units are mutually exclusive, all features disclosed in this specification (including the accompanying claims, abstracts and drawings) and all processes or units of any method or device disclosed in this manner may be combined in any combination. Unless otherwise expressly stated, each feature disclosed in this specification (including the accompanying claims, abstracts and drawings) may be replaced by an alternative feature providing the same, equivalent or similar purpose.
[0128] The various component embodiments of the embodiments of the present disclosure may be implemented in hardware, or in software modules running on one or more processors, or in a combination thereof. It should be understood by those skilled in the art that a microprocessor or a digital signal processor (DSP) may be used in practice to implement some or all of the functions of some or all of the components in the sorting device according to the embodiments of the present disclosure. The embodiments of the present disclosure may also be implemented as a device or apparatus program for executing part or all of the methods described herein. Such a program implementing an embodiment of the present disclosure may be stored on a computer-readable medium, or may be in the form of one or more signals. Such a signal may be downloaded from an Internet website, or provided on a carrier signal, or provided in any other form.
[0129] It should be noted that the above embodiments illustrate rather than limit the embodiments of the present disclosure, and that those skilled in the art may design alternative embodiments without departing from the scope of the appended claims. In the claims, any reference symbol between brackets should not be constructed as a limitation on the claims. The word "comprising" does not exclude the presence of elements or steps not listed in the claims. The word "one" or "an" preceding an element does not exclude the presence of multiple such elements. The embodiments of the present disclosure may be implemented by means of hardware including several different elements and by means of appropriately programmed computers. In a unit claim that lists several devices, several of these devices may be embodied by the same hardware item. The use of the words first, second, and third, etc. does not indicate any order. These words may be interpreted as names.
[0130] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0131] The above description is only a preferred embodiment of the embodiments of the present disclosure and is not intended to limit the embodiments of the present disclosure. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the embodiments of the present disclosure should be included in the protection scope of the embodiments of the present disclosure.
[0132] The above is only a specific implementation of the embodiment of the present disclosure, but the protection scope of the embodiment of the present disclosure is not limited thereto. Any technician familiar with the technical field can easily think of changes or replacements within the technical scope disclosed by the embodiment of the present disclosure, which should be included in the protection scope of the embodiment of the present disclosure. Therefore, the protection scope of the embodiment of the present disclosure should be based on the protection scope of the claims.
Claims
1. A model training method for determining a matching degree, characterized in that: The method comprises: Obtaining query information, POI search results related to the query information, and a comment set corresponding to each POI in the POI search results; In the comment set corresponding to each POI, determining a target comment corresponding to each POI, wherein the target comment satisfies a preset correlation condition with the query information; generating a first vector according to the target comments corresponding to each POI, wherein the first vector is used to represent the relevance between all the target comments corresponding to each POI and the query information; Using the first vector, the second vector corresponding to the query information, the third vector corresponding to each POI in the POI search result, and the correlation annotation information between the query information and each POI as training data, training a target model for determining a matching degree; Determining the target comment corresponding to each POI in the comment set corresponding to each POI includes: For each set of comments corresponding to each POI, semantic matching is performed on each comment therein with the query information one by one to obtain the semantic relevance of each comment with the query information; Sorting the comment sets corresponding to each POI according to the semantic relevance to obtain a sorting result for each comment set; For the sorting result of the comment set corresponding to each POI, at least one comment whose sorting result meets the preset requirement is used as the target comment corresponding to each POI.
2. The method according to claim 1, characterized in that: The step of generating a first vector according to the target comments corresponding to each POI includes: Inputting the target comment corresponding to each POI and the query information into a deep reading comprehension model, and outputting a relevance vector representation of each target comment corresponding to each POI and the query information through the deep reading comprehension model; According to the relevance vector representation between each target comment corresponding to each POI and the query information, a first vector for representing the relevance between all target comments corresponding to each POI and the query information is generated.
3. The method according to claim 2, characterized in that: The step of generating a first vector representing the relevance between all target comments corresponding to each POI and the query information according to the relevance vector representation between each target comment corresponding to each POI and the query information comprises: Attention calculation is performed on a relevance vector representation of each target comment corresponding to each POI and the query information to obtain a first vector for representing the relevance of all target comments corresponding to each POI and the query information.
4. The method according to claim 1, characterized in that: The training of a target model for determining a matching degree using the first vector, the second vector corresponding to the query information, the third vector corresponding to each POI in the POI search result, and the correlation annotation information between the query information and each POI as training data includes: Based on the initial model parameters, and according to the first vector, the second vector, and the third vector, calculating the matching degree between the query information and each POI in the POI search result; According to the error between the matching degree and the correlation annotation information, the initial model parameters are adjusted, and the training is performed until the error meets the preset conditions to obtain a trained target model.
5. The method according to claim 4, characterized in that After obtaining the trained target model, the method further includes: Reinforcement learning is performed on the target model based on policy gradient to obtain an optimized target model, wherein the reward value of the reinforcement learning is the matching degree of the target model output, the action of the reinforcement learning is whether to select the current comment as the target comment, and the state of the reinforcement learning is the target comment selected historically.
6. A method for determining a matching degree, characterized in that: The method comprises: Receive current query information input by the user; Acquire a candidate POI set related to the current query information; Each candidate POI in the candidate POI set and the current query information are respectively input into a target model, and the target model outputs the matching degree between each candidate POI and the current query information. The target model is trained according to the model training method for determining matching degree according to any one of claims 1 to 5.
7. A model training device for determining a matching degree, characterized in that: The device comprises: A data acquisition module, used to acquire query information, POI search results related to the query information, and a comment set corresponding to each POI in the POI search results; A target determination module, used to determine, from the set of comments corresponding to each POI, a target comment corresponding to each POI, wherein the target comment satisfies a preset correlation condition with the query information; A vector representation module, used to generate a first vector according to the target comments corresponding to each POI, wherein the first vector is used to represent the relevance between all the target comments corresponding to each POI and the query information; A model training module, configured to train a target model for determining a matching degree by using the first vector, the second vector corresponding to the query information, the third vector corresponding to each POI in the POI search result, and the correlation annotation information between the query information and each POI as training data; The target determination module comprises: A semantic matching submodule, for performing semantic matching on each comment in the comment set corresponding to each POI with the query information one by one, and obtaining the semantic relevance of each comment with the query information; A comment sorting submodule, used to sort the comment set corresponding to each POI according to the semantic relevance, and obtain a sorting result of each comment set; The target determination submodule is used to, for the sorting results of the comment set corresponding to each POI, take at least one comment whose sorting results meet preset requirements as the target comment corresponding to each POI.
8. The device according to claim 7, characterized in that The vector representation module comprises: A first calculation submodule, configured to input the target comment corresponding to each POI and the query information into a deep reading comprehension model, and output a relevance vector representation of each target comment corresponding to each POI and the query information through the deep reading comprehension model; The second calculation submodule is used to generate a first vector representing the relevance between all target comments corresponding to each POI and the query information according to the relevance vector representation between each target comment corresponding to each POI and the query information.
9. The device according to claim 8, characterized in that The second calculation submodule is specifically used to perform attention calculation on the relevance vector representation of each target comment corresponding to each POI and the query information to obtain a first vector used to represent the relevance of all target comments corresponding to each POI and the query information.
10. The device according to claim 7, characterized in that The model training module includes: An initial calculation submodule, configured to calculate the matching degree between the query information and each POI in the POI search result based on the initial model parameters, the first vector, the second vector, and the third vector; The iterative optimization submodule is used to adjust the initial model parameters according to the error between the matching degree and the correlation annotation information, and iterate until the error meets the preset conditions to obtain the trained target model.
11. The device according to claim 10, characterized in that The device also includes: A reinforcement learning module is used to perform reinforcement learning on the target model based on policy gradient to obtain an optimized target model, wherein the reward value of the reinforcement learning is the matching degree of the target model output, the action of the reinforcement learning is whether to select the current comment as the target comment, and the state of the reinforcement learning is the target comment selected historically.
12. A device for determining a matching degree, characterized in that: The device comprises: An information receiving module, used for receiving current query information input by a user; A candidate acquisition module, used to acquire a set of candidate POIs related to the current query information; A matching calculation module is used to input each candidate POI in the candidate POI set and the current query information into a target model, and output the matching degree between each candidate POI and the current query information through the target model, wherein the target model is trained according to the model training method for determining the matching degree described in any one of claims 1 to 5.
13. An electronic device, characterized in that: include: A processor, a memory, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the model training method for determining a degree of matching as described in any one of claims 1 to 5 is implemented.
14. A readable storage medium, characterized in that: When the instructions in the storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute the model training method for determining a matching degree as described in any one of method claims 1-5.
Citation Information
Patent Citations
Retrieval method and equipment
CN103970784A
Comment information retrieval method and comment information retrieval apparatus
CN105468790A