Text generating apparatus, text generating method, and program

A deep learning model with a Transformer-based text generation system addresses the challenge of generating personalized reviews by using user and item identifiers, enabling tailored and efficient review creation.

JP2024127493AActive Publication Date: 2024-09-20NTT COMWARE CORP

Patent Information

Application Number
JP2023036681
Authority / Receiving Office
JP · JP
Patent Type
Applications
Current Assignee / Owner
Filing Date
2023-03-09
Publication Date
2024-09-20
Estimated Expiration
2043-03-09

AI Technical Summary

Technical Problem

Conventional text generation models struggle to create subjective reviews tailored to individual users and items, resulting in uniform and less personalized outputs.

Method used

A deep learning model utilizing an item identifier, user identifier, and user reviews and evaluations as learning data, incorporating a Transformer-based text generation model with an aspect and preference layer to generate personalized reviews by reflecting item and user characteristics.

Benefits of technology

Enables the automatic generation of subjective reviews that cater to specific users and items, enhancing personalization and reducing the need for extensive training data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 2024127493000001
    Figure 2024127493000001
Patent Text Reader

Abstract

To generate a subjective review automatically.SOLUTION: A text generating system 1 includes a generating unit 20 which, with using an item ID, a user ID, a review for an item by a user, and evaluation for the item by the user as learning data, generates a review for the item of the item ID by the user of the user ID upon inputting the item ID and the user ID, and inputs a deep learning model which learnt the data so as to generate evaluation for the same item by the same user, the item ID and the user ID to output the review and evaluation for the item by the user. The deep learning model has a decoder for decoding, to a text, outputs of a transformer layer, an aspect layer reflecting characteristics of the item on the output of the transformer layer, and a preference layer reflecting characteristics of the user on an output of the aspect layer, and an output of the preference layer, and an evaluation prediction unit for predicting evaluation for the item by the user based on the output of the preference layer.SELECTED DRAWING: Figure 2
Need to check novelty before this filing date? Find Prior Art

Description

[Technical field]

[0001] The present disclosure relates to a text generation device, a text generation method, and a program. [Background technology]

[0002] On e-commerce sites where users cannot actually see the products, they often refer to product reviews when deciding which products to purchase. Providing a large number of product reviews can help increase sales.

[0003] There is a known technology for generating text using a machine learning model. Conventional text generation models learn statistical patterns of words that compose text from a text collection, and when some words are given to the text generation model, it predicts the word that follows the given words based on the statistical patterns. [Prior art documents] [Patent documents]

[0004] [Patent Document 1] Patent No. 7133689 Summary of the Invention [Problem to be solved by the invention]

[0005] However, conventional methods tend to generate similar text, making it difficult to generate subjective reviews for each user and item.

[0006] The present disclosure has been made in consideration of the above, and has an object to automatically generate subjective reviews. [Means for solving the problem]

[0007] A text generation device of one embodiment of the present disclosure includes a deep learning model that is trained to use an item identifier, a user identifier, a user's review of the item, and the user's rating for the item as learning data, and to generate a review for the item corresponding to the input identifier by a user corresponding to the input identifier when an item identifier and a user identifier are input, as well as to generate an rating for the item by the user; and a generation unit that inputs the item identifier and the user identifier into the deep learning model and outputs the user's review and rating for the item, wherein the deep learning model includes a text generation model using a Transformer, an aspect layer that reflects features of the item in the output of the text generation model, a preference layer that reflects features of the user in the output of the aspect layer, a decoder that decodes the output of the preference layer into text, and a rating prediction unit that predicts the user's rating for the item from the output of the preference layer.

[0008] In one aspect of the text generation method of the present disclosure, a computer uses an item identifier, a user identifier, a user's review of the item, and the user's rating of the item as learning data, and when an item identifier and a user identifier are input, generates a review for the item corresponding to the input identifier by a user corresponding to the input identifier, and retains a deep learning model trained to generate a rating for the item by the user, inputting the item identifier and the user identifier into the deep learning model, and outputting the user's review and rating for the item, the deep learning model including a text generation model using a Transformer, an aspect layer that reflects features of the item in the output of the text generation model, a preference layer that reflects features of the user in the output of the aspect layer, a decoder that decodes the output of the preference layer into text, and a rating prediction unit that predicts the user's rating for the item from the output of the preference layer. Effect of the Invention

[0009] According to the present disclosure, subjective reviews can be automatically generated. [Brief description of the drawings]

[0010] [Figure 1] FIG. 1 is a diagram showing an example of the configuration of a text generation system according to the present embodiment. [Diagram 2] FIG. 2 is a diagram illustrating an example of a deep learning model proposed in this embodiment. [Diagram 3] FIG. 3 is a diagram for explaining the processing performed in the aspect layer and the preference layer. [Figure 4] FIG. 4 is a flowchart showing an example of the flow of the learning process. [Diagram 5] FIG. 5 is a flowchart showing an example of the flow of a text generation process. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

[0011] [System Configuration] Hereinafter, an embodiment of the present invention will be described with reference to the drawings.

[0012] 1 is a diagram showing an example of the configuration of a text generation system according to this embodiment. The text generation system 1 shown in the figure includes a learning unit 10, a generation unit 20, a data storage unit 30, and a calculation result storage unit 40. Each unit included in the text generation system 1 may be configured by a computer including an arithmetic processing unit, a storage device, etc., and the processing of each unit may be executed by a program. This program is stored in a storage device included in the text generation system 1, and can be recorded on a recording medium such as a magnetic disk, an optical disk, or a semiconductor memory, or can be provided via a network.

[0013] The text generation system 1 incorporates objective elements (aspects) and subjective elements (preferences) into a text generation model, and reflects the objective elements and subjective elements in the generation of text. For example, the objective element is an item (product), and the subjective element is a user. When a user identifier (hereinafter referred to as a user) and an item identifier (hereinafter referred to as an item) are input into the text generation system 1, a review that the user is likely to write about the item is output. This makes it possible to automatically generate subjective reviews that are appropriate for the user and item, rather than a uniform review.

[0014] The learning unit 10 inputs users, items, user reviews (text) of the items, and user evaluations of the items as learning data, learns the correspondence between the text generation conditions (users and items) and the objective / subjective elements of the text, and constructs a deep learning model that automatically generates reviews that match the text generation conditions.

[0015] The generation unit 20 inputs the user and the item received from the service provider 5 into the deep learning model as text generation conditions, generates a review of the user's item, and predicts the user's evaluation of the item. The service provider 5 is, for example, an operator of an EC site.

[0016] The data storage unit 30 holds learning data such as users, items, reviews, ratings, etc. The learning data is reviews and ratings actually written by users for items, and is collected by the service provider 5.

[0017] The calculation result storage unit 40 holds calculation results such as parameters of the deep learning model obtained by learning, and variance vectors (distributed embedded representations) of users and items.

[0018] [Proposed model] The text generation model (deep learning model) proposed in this embodiment will be described with reference to Fig. 2. The text generation model shown in the figure includes a Transformer Layer, an Aspect Layer, a Preference Layer, a Word and ID Decoder, and a Rating Predictor. When a user ID token, an item ID token, and a seed word token are input to the text generation model, the model outputs the word following the seed word.

[0019] The transformer layer is a network with an attention mechanism. Attention is a score that represents the relevance between tokens. Each token has a matrix of Q (query), K (key), and V (value). Attention is a weighted sum of V, where the weights are calculated using Q and K, as shown in the following formula:

[0020]

number

[0021] Here, W l Q ,W l K ,W l V are the learnable weights, X is the number of tokens in the input word, and d h and d k is the number of shared dimensions of the query and the key.

[0022] The matrix M corresponding to the mask in Equation 1 is a mask M with a different reference range. d and M i Equivalent to M d is a self-attention mask that allows a user ID or item ID to refer to all words in the aspect layer and preference layer, and a word to refer only to a user ID or item ID and words that have appeared so far. M iis a self-attention mask that allows a word token to only refer to tokens of words that have appeared before in the transformer layer.

[0023] H is the input to each layer and is expressed by the following equation.

[0024]

number

[0025] H 0 is the input to the transformer layer, and is the distributed embedding representation e for words 1 through x. 1 ,...e x Specifically, e 1 ,...e x Each of H is a combination of a distributed embedding of the word tokens, a distributed embedding of the positions, and a distributed embedding of the data format. l is the output of the l-th transformer layer and the input to the next layer.

[0026] The aspect layer and the preference layer are expressed as follows: * We introduce an intermediate variable z that classifies items into Z types, and depending on the intermediate variable z, the output of the transformer layer reflects objective elements based on item IDs and subjective expressions based on user IDs.

[0027]

number

[0028] Here, h * (=h i ,h u ) is a distributed embedding representation of item IDs and user IDs. *+l,x is the x-th output from the aspect layer or preference layer. The function F is the function that applies h to the output of the transformer layer depending on the intermediate variable z. *When z=0, the output of the transformer layer is used as is. When z>0, one of the above transformation formulas is arbitrarily selected to obtain h l,x Figure 3 shows an overview of the processing performed in the aspect layer and preference layer using the above formula. The aspect layer converts the output of the transformer layer, h l,x and a distributed embedding representation of item IDs h i Enter h a+l,x The preference layer outputs the output of the aspect layer, h a+l,x and the distributed embedding representation of user ID h u Enter h p+l,x Output.

[0029] The decoder calculates the output of the preference layer, H p+l and weight W V Calculate the probability of the next word occurring using and generate text d (^ above d).

[0030]

number

[0031] where Te is the temperature parameter.

[0032] The rating prediction part predicts the rating r of item i by user u using the following formula: u,i Calculate (^ over r).

[0033]

number

[0034] where φ is the tanh function. W l , b l is the projection matrix and bias of the l-th neural layer that predicts the rating. W r , b r are the projection matrix and bias of the output layer. A multi-layer perceptron (MLP) can be used to predict the rating.

[0035] [Operation] Next, the learning process will be described with reference to the flowchart in FIG.

[0036] In step S11, the learning unit 10 acquires reviews and ratings of items by users stored in the data storage unit 30, and divides the reviews into words. The learning unit 10 uses items, users, and the reviews and ratings of the items by the users as learning data.

[0037] In step S12, the learning unit 10 updates the parameters of the model so as to minimize the objective function J shown in the following equation. For the learning, the ALM that learns so that the embedding representation of the item and the embedding representation of the corresponding text become closer, the PLM that learns so that the embedding representation of the user and the embedding representation of the corresponding text become closer, and the task that learns so that the predicted value of the rating and the user's rating for the item become closer are introduced.

[0038]

number

[0039] Here, the double-lined “1” is an indicator function that is 1 when user u has rated item i and 0 when user u has not rated item i. r and λ d is a hyperparameter that balances the importance of the rating prediction component and the text generation component. rp is the set of parameters for the component that predicts the rating. rp is a regularization parameter to prevent overfitting. “||·||” denotes the Frobenius norm of the matrix. R is the user-item rating matrix. r u,i is the actual rating given by user u to item i. u,i (Hat above r) is the predicted value of the evaluation. L APLMare the tasks of the aspect layer and the preference layer, respectively, and are expressed as follows:

[0040]

number

[0041] Here, e a is a distributed embedding representation of the target item or user to be referenced, and e p is the distributed embedding representation of the corresponding text, and e n is the distributed embedding representation of another text in the same batch (training data). L APLM This allows the system to learn to match items or users with their corresponding texts.

[0042] The learning unit 10 simultaneously learns rating prediction and text generation, and is therefore able to generate reviews in accordance with the predicted ratings.

[0043] The text generation process will now be described with reference to the flowchart of FIG.

[0044] In step S21, the generation unit 20 inputs a user ID and an item ID, which are text generation conditions, into the model.

[0045] In step S22, the generator 20 inputs a seed word into the model. For example, the generator 20 inputs the seed word “ <s>" is input into the model.

[0046] In step S23, the word following the seed word is output from the model.

[0047] In step S24, the generation unit 20 judges whether the generation of the text is completed. For example, the model indicates the end of the text. <e>When " is output, or when the output text reaches the maximum number of characters, the generation unit 20 determines that the generation of the text is completed.

[0048] If the text generation is not completed, the process returns to step S22, and the generator 20 inputs the word output from the model following the seed word into the model.

[0049] When the text generation is completed, in step S25, the generation unit 20 outputs the text by concatenating the words output by the model.

[0050] In step S26, the generation unit 20 outputs the predicted rating of the user for the item output by the model.

[0051] Through the above process, reviews and ratings can be obtained based on the user and item.

[0052] As described above, the text generation system 1 of the present embodiment includes a deep learning model that has been trained to generate a review of an item of an item ID by a user of the user ID when an item ID and a user ID are input, and to generate an evaluation of the item by the user, using the item ID, user ID, review of the item by the user, and evaluation of the item by the user as learning data, and a generation unit 20 that inputs the item ID and user ID into the deep learning model and outputs the review and evaluation of the item by the user. The deep learning model includes a transformer layer, an aspect layer that reflects the characteristics of the item in the output of the transformer layer, a preference layer that reflects the characteristics of the user in the output of the aspect layer, a decoder that decodes the output of the preference layer into text, and an evaluation prediction unit that predicts the evaluation of the item by the user from the output of the preference layer. This makes it possible to automatically generate a subjective review according to the item and user input as text generation conditions. In addition, by using a trained transformer, it is possible to reduce the learning data for text generation. [Explanation of symbols]

[0053] 1. Text Generation Systems 10. Learning Department 20 Generation part 30 Data Storage Section 40 Calculation result storage section 5 Service Providers< / e> < / s>

Claims

1. A deep learning model that is trained to use an item identifier, a user identifier, a review by the user for the item, and a user's evaluation of the item as learning data, and to generate a review by the user for the item corresponding to the input identifier when an item identifier and a user identifier are input, and to generate an evaluation of the item by the user; A generator that inputs an item identifier and a user identifier into the deep learning model and outputs a review and a rating of the item by the user; The deep learning model includes a text generation model using Transformer, an aspect layer that reflects features of the item in an output of the text generation model, a preference layer that reflects features of the user in an output of the aspect layer, a decoder that decodes the output of the preference layer into text, and a rating prediction unit that predicts a rating of the item by the user from the output of the preference layer. Text generator.

2. 2. A text generator according to claim 1, comprising: The aspect layer and preference layer introduce intermediate variables that classify the items and users into a plurality of types, and reflect the items and users in the input from the previous layer according to the intermediate variables. Text generator.

3. 2. A text generator according to claim 1, comprising: A learning unit that learns the deep learning model so as to minimize an error in a prediction evaluation output by the deep learning model and to approximate an embedding representation of an item identifier to an embedding representation of a corresponding text, and an embedding representation of a user identifier to an embedding representation of a corresponding text. Text generator.

4. The computer A deep learning model is retained that has been trained to use an item identifier, a user identifier, a review by the user for the item, and a user's rating for the item as learning data, to generate a review by the user corresponding to the input identifier for the item corresponding to the input identifier when the item identifier and the user identifier are input, and to generate a rating for the item by the user, inputting an item identifier and a user identifier into the deep learning model, and outputting a review and rating of the item by the user; The deep learning model includes a text generation model using Transformer, an aspect layer that reflects features of the item in an output of the text generation model, a preference layer that reflects features of the user in an output of the aspect layer, a decoder that decodes the output of the preference layer into text, and a rating prediction unit that predicts a rating of the item by the user from the output of the preference layer. Text generation methods.

5. 5. A method for generating text according to claim 4, comprising the steps of: The aspect layer and preference layer introduce intermediate variables that classify the items and users into a plurality of types, and reflect the items and users in the input from the previous layer according to the intermediate variables. Text generation methods.

6. 5. A method for generating text according to claim 4, comprising the steps of: The computer The deep learning model is trained so as to minimize an error in a prediction evaluation output by the deep learning model, and so as to approximate an embedding representation of an item identifier to an embedding representation of a corresponding text, and an embedding representation of a user identifier to an embedding representation of a corresponding text. Text generation methods.

7. A program for causing a computer to operate as each unit of the text generator according to any one of claims 1 to 3.

Citation Information

Patent Citations

  • Comment information generation method and device, electronic equipment and storage medium

    CN112667780A

  • Horizontal tube falling film device

    CN113926210A

  • Parameter estimation method, evaluation value estimation method, apparatus, and program

    JP2016207171A

  • Method and system for combining user, item, and review representation for recommender system

    JP2019049980A

  • Text generation device, text generation method, and program

    JP2023017250A

Cited By

  • Review generation device, review generation method, and recording medium

    WO2026163409A1