Recommendation reason generating device and method, storage medium and electronic device
Through an encoder-decoder structure based on artificial intelligence, combining query information and user comments, personalized recommendation reasons are generated, which solves the problems of high cost, monotonous content and relying on the quality of original comments in the existing technology, and improves user experience and Relevance of recommended results.
Patent Information
- Application Number
- CN201910720403.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-08-06
- Publication Date
- 2024-11-26
- Estimated Expiration
- 2039-08-06
AI Technical Summary
The existing recommendation reason generation methods have problems such as high cost, monotonous content, quality dependence on the quality of the original comments and failure to consider the user's real-time intentions, resulting in uneven generation results and reducing user experience.
Using a sequence-to-sequence model based on artificial intelligence-based encoder-decoder structure, the user query information is encoded into a query vector through a query encoder, and the user comments are encoded into a comment vector with a selective encoder. The decoder Generate a recommendation reason that contains query information.
It improves the personalization of recommendation reasons, enhances the correlation with user query information, and improves the relevance of user experience and recommendation results.
Smart Images

Figure CN110532463B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of recommendation reason generation, and in particular to an artificial intelligence-based recommendation reason generation device and method, a computer-readable storage medium, and an electronic device. Background Art
[0002] The reason for recommendation is a natural language text displayed to users on the search results page or discovery page (such as scenario decision, must-eat list, etc.) to recommend highlights and assist users in making decisions. It is usually a short sentence. For example, if you enter "steak" in the search page of the "Dianping" APP, the search results page will show multiple merchants related to "steak". There is usually a short reason for recommendation in the introduction of each merchant, such as "The selected steak is very generous", "The selected sirloin Wagyu steak is fresh, delicious and tender". For another example, multiple must-eat restaurants are recommended on the "Must-eat List" of the "Dianping" APP. The introduction of each recommended restaurant has a recommendation reason called "Must-eat Reason", such as "The braised pork is great, the service attitude is very good, especially good", "The roast duck is well-deserved, not only the duck skin is crispy, but the duck meat is very glutinous".
[0003] Reasons for recommendations in natural language form can be seen as a highly condensed version of real user reviews. They can explain recall results to users, explore merchant characteristics, attract user clicks, and provide scenario-based guidance to users, thereby enhancing user experience and trust in the platform. Summary of the invention
[0004] The present disclosure provides an artificial intelligence-based recommendation reason generation device and method, which can generate personalized recommendation reasons for queries.
[0005] According to one aspect of the present disclosure, a device for generating a recommendation reason is provided, comprising: a query encoder for encoding a user's query information into a query vector; a selective encoder for encoding a user's comment into a selective hidden state of a comment vector based on the query vector; and a decoder, which forms an encoder-decoder structure with the selective encoder, and is used to decode the selective hidden state of the comment vector into a recommendation reason, wherein the selective encoder comprises a comment encoding unit and a selective computing network, the comment encoding unit is used to encode the user comment into an intermediate hidden state of a comment vector, and the selective computing network is used to operate the query vector with the intermediate hidden state of the comment vector to generate the selective hidden state of the comment vector.
[0006] According to another aspect of the present disclosure, a method for generating recommendation reasons is provided, including: encoding user query information into a query vector; encoding user comments into an intermediate latent state of a comment vector; operating the query vector and the intermediate latent state of the comment vector to generate a selective latent state of a comment vector; and decoding the selective latent state of the comment vector into a recommendation reason.
[0007] According to another aspect of the present disclosure, a computer-readable storage medium is provided, on which a computer program is stored, characterized in that the program implements the steps in the above method when executed by a processor.
[0008] According to another aspect of the present disclosure, an electronic device is provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps in the above method when executing the computer program.
[0009] According to the above aspects of the present disclosure, the user's query information is considered when encoding the user's comments, so that personalized recommendation reasons for the query can be generated, thereby improving the user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0010] These and / or other aspects, features and advantages of the present disclosure will become clearer and easier to understand through the following description of embodiments in conjunction with the accompanying drawings, in which:
[0011] Figure 1 A schematic block diagram showing a device for generating a recommendation reason according to an embodiment of the present disclosure;
[0012] Figure 2 A schematic diagram showing an operation example of the device for generating a recommendation reason according to an embodiment of the present disclosure;
[0013] Figure 3 A schematic flow chart showing a method for generating a recommendation reason according to an embodiment of the present disclosure;
[0014] Figure 4 A schematic diagram showing the structure of an electronic device for generating recommendation reasons according to an embodiment of the present disclosure. DETAILED DESCRIPTION
[0015] The present disclosure will be described in detail below with reference to exemplary embodiments of the present disclosure. However, the present disclosure is not limited to the embodiments described herein, and it can be implemented in many different forms. The described embodiments are only used to make the present disclosure thorough and complete, and to fully convey the concept of the present disclosure to those skilled in the art. The features of the various embodiments described can be combined or replaced with each other, unless explicitly excluded or should be excluded according to the context.
[0016] As mentioned in the background technology section, natural language recommendation reasons can enhance the user experience and trust in the platform. At present, the recommendation reason generation methods can be divided into the following four types: (1) Manual writing method: professional operators write recommendation reasons with high quality and rich content; (2) Template generation method: professional operators design different templates for different types of interest merchants (POIs), such as "[XX]% of locals recommend [dish name] in this store"; (3) Extraction method: extract a sentence from the high-quality user reviews of the POI or extract some words to form a sentence as the recommendation reason; (4) Generative method: generate a sentence recommendation reason based on the high-quality user reviews of the POI. The generated recommendation reason does not need to be strictly extracted from the original text, but is generated by encoding the original text through an encoder based on artificial intelligence technology and then through a decoder.
[0017] Each of the above-mentioned production methods has its own corresponding defects. (1) Manual writing method: There is a problem of high cost. For example, it is not realistic to conduct comprehensive manual writing for a platform like Meituan Dianping with millions of POIs. If personalized recommendation reasons are written for each POI, the cost will explode. (2) Template generation method: The content of recommendation reasons generated based on templates is monotonous and cannot be widely promoted to different scenarios. In addition, it is difficult for template-based generation methods to generate personalized recommendation reasons for queries. (3) Extraction method: The quality of recommendation reasons is heavily dependent on the quality of original comments. Moreover, if the user comments do not mention the query-related content, it is difficult to achieve personalized recommendation reasons for the query. (4) Generative method: This method is more flexible and can generate words that do not exist in user comments in the recommendation reasons; however, this generation method currently does not take into account the real-time intention of users, resulting in uneven generation results and generating recommendation reasons that are irrelevant to user queries, which reduces user experience. For example, when searching for “eat with kids” in a food app, the app will recommend several restaurants. However, the reasons for recommending these restaurants may not be related to “eat with kids”, but may just be general recommendations about the restaurant, such as “the braised pork tastes great”. The reason is that the generation method does not consider the information queried by the user when generating the recommendation reasons.
[0018] The present disclosure provides an artificial intelligence-based recommendation reason generation device and method, which can generate personalized recommendation reasons for queries. The recommendation reason generation method proposed in the present disclosure is an improvement on the generative method of the above-mentioned method (4), which can generate personalized recommendation reasons for recalled POIs according to different user query information, which is more intelligent and improves user experience. In the present disclosure, "query" includes any behavior of the user searching for POIs, and thus "query information" includes any information input by the user for searching POIs, including text or voice search information input by the user (such as "steak", "take the baby to eat"), and also includes user-selected topics (such as "ramen"), etc. In the present disclosure, merchants of interest (POI) include any type of merchants that can be searched, such as restaurants, swimming pools, cinemas, etc.
[0019] In recent years, with the large-scale application of artificial intelligence deep learning methods in the field of natural language processing, the sequence-to-sequence (Seq2Seq) model based on the encoder-decoder (Encoder-Decoder) structure has achieved good results in the field of text generation. Recommendation reason generation can be regarded as a generative text summary task, which is a type of text generation task. The recommendation reason generation device and method according to the embodiment of the present disclosure is based on the sequence-to-sequence model of the encoder-decoder structure of artificial intelligence.
[0020] Figure 1 FIG. 1 is a schematic block diagram of a device 100 for generating a recommendation reason according to an embodiment of the present disclosure. Figure 1 As shown, the recommendation reason generating device 100 includes a query encoder 101, a selective encoder 102 and a decoder 103. The query encoder 101 is used to encode the user's query information into a query vector. The selective encoder 102 is used to encode the user's comments into a selective hidden state of the comment vector based on the query vector. The decoder 103 and the selective encoder 102 form an encoder-decoder structure for decoding the selective hidden state of the comment vector into a recommendation reason. The selective encoder 102 includes a comment encoding unit 1021 and a selective calculation network 1022. The comment encoding unit 1021 is used to encode the user comments into an intermediate hidden state of the comment vector. The selective calculation network 1022 is used to operate the query vector with the intermediate hidden state of the comment vector to generate the selective hidden state of the comment vector, so that the recommendation reason contains content related to the query information. In some embodiments, the decoder 103 can also perform decoding based on the query vector generated by the query encoder 101.
[0021] According to the encoder-decoder structure of the recommendation reason generating device 100 of the embodiment of the present disclosure, the encoder encodes the source text into a vector, and the decoder decodes the vector generated by the encoder into a target text. In the embodiment of the present disclosure, it is necessary to generate the recommendation reason based on the user comments. Therefore, the user comments are the source text in the encoder-decoder structure, and the recommendation reason is the target text. In the embodiment of the present disclosure, a selective encoder 102 is used when encoding the user comments. When encoding the user comments into the comment vector, it is not only based on the input user comments themselves, but also based on the query vector generated by the query encoder 101. The query vector corresponds to the user's query information. The query vector can filter the information when the selective encoder 102 encodes the user comments, so that the encoded comment vector contains information related to the user query. Therefore, the recommendation reason decoded by the decoder 103 based on the comment vector can reflect the user's query information, that is, the generated recommendation reason is a query personalized recommendation reason. In some embodiments, the decoder 103 also considers the query vector when decoding, so that the decoded recommendation reason better reflects the user's query information. For example, the decoder 103 adopts an attention mechanism and uses the query vector as an input parameter of a context vector generation function when generating a context vector of the attention mechanism.
[0022] In an embodiment of the present disclosure, the query encoder 101 can use any existing or future developed encoder technology in the field of artificial intelligence to encode the user's query information into a query vector, such as using a unidirectional or bidirectional LSTM (long short-term memory) network, Word2Vec and other word vector tools. As mentioned above, the "query information" here means any information input by the user for searching for POIs. When the user uses non-text input such as voice, for example, the non-text information can be first identified as text information and then vector encoded.
[0023] The structure of the selective encoder 102-decoder 103 according to the embodiment of the present disclosure can be based on any existing or future developed neural network encoder-decoder model in the field of artificial intelligence, for example, such as a pointer generator network (Pointer-Generator), a recurrent neural network-long short-term memory (RNN-LSTM), ConS2S, a transformer (Transformer), etc. The selective encoder 102 may include a comment encoding unit 1021 and a selective computing network 1022 to encode user comments into a selective hidden state of a comment vector filtered by a query vector, so that the recommendation reason decoded by the decoder 103 contains content related to the query information. Specifically, the comment encoding unit 1021 can use any existing or future developed general encoder technology in the field of artificial intelligence, such as a unidirectional or bidirectional LSTM network, to encode user comments into an intermediate hidden state of a comment vector, which is independent of the query vector. The selective computing network 1022 operates the query vector with the intermediate hidden state of the comment vector, so that the generated comment vector selective hidden state carries the query vector information, and thus the recommendation reason contains content related to the query information. The selective computing network 1022 may be, for example, a multi-layer perceptron (MLP) network. In the present disclosure, "selective hidden state" means that the hidden state contains query vector information, and the query vector information has a selective filtering effect on the content of the user's comments.
[0024] The following uses a Pointer-Generator network as an example to specifically describe an exemplary embodiment of the present disclosure. Figure 2 FIG. 2 is a schematic diagram showing an operation example of the device 100 for generating a recommendation reason according to an embodiment of the present disclosure. Figure 2 As shown in , the query encoder 101 encodes the user's query information into a query vector q* by, for example, a bidirectional LSTM to be input to the selective encoder 102 and the decoder 103. It should be noted that, in some embodiments, the query vector q* is only used for the selective encoder 102 and not for the decoder 103.
[0025] The selective encoder 102 uses the query vector q* as a filtering parameter to filter the components x1, x2, x3, x4, x5, x6 (in Figure 2 In the example, 6 words are used as an example. The actual user comments may have more or less than 6 words) are encoded as comment vectors with selective hidden states h1', h2', h3', h4', h5', h6' (collectively referred to as h i ') to be output to the decoder 103 for decoding. In other words, the selective encoder 102 can generate a selective hidden state h based on the query vector q* i '. Specifically, Figure 2As shown, the comment encoding unit 1021 of the selective encoder 102 first generates the comment vector intermediate hidden states h1, h2, h3, h4, h5, h6 (collectively referred to as h i ), then, the selective computation network 1022 of the selective encoder 102 is based on the comment vector intermediate hidden state h i The comment vector selective hidden state h is generated with the query vector q* for output to the decoder 103 i '. For example, the comment encoding unit 1021 can encode the input user comments through a conventional bidirectional LSTM to generate intermediate hidden states h1, h2, h3, h4, h5, h6 corresponding to the constituent words x1, x2, x3, x4, x5, x6 of the user comment sequence. Then, the selective calculation network 1022 can operate the intermediate hidden states h1, h2, h3, h4, h5, h6 with the query vector q* to generate selective hidden states h1', h2', h3', h4', h5', h6' taking into account the query vector q*. In an embodiment of the present disclosure, the selective calculation network 1022 can adopt a multi-layer perceptron (MLP), such as Figure 2 shown.
[0026] As an example, the selective computation network 1022 may be based on the intermediate hidden state h i The weighted sum of the query vector q* generates the selectivity vector g i , and the intermediate hidden state h i With the selectivity vector g i Element-wise multiplication generates the selective hidden state h i ', for example, as shown below:
[0027] g i =σ(W h h i +W q q*+b) (1)
[0028] h i '=g i ⊙h i (2)
[0029] Among them, W h , W q h i and q* weights, b is the bias value, W h , W q Both σ and b are learnable parameters, σ represents the sigmoid activation function, and ⊙ represents element-wise multiplication.
[0030] In some embodiments, the selective calculation network 1022 also combines the entire sequence vector h* of the user comment with the intermediate hidden state h when generating the selective hidden state. i For example, the whole sequence vector h* of user comments is combined with the intermediate hidden state h i h* is a vector formed by encoding user comments using methods such as LSTM. For example, it can be Figure 2 As an example, when considering the whole sequence vector h* of user comments, the above formula (1) can be changed to:
[0031] g i =σ(W h h i +W q q*+W c h*+b) (3) or
[0032] g i =σ(W h [h i ;h*]+W q q*+b) (4)
[0033] In formula (3), h* and h i , q* weighted sum, W c is its learnable weight; Formula (4) transforms h* and h i Splicing.
[0034] The selective hidden states h1', h2', h3', h4', h5', h6' output by the selective computation network 1022 of the selective encoder 102 are used for decoding by the decoder 103. The decoder 103 can adopt any conventional decoder with or without an attention mechanism. Figure 2 In the example embodiment shown, the decoder 103 adopts an attention mechanism, and in the example shown, the decoder 103 generates context vectors C1, C2, C3, C4 (collectively referred to as C t , Figure 2 In the example of 4 context vectors, the query vector q* is used as the input parameter of the context vector generation function, which can use MLP. At this time, the context vector generation function generates MLP for the context vector, such as Figure 2 For example, in calculating C t The query vector q* and the comment vector selective hidden state h i 'Weighted addition, the corresponding weights are learnable parameters. In some embodiments, the input of the function generating the context vector of the attention mechanism may also include the entire sequence vector h* of the user's comments, for example, in calculating C tThe entire sequence vector h* can be combined with the query vector q* and the comment vector selective hidden state h i 'Weighted addition, or the entire sequence vector h* and the comment vector selective hidden state h t 'Splicing. According to the embodiment of the present disclosure, C t Except for the above special instructions, the calculation of C t Calculation method.
[0035] Decoder 103 obtains context vector C t After that, the target sequence hidden states S1, S2, S3, S4 and the constituent words y1, y2, y3, y4 of the output target sequence can be generated by conventional methods.
[0036] According to the decoder 103 of the embodiment of the present disclosure, by considering the query vector q* in the context vector of the attention mechanism, the information related to the user query in the decoded generated target text (i.e., the recommendation reason) can be better obtained to obtain the personalized recommendation reason for the query.
[0037] Combination of the above Figure 2 The operation example of the recommendation reason generating device according to the embodiment of the present disclosure is exemplarily described, but the embodiment of the present disclosure is not limited to the above example. For example, the comment encoding unit 1021 of the selective encoder 102 can be based on other encoder structures, such as a unidirectional LSTM or a word vector tool such as Word2Vec. The selective encoder 102 is not limited to outputting the selective hidden states of all the constituent words of the user comment to the decoder 103 for decoding, and can also only output a selective hidden state (such as the whole sequence information of the user comment) representing the user comment. Figure 2 h1' or h6') in is output as the selective hidden state of the comment vector to the decoder 103 for decoding.
[0038] According to the embodiment of the present disclosure, the recommendation reason generation device can be trained through user comments on POI, user queries, and recommendation reasons clicked by users. For example, after the recommendation reasons were launched in multiple scenarios on Dianping, a large number of user search and click logs have been accumulated. The inventor used the user's click log to extract a part of the quadruple (POI, high-quality user comments, query information, and recommendation reasons clicked by users) as training data to train the above-mentioned recommendation reason generation device. Specifically, the inventor selected about one million quadruple from these logs to train the model. Table 1 below is an example of a quadruple used for training.
[0039] Table 1
[0040]
[0041] The inventors tested the trained model, and Table 2 below is a test example.
[0042] Table 2
[0043]
[0044] Table 2 shows the recommendation reasons generated based on three different schemes. The first is a conventional Pointer-Generator model that does not consider the query information, and the generated recommendation reason is "the store is large and has billiards"; the second is a scheme that only considers the query information in the encoder (also based on the Pointer-Generator model), and the generated recommendation reason is "the store is large, has billiards, and the sound effect is not bad"; the third is a scheme that considers the query information in both the encoder and the decoder, and the generated recommendation reason is "it is very comfortable to lie down and watch a movie". From the results of these three schemes, it can be seen that the recommendation reason generated by the first scheme has a poor correlation with the user's query information "private cinema", and it cannot meet the requirements of query personalization; the recommendation reason generated by the second scheme contains "the sound effect is not bad", which is related to the query information "private cinema" and can meet the requirements of query personalization; and the recommendation reason generated by the third scheme "it is very comfortable to lie down and watch a movie" is highly correlated with the query information "private cinema", which better meets the requirements of query personalization.
[0045] In summary, the recommendation reason generating device according to the embodiment of the present disclosure can generate query-personalized recommendation reasons by considering the user's query information during the encoding process and optionally during the decoding process.
[0046] According to the embodiment of the present disclosure, the recommendation reason generating device can be any device or system that can be used to generate recommendation reasons, for example, it can be a server, workstation, personal computer, tablet circuit, smart phone, personal digital assistant and other devices, or it can be a cloud computing device, or a device in the above devices. It should be noted that although the operation of the recommendation reason generating device of the embodiment of the present disclosure involves the user's query information and user comments, this does not mean that the user directly inputs the query information or user comments on the recommendation reason generating device, but only means that the recommendation reason generating device will use the query information or user comments, which can be other devices receiving the user input and then transmitting it to the recommendation reason generating device, and the transmitted query information or user comments are not necessarily in the same form as the information originally input by the user, but only require that the recommendation reason generating device can obtain the content of the corresponding information.
[0047] Figure 3 FIG. 3 is a schematic flow chart of a method 300 for generating a recommendation reason according to an embodiment of the present disclosure. The method 300 for generating a recommendation reason includes steps S301 to S304. Figure 3As shown, in step S301, the user's query information is encoded into a query vector; in step S302, the user's comments are encoded into an intermediate latent state of the comment vector; in step S303, the query vector and the intermediate latent state of the comment vector are operated to generate a selective latent state of the comment vector; in step S304, the selective latent state of the comment vector is decoded into a recommendation reason.
[0048] In an exemplary embodiment of the present disclosure, the selective latent state of the comment vector is decoded into a recommendation reason using an attention mechanism, and when generating a context vector of the attention mechanism, the query vector is used as an input parameter of a multi-layer perceptron (MLP) for generating the context vector.
[0049] In an exemplary embodiment of the present disclosure, the calculation of the query vector and the comment vector intermediate hidden state to generate the comment vector selective hidden state includes: generating a selective vector based on a weighted sum of the comment vector intermediate hidden state and the query vector; and element-wise multiplication of the comment vector intermediate hidden state and the selective vector to generate the comment vector selective hidden state.
[0050] In an exemplary embodiment of the present disclosure, when generating the selective hidden state of the comment vector, the entire sequence vector of the user comment is also operated on the intermediate hidden state of the comment vector.
[0051] In an exemplary embodiment of the present disclosure, a weighted sum operation is performed on the query vector and the comment vector selective hidden state when generating the context vector of the attention mechanism.
[0052] The above description of the recommendation reason generating device is also applicable to the recommendation reason generating method. Similarly, the recommendation reason generating method according to the embodiment of the present disclosure can generate a personalized recommendation reason by considering the user's query information in the encoding process and optionally in the decoding process.
[0053] The method for generating recommendation reasons according to the embodiment of the present disclosure can be executed by any electronic device or system, including but not limited to servers, workstations, personal computers, tablet circuits, smart phones, personal digital assistants, cloud computing devices, etc.
[0054] As an example, an electronic device for executing the above method may include a memory, a processor, and a computer program stored in the memory and executable on the processor. When executed by the processor, the steps of the method according to any embodiment of the present disclosure are implemented. Figure 4A schematic diagram of the structure of an electronic device 400 according to an exemplary embodiment of the present disclosure is shown. The electronic device 400 includes a processor 401 and a memory 402. The processor 401 can perform corresponding processing according to a program stored or loaded in the memory 402, that is, the steps of the method according to any embodiment of the present disclosure can be performed. The processor 401 and the memory 402 can be connected to each other via a bus 403. According to an embodiment of the present disclosure, the electronic device 400 may also include an input / output (I / O) interface 404, and the interface 404 may also be connected to the bus 403.
[0055] In addition, an embodiment of the present disclosure further provides a computer-readable storage medium on which a computer program is stored, and when the program is executed by a processor, the steps in the method according to any embodiment of the present disclosure are implemented. The computer-readable storage medium according to an embodiment of the present disclosure can be a computer-readable storage medium or a combination of multiple computer-readable storage media.
[0056] It should be noted that the embodiments of the present disclosure can be implemented in hardware or dedicated circuits, software, firmware or any combination thereof. The processor in the embodiments of the present disclosure can be an integrated circuit chip or a discrete hardware component with signal processing capabilities, for example, it can be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a programmable logic device such as an off-the-shelf programmable gate array (FPGA), a discrete gate or transistor logic device, etc. The disclosed methods, steps and logic block diagrams in the embodiments of the present application can be implemented or executed. The computer-readable storage medium or memory in the embodiments of the present disclosure can be a volatile memory or a non-volatile memory, or include both volatile and non-volatile memories. The non-volatile memory can be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM) or a flash memory. The volatile memory may be a random access memory (RAM) such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous linked dynamic random access memory (SLDRAM), and direct memory bus random access memory (DR RAM).
[0057] Those skilled in the art should understand that the above-mentioned specific embodiments are merely examples and not limitations, and various modifications, combinations, partial combinations and replacements may be made to the embodiments of the present disclosure according to design requirements and other factors. As long as they are within the scope of the attached claims or their equivalents, they belong to the scope of rights to be protected by the present disclosure.
Claims
1. A device for generating a recommendation reason, comprising: A query encoder, used for encoding the user's query information into a query vector; A selective encoder, configured to encode the user comment into a comment vector selective hidden state based on the query vector; and a decoder, which forms an encoder-decoder structure with the selective encoder, and is used to decode the selective hidden state of the comment vector into a recommendation reason, wherein the decoder adopts an attention mechanism, and uses the query vector as an input parameter of a multi-layer perceptron (MLP) for generating a context vector of the attention mechanism, and the decoder performs a weighted sum operation on the query vector and the selective hidden state of the comment vector when generating the context vector of the attention mechanism, the selective encoder includes a comment encoding unit and a selective calculation network, the comment encoding unit is used to encode the user comment into an intermediate hidden state of a comment vector, and the selective calculation network is used to perform an operation on the query vector and the intermediate hidden state of the comment vector to generate the selective hidden state of the comment vector, the selective calculation network generates a selective vector based on the weighted sum of the intermediate hidden state of the comment vector and the query vector, and multiplies the intermediate hidden state of the comment vector and the selective vector element by element to generate the selective hidden state of the comment vector; when generating the selective hidden state of the comment vector, the selective calculation network also performs an operation on the entire sequence vector of the user comment and the intermediate hidden state of the comment vector.
2. The recommendation reason generating device according to claim 1, wherein the decoder adopts an attention mechanism, and when generating a context vector of the attention mechanism, the query vector is used as an input parameter of a multi-layer perceptron (MLP) for generating a context vector.
3. The recommendation reason generating device according to claim 1, wherein the selective calculation network generates a selective vector based on the weighted sum of the intermediate hidden state of the comment vector and the query vector, and multiplies the intermediate hidden state of the comment vector and the selective vector element by element to generate the selective hidden state of the comment vector.
4. The recommendation reason generating device according to claim 1, wherein the selective calculation network also operates the entire sequence vector of the user comments and the intermediate hidden state of the comment vector when generating the selective hidden state of the comment vector.
5. The recommendation reason generating device according to claim 2, wherein the decoder performs a weighted sum operation on the query vector and the selective hidden state of the comment vector when generating the context vector of the attention mechanism. 6 . The device for generating a recommendation reason according to claim 1 , wherein the device for generating a recommendation reason is trained by user comments, user queries and recommendation reasons clicked by users on merchants of interest.
7. A method for generating a recommendation reason based on an encoder-decoder structure, comprising: Encode the user's query information into a query vector; Encode user comments into the intermediate hidden state of the comment vector; Operate the query vector and the comment vector intermediate hidden state to generate a comment vector selective hidden state; and decoding the selective latent state of the comment vector into a recommendation reason; The decoder adopts an attention mechanism, and uses the query vector as an input parameter of a multilayer perceptron for generating a context vector when generating a context vector of the attention mechanism. The decoder performs a weighted sum operation on the query vector and the selective hidden state of the comment vector when generating the context vector of the attention mechanism. The selective encoder includes a comment encoding unit and a selective calculation network; the selective calculation network generates a selective vector based on the weighted sum of the intermediate hidden state of the comment vector and the query vector, and multiplies the intermediate hidden state of the comment vector and the selective vector element-wise to generate the selective hidden state of the comment vector; the selective calculation network also performs an operation on the entire sequence vector of the user's comments and the intermediate hidden state of the comment vector when generating the selective hidden state of the comment vector.
8. The method for generating recommendation reasons according to claim 7, wherein the selective latent state of the comment vector is decoded into a recommendation reason using an attention mechanism, and when generating a context vector of the attention mechanism, the query vector is used as an input parameter of a multi-layer perceptron (MLP) for generating the context vector.
9. The method for generating a recommendation reason according to claim 7, wherein the step of operating the query vector and the intermediate hidden state of the comment vector to generate the selective hidden state of the comment vector comprises: generating a selectivity vector based on a weighted sum of an intermediate hidden state of the comment vector and the query vector; And multiplying the comment vector intermediate hidden state and the selectivity vector element by element to generate the comment vector selective hidden state.
10. The method for generating recommendation reasons according to claim 7, wherein when generating the selective hidden state of the comment vector, the entire sequence vector of the user comments is also operated with the intermediate hidden state of the comment vector.
11. The method for generating recommendation reasons according to claim 8, wherein when generating the context vector of the attention mechanism, the query vector and the selective hidden state of the comment vector are weighted and calculated.
12. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the steps in the method according to any one of claims 7 to 11 are implemented.
13. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When executed, the processor implements the steps of the method according to any one of claims 7 to 11.
