Commodity comment generation method and device, equipment and storage medium
By obtaining initial comment information and using prompt words to generate templates and multi-head attention models, users can help generate product reviews, and solve the problem of uneven quality of existing comments, which simplifies comment generation and quality improvement.
Patent Information
- Application Number
- CN202510101188.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-22
- Publication Date
- 2025-05-06
- Estimated Expiration
- 2045-01-22
AI Technical Summary
The quality of product reviews written by existing shopping website users is uneven, resulting in a large number of invalid reviews, affecting the subsequent marketing of products. The existing review analysis system is mostly post-even analysis, making it difficult to simplify the comment generation steps.
By obtaining initial comment information, using preset prompt word generation templates to generate prompt words based on product and user information, and generating large models based on multi-head attention model and comments to assist users in generating product reviews.
简化了商品评论步骤,降低了评论编写难度,提升了评论质量,抹平用户文化和年龄差异,生成更符合用户真实感受的评论。
Smart Images

Figure CN119940313A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of artificial intelligence technology, and in particular to a product review generation method, device, equipment and storage medium. Background Art
[0002] The shopping evaluation data of users of existing shopping websites are generally written by users themselves, and the quality of the reviews varies. Most users find it troublesome to fill in more reviews, so they fill them in casually, resulting in more invalid reviews. A large number of product reviews cannot reflect the true feelings of users, which has a relatively large impact on the subsequent marketing of products. Most of the current user product review analysis systems judge and analyze the evaluation data after the user comments, which is a post-analysis. Basically, they classify and judge the product review data, and put high-quality reviews in the front row for user reference, so as to achieve the purpose of influencing users' shopping desire. Existing review quality analysis technologies are mostly based on existing review data, and then use intelligent analysis technology to judge the effect of the reviews.
[0003] In summary, how to simplify the steps of product reviews and thus improve the quality of existing product reviews is a technical problem that needs to be solved urgently. Summary of the invention
[0004] In view of this, the purpose of the present invention is to provide a method, device, equipment and storage medium for generating product reviews, which can simplify the steps of generating product reviews, thereby improving the quality of existing product reviews. The specific scheme is as follows:
[0005] In a first aspect, the present application provides a method for generating product reviews, comprising:
[0006] Acquire initial review information corresponding to the target product, and generate a prompt word corresponding to the target product according to the initial review information, product information of the target product, and user information of the target user using a preset prompt word generation template;
[0007] Determine the target feature corresponding to the initial review information based on a preset multi-head attention model, and generate a large model according to the prompt word, the target feature and the preset review to generate a review to be confirmed corresponding to the target product;
[0008] The evaluation information generated by the target user based on the comment to be confirmed is obtained, and the target comment corresponding to the target product is determined based on the evaluation information.
[0009] Optionally, the using a preset prompt word generation template to generate a prompt word corresponding to the target product according to the initial review information, the product information of the target product and the user information of the target user includes:
[0010] Generate the initial review information corresponding to the target product based on a preset review template or a review writing instruction of a target user;
[0011] Respectively determining a first target text corresponding to the initial review information and a second target text corresponding to the user information of the target user, and determining a preset marketing attribute corresponding to the target product;
[0012] The preset prompt word generation template is used to generate the prompt word corresponding to the target product according to the first target text, the second target text, the product information of the target product, and the preset marketing attribute.
[0013] Optionally, before determining the target feature corresponding to the initial comment information based on the preset multi-head attention model, the method further includes:
[0014] Determine a first target word vector corresponding to the first target text, the second target text, and the product information based on a preset word embedding technology;
[0015] The features of the first target word vector are extracted according to a preset converter encoder model to obtain first initial features corresponding to the initial comment information, the user information, and the product information.
[0016] Optionally, before determining the target feature corresponding to the initial comment information based on the preset multi-head attention model, the method further includes:
[0017] Determine a target video and a target picture that may be included in the initial comment information, and extract a target key frame in the target video based on a preset frame difference extraction method;
[0018] Extracting first image features corresponding to the target key frame and the target image based on a preset convolutional neural network model, and fusing the first image features according to a preset model construction method to obtain corresponding second image features;
[0019] A preset principal component analysis method is used to perform corresponding dimensionality reduction processing on the second image feature, and a third image feature corresponding to the second image feature after dimensionality reduction is determined according to a preset visual model.
[0020] Optionally, before determining the target feature corresponding to the initial comment information based on the preset multi-head attention model, the method further includes:
[0021] Determine a third target text in the target video according to a preset speech recognition method, and determine a text feature corresponding to the third target text according to a preset text convolutional neural network model;
[0022] Determine a second initial feature corresponding to the initial comment information based on a preset cross-attention mechanism, the text feature, and the third image feature;
[0023] Accordingly, determining the target features corresponding to the initial comment information based on the preset multi-head attention model includes:
[0024] Determining corresponding features to be fused based on the preset multi-head attention model, the preset normalized exponential function, the first initial features, and the second initial features;
[0025] The feature to be fused and the first initial feature are fused according to the preset model building method to obtain the target feature corresponding to the initial comment information.
[0026] Optionally, generating a macro model according to the prompt word, the target feature and preset comments to generate the to-be-confirmed comments corresponding to the target product includes:
[0027] Based on the preset word embedding technology, a second target word vector corresponding to the prompt word is determined, and the second target word vector and the target feature are input into the preset comment generation model to generate the comment to be confirmed corresponding to the target product.
[0028] Optionally, determining a target review corresponding to the target product based on the evaluation information includes:
[0029] Directly determining the review to be confirmed as the target review corresponding to the target product based on the evaluation information;
[0030] Or, based on the evaluation information, adjust the random number factor in the preset comment generation model, and jump to the step of generating the large model according to the prompt word, the target feature and the preset comment, and generating the pending comment corresponding to the target product, so as to obtain the target comment corresponding to the target product.
[0031] In a second aspect, the present application provides a product review generating device, comprising:
[0032] A prompt word generation module, used to obtain initial review information corresponding to a target product, and generate a prompt word corresponding to the target product according to the initial review information, product information of the target product and user information of the target user using a preset prompt word generation template;
[0033] A module for generating comments to be confirmed is used to determine the target feature corresponding to the initial comment information based on a preset multi-head attention model, and generate a large model according to the prompt word, the target feature and the preset comments to generate the comments to be confirmed corresponding to the target product;
[0034] The target review determination module is used to obtain the evaluation information generated by the target user based on the review to be confirmed, and determine the target review corresponding to the target product based on the evaluation information.
[0035] In a third aspect, the present application provides an electronic device, including:
[0036] Memory, used to store computer programs;
[0037] A processor is used to execute the computer program to implement the aforementioned product review generating method.
[0038] In a fourth aspect, the present application provides a computer-readable storage medium for storing a computer program; wherein, when the computer program is executed by a processor, the aforementioned product review generating method is implemented.
[0039] In this application, the initial review information corresponding to the target product is first obtained, and the preset prompt word generation template is used to generate the prompt word corresponding to the target product according to the initial review information, the product information of the target product and the user information of the target user; then, the target feature corresponding to the initial review information is determined based on the preset multi-head attention model, and a large model is generated based on the prompt word, the target feature and the preset comment to generate a comment to be confirmed corresponding to the target product; finally, the evaluation information generated by the target user based on the comment to be confirmed is obtained, and the target comment corresponding to the target product is determined based on the evaluation information. As can be seen from the above, this application can analyze and judge the initial review information in real time, generate corresponding prompt words in combination with product information and user information, and use the preset comment generation large model to assist in writing the user's product review based on the prompt word and initial review information, thereby simplifying the steps of product review, reducing the workload and difficulty of writing product review, leveling the cultural level and age differences between users, helping users to effectively complete product reviews, and improving the quality of product reviews. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.
[0041] Figure 1 A schematic diagram of a system framework applicable to a product review generation solution provided in this application;
[0042] Figure 2 A flowchart of a method for generating product reviews provided in this application;
[0043] Figure 3 A schematic diagram of a specific personalized review template provided for this application;
[0044] Figure 4 A specific multimodal hybrid feature extraction flow chart provided for this application;
[0045] Figure 5 A specific automatic comment completion schematic diagram provided for this application;
[0046] Figure 6 A flowchart of a specific product review generation method provided for this application;
[0047] Figure 7 A specific shopping review large language model training flow chart provided for this application;
[0048] Figure 8 A flowchart of a specific product review generation method provided for this application;
[0049] Fig. 9 A schematic diagram of the structure of a product review generating device provided in this application;
[0050] Fig.10 A structural diagram of an electronic device provided for this application. DETAILED DESCRIPTION
[0051] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0052] The shopping evaluation data of users of existing shopping websites are generally written by the users themselves, and the quality of the reviews varies. Most users find it troublesome to fill in more reviews, so they fill them in casually, resulting in more invalid reviews. A large number of product reviews cannot reflect the true feelings of users, which has a relatively large impact on the subsequent marketing of the products. Most of the current user product review analysis systems conduct judgment and analysis on the evaluation data after the user's comments, which belongs to post-analysis. Basically, they classify and distinguish the product review data, and put high-quality reviews in the front row for user reference, so as to achieve the purpose of influencing the user's shopping desire. The existing review quality analysis technology is mostly based on the existing review data, and then the effect of the review is judged through intelligent analysis technology. To this end, the present application provides a product review generation solution that can simplify the steps of product reviews, thereby improving the quality of existing product reviews.
[0053] In the product review generation solution of the present invention, the system framework used can be specifically referred to in Figure 1 As shown. A shopping review large language model is constructed by generating vertical domains of shopping mall shopping reviews with marketing attributes, which is mainly used for the automatic generation of product reviews of mall users on the C-end. And when designing the large model, factors such as marketing type, marketing level, and user emotions are taken into account to affect the final generated product reviews. In addition, the present invention selects the LLaVa model (LLaVa, Large Language and Vision Assistant) as the basic multimodal large language model, improves the input of the model on the basis of the LLaVa model, and performs end-to-end fine-tuning training on the model, so that the LLaVa model has the ability to review products on the basis of general knowledge.
[0054] In the system framework of the present invention, the "multimodal hybrid feature extraction encoding" module is mainly responsible for feature extraction of multi-modal data. The parameters of the feature extraction encoder are frozen. When training the large language model of shopping reviews, only the Projection layer (i.e., the mapping learning weight layer) is trained, which is mainly used for aligning multimodal features with the word vectors of the pre-trained large language model of shopping reviews.
[0055] The product evaluation collection template and product reviews correspond to two ways of inputting initial review information of users. When users make comments directly, their product evaluations will be directly sent to the "Shopping Review Large Language Model Prompt Word Instructions" module, or the product evaluation collection template will collect the user's needs and then send them to the "Shopping Review Large Language Model Prompt Word Instructions" module. At the same time, the system will also set the marketing type and marketing level of the review through marketing attributes, and send them to the "Shopping Review Large Language Model Prompt Word Instructions" module to build the final Prompt instruction of the shopping review large language model.
[0056] Among them, the "Shopping Review Large Language Model Prompt Word Instructions" module is a prompt word engineering, which can be used to guide and control the behavior of the shopping review large language model, so that the shopping review large language model can generate product reviews more accurately and more targeted. The prompt word engineering mainly guides the product review behavior of the shopping review large language model by clarifying the task and context settings, and controls the marketing characteristics and output quality of the content output through the marketing attributes of the product. The "Shopping Review Large Language Model Prompt Word Instructions" module constructs the product review instructions corresponding to the target product, and then converts the input prompt instructions into the corresponding word vectors through word vectorization, and then inputs them into the shopping review large language model together with the feature vectors obtained by the "Multimodal Hybrid Feature Extraction Encoding" model, and generates the final product reviews through the fine-tuned shopping review large language model. Finally, users can give evaluations on product reviews through dialogue, so that the shopping review large language model can give more appropriate generation results.
[0057] See also Figure 2 As shown, the embodiment of the present invention discloses a method for generating product reviews, which may include:
[0058] Step S11, obtaining initial review information corresponding to a target product, and using a preset prompt word generation template to generate a prompt word corresponding to the target product according to the initial review information, product information of the target product, and user information of the target user.
[0059] In the present embodiment, the above-mentioned use of a preset prompt word generation template to generate prompt words corresponding to the target product according to the initial review information, the product information of the target product and the user information of the target user may include: generating the initial review information corresponding to the target product based on a preset review template or a review writing instruction of a target user; respectively determining a first target text corresponding to the initial review information and a second target text corresponding to the user information of the target user, and determining a preset marketing attribute corresponding to the target product; using the preset prompt word generation template to generate the prompt words corresponding to the target product according to the first target text, the second target text, the product information of the target product and the preset marketing attribute. Specifically, the initial review information may be determined through a product review written directly by a user, or when the quality of the user review is too poor or the user actively initiates the generation of a review, a comment auxiliary generation function may be selected, and then a personalized review template for the product review may pop up to quickly collect user usage experience information and obtain the corresponding initial review information, wherein the personalized review template for the product review is referred to in Figure 3As shown, users can summarize their user experience by rating the user experience, design rating, quality rating, and selecting subjective evaluation words. Afterwards, the text portion of the initial comment information and user information is extracted to obtain the corresponding first target text and second target text, and the marketing type, marketing level, etc. of the target comment are set through marketing attributes, wherein the user information includes but is not limited to: age group, gender, address location, tags, previous comments, etc. Then, a preset prompt word generation template is used to generate a corresponding Prompt instruction, i.e., a prompt word, based on the first target text, the second target text, product information, and marketing attributes. Among them, the preset prompt word generation template can be specifically referred to as shown below:
[0060] Instruction: Please generate a personalized user evaluation of a product based on the following input data;
[0061] Context:
[0062] The user's basic information tags (such as male, single, young people from small towns, car owners, etc.);
[0063] Basic information about the purchased goods;
[0064] The experience of using the product (satisfied with the quality (neutral, dissatisfied), liked the appearance (neutral, disliked), happy with the experience, etc.);
[0065] Examples of great reviews for this product;
[0066] Marketing attributes (marketing type, marketing level, etc.);
[0067] Input data (this field can be left blank when the user chooses to use a personalized review template to collect their experience; or when the user inputs part of the product review text and waits for the system to generate additional data, this field contains the review data filled in by the user);
[0068] Output instructions: Specify the format of the output product reviews.
[0069] Step S12: determine the target feature corresponding to the initial review information based on a preset multi-head attention model, and generate a large model based on the prompt word, the target feature and the preset review to generate a review to be confirmed corresponding to the target product.
[0070] See also Figure 4As shown, in this embodiment, a multimodal hybrid feature extraction method is designed to fuse the features of text, image and video, so as to provide more basic feature information for the shopping review language model. When fine-tuning and reasoning the shopping review language model, it is necessary to combine the multimodal hybrid feature extraction technology for fine-tuning and model reasoning. Among them, the Transformer Encoder model (i.e., the transformer encoder model) can be used for text feature extraction, and the feature vector of the text is extracted after the text is fine-tuned by the word embedding technology. After that, the features of the comment picture and the comment video are extracted as the image feature vector, and then the text feature vector and the image feature vector are fused through a full link layer, so as to fuse the features of the two modalities to obtain a unified feature vector. Specifically, first obtain the data that needs to extract features, including product information, initial comment information, comment picture, comment video and user information, which may need to extract features. Except for the product information, the remaining data are optional data, and feature extraction is performed when provided by the user.
[0071] In a specific embodiment, in order to extract text features corresponding to product information, initial comment information, and user information, before determining the target features corresponding to the initial comment information based on the preset multi-head attention model, the method may also include: determining the first target word vector corresponding to the first target text, the second target text, and the product information based on the preset word embedding technology; extracting the features of the first target word vector according to the preset transformer encoder model to obtain the first initial features corresponding to the initial comment information, the user information, and the product information. Specifically, the obtained text data of the product information, initial comment information, and user information are converted into corresponding vector representations through the Word Embedding technology, and then the word vector is input into the Transformer Encoder model to extract the corresponding text features, thereby obtaining the first initial feature. The generated text feature vector A of the first initial feature can be used with F 1 Indicates that F 1 is a 1024-dimensional feature vector. In this embodiment, the feature extraction of user information and product information will be performed after obtaining user authorization to protect the user's privacy and security, while improving the review generation efficiency of the shopping review large language model.
[0072] In a specific embodiment, in order to extract image features corresponding to the comment pictures and comment videos, before determining the target features corresponding to the initial comment information based on the preset multi-head attention model, it may also include: determining the target video and target picture that may be contained in the initial comment information, and extracting the target key frame in the target video based on the preset frame difference extraction method; extracting the first image features corresponding to the target key frame and the target picture based on the preset convolutional neural network model, and fusing the first image features according to the preset model construction method to obtain the corresponding second image features; performing corresponding dimensionality reduction processing on the second image features using the preset principal component analysis method, and determining the third image features corresponding to the second image features after dimensionality reduction according to the preset visual model. It can be understood that the comment pictures and comment videos are optional data, and feature extraction is performed when provided by the user. For the target pictures of the comments obtained, assuming that the user has uploaded k pictures, where k>=0, the system will perform feature extraction on the k pictures respectively. Specifically, the ResNext-50 model can be used to extract image features. The features generated for each picture can be expressed using P i It means that the combination of image features can be directly concatenated through the Concat operation to obtain the image feature F 2 , then the feature of the k-frame image can be expressed as F 2 =(P 1 , P 2 ,…,P k ), F 2 is a feature vector of T*2048*k dimensions, where T is the size of the image, which is generally 64*64. For the target video of the obtained comments, since the product review video is generally short and there is a lot of redundancy in the video information, it is designed to extract only the key frames of the video, and a total of j frames of pictures are extracted as key frames. Specifically, the frame difference extraction method can be used to extract the key frames of the video, and the target frame f i With the previous frame f i-1 Perform image difference. When the difference is greater than the threshold T, it is determined that the target frame has a large image change, and the target frame is considered to be a key frame, which can be expressed as: Then, the extracted video key frame images are subjected to image feature extraction. The features of the video image can be expressed as F 3 =(P 1 , P 2 ,…,P j ). Afterwards, for the image feature vector F 2 , video image feature vector F 3Since the number of comment images k and the number of video key frames j are uncertain, the core feature vector can be extracted through PCA dimensionality reduction (PCA, i.e., Principal Component Analysis). Then, the first image feature of the target image and the second image feature of the target video are concatenated to obtain F 4 , that is, F 4 =(F 2 , F 3 ). Then, 4 Perform PCA dimensionality reduction to obtain the main features G of the target image and target video of the comment 1 , G 1 is a T*1024-dimensional feature vector, and the k+j frame image features of the target image and the target video are de-redundant and fixed to a T*1024-dimensional feature vector. Finally, the Transfomer-vit model (i.e., VisionTransformer) is used to transform the feature G 1 Perform fusion and feature extraction to determine the semantic coding expression of the target image and target video to facilitate subsequent feature fusion.
[0073] In a specific embodiment, in order to extract the speech and text features corresponding to the comment video, before determining the target features corresponding to the initial comment information based on the preset multi-head attention model, it can also include: determining the third target text in the target video according to the preset speech recognition method, and determining the text features corresponding to the third target text according to the preset text convolutional neural network model; determining the second initial features corresponding to the initial comment information based on the preset cross-attention mechanism, the text features and the third image features. Specifically, the speech of the target video can be converted into text information through speech recognition to obtain the third target text. If there is no audio information in the target video, this step can be ignored. The third target text is input into the TextCNN model (Text Convolutional Neural Network), and the corresponding text feature information is extracted as T 1 , T 1 It is a 768-dimensional feature vector, and then the feature fusion is performed through the CrossAttenion (i.e., cross attention mechanism) structure to obtain the fused image feature vector B, which is a 1*1024-dimensional feature vector.
[0074] In this embodiment, the determination of the target feature corresponding to the initial comment information based on the preset multi-head attention model may include: determining the corresponding feature to be fused based on the preset multi-head attention model, the preset normalized exponential function, the first initial feature and the second initial feature; fusing the feature to be fused and the first initial feature according to the preset model construction method to obtain the target feature corresponding to the initial comment information. Specifically, a multi-head attention model is constructed to fuse the text feature vector A of the first initial feature with the image feature vector B of the second initial feature. The value V in the attention mechanism is obtained by transforming the text feature vector A, and the query Q and the key value K are obtained by transforming the image feature vector B.
[0075] ;
[0076] ;
[0077] ;
[0078] The formula represents the construction of the feature vector of the i-th attention mechanism, where W v i , W q i , W k i They represent the weight transfer matrix of the nonlinear transformation features of the hidden layer feature vector, and + represents the addition of each column of the matrix to the corresponding vector. v i , b q i , b k i Represents the bias vector of the model. In this embodiment, the attention mechanism uses 6 heads, and the formula for fusing text features with image features is as follows:
[0079] ;
[0080] ;
[0081] Q in the formula i , K i 、V i Represents the query, keyword, and value in each spatial attention mechanism in the multi-head attention mechanism. Through the cross-attention mechanism, the text features and image features are deeply integrated to obtain the feature vector H i , and then the feature vectors of several heads are combined with the weight transfer matrix W of the nonlinear transformation features i The matrices are multiplied and the heads of each attention are accumulated. In order to avoid the model explosion, the output data can be normalized to between 0 and 1 through the Softmax operation to obtain the feature vector G of the fused feature to be fused. 2 , G 2is a 1*1024-dimensional feature vector. In order to prevent the forgetting of text features, the feature vector G of the feature to be fused can be 2 The text feature vector F with the first initial feature 1 Perform a Concat operation to obtain the feature vector C of the final fused target feature, where C is a 1*2048-dimensional feature vector. It can be seen that this embodiment can use multimodal fusion technology to allow the shopping review large language model to understand the user's comments and photo and video information, and use the multimodal fusion features to more naturally understand the user's product reviews, thereby extracting more effective auxiliary features to help the shopping review large language model complete the generation of user product reviews. The obtained product reviews are of higher quality and more in line with the user's real experience, and also have some auxiliary marketing attributes.
[0082] In this embodiment, the generation of a large model based on the prompt word, the target feature and the preset comment generation model to generate the pending comment corresponding to the target product may include: determining a second target word vector corresponding to the prompt word based on the preset word embedding technology, and inputting the second target word vector and the target feature into the preset comment generation large model to generate the pending comment corresponding to the target product. Specifically, the input Prompt instruction may first be converted into a corresponding word vector through word vectorization, and then input into the shopping review large language model together with the feature vector of the target feature, and the pending comment of the target product is generated by the fine-tuned shopping review large language model, wherein the feature vector of the target feature is used as the guiding feature vector of the shopping review large language model for inference, so as to guide the shopping review large language model to generate product reviews that meet the basic information of the user. See. Figure 5 As shown, in one specific implementation, when a user enters the product review interface and starts to review a product, the system can automatically complete the subsequent review text for the user, and the completed review text to be confirmed is gray. The user can use the left and right keys on the keyboard to select the content to be accepted, and can choose to accept all or partially accept. If it is partially accepted, the system will continue to generate new ones for the accepted part and let the user make a choice. In another specific implementation, the user's experience information is quickly collected through the personalized review template of the product review to obtain the corresponding initial review information, and then the prompt words of the large language model are constructed based on the collected initial review information, and then sent to the shopping review large language model to generate the target product's pending review.
[0083] Step S13: obtaining evaluation information generated by the target user based on the comment to be confirmed, and determining a target comment corresponding to the target product based on the evaluation information.
[0084] In this embodiment, the user can judge the pending comments generated by the shopping review big language model through dialogue, so that the big language model can give a more appropriate generation result. If the pending comments are consistent with the user's feelings, the user can accept the generated product reviews. If the generated pending comments do not meet the user's subjective usage experience of the product, the user can input text evaluation of the generated pending comments, or directly select the review experience provided by the system, such as consistent with subjective feelings, worse usage experience than the pending comments, better usage experience than the pending comments, etc.
[0085] As can be seen from the above, in this embodiment, the initial review information corresponding to the target product is first obtained, and the preset prompt word generation template is used to generate the prompt word corresponding to the target product according to the initial review information, the product information of the target product and the user information of the target user; then, the target feature corresponding to the initial review information is determined based on the preset multi-head attention model, and a large model is generated based on the prompt word, the target feature and the preset comment to generate a comment to be confirmed corresponding to the target product; finally, the evaluation information generated by the target user based on the comment to be confirmed is obtained, and the target comment corresponding to the target product is determined based on the evaluation information. As can be seen from the above, this embodiment can analyze and judge the initial review information in real time, generate corresponding prompt words in combination with product information and user information, and use the preset comment generation large model to assist in writing the user's product review based on the prompt word and the initial review information, thereby simplifying the steps of product review, reducing the workload and difficulty of product review writing, leveling the cultural level and age differences between users, helping users to effectively complete product reviews, and improving the quality of product reviews.
[0086] See also Figure 6 As shown, in order to obtain product reviews that satisfy users, the embodiment of the present invention further discloses a product review generation method, which may include:
[0087] Step S21: acquiring initial review information corresponding to a target product, and using a preset prompt word generation template to generate a prompt word corresponding to the target product according to the initial review information, product information of the target product, and user information of the target user.
[0088] Step S22: determine the target feature corresponding to the initial review information based on a preset multi-head attention model, and generate a large model based on the prompt word, the target feature and the preset review to generate a comment to be confirmed corresponding to the target product.
[0089] See also Figure 7As shown in the figure, the training process of the shopping review large language model in this embodiment is as follows: first, nearly 1 million product review data from existing shopping malls are collected, and basic data is constructed by data cleaning and marketing effect labeling. The model is pre-trained through the basic data set, and the model completes the semantic learning of basic knowledge text and the logical relationship learning between sentences through self-supervised training of the basic data.
[0090] In the model reinforcement training stage, human judgement feedback is used to evaluate the quality of generated text, improve the ability of large models to generate reviews that are close to user experience for a variety of product reviews, and guide model optimization. Specifically, the model can give each generation result, which is then handed over to humans for judgment, generating rewards and penalties, so that the model can learn the output habits expected by humans.
[0091] Finally, the model is fine-tuned and trained using the labeled product review information data, and the model parameters are fine-tuned using sensitive data to optimize the model's performance in the task of generating user product reviews, thereby obtaining the final large language model for shopping reviews.
[0092] Step S23: obtaining evaluation information generated by the target user based on the comment to be confirmed, and directly determining the comment to be confirmed as the target comment corresponding to the target product based on the evaluation information.
[0093] In a specific implementation, the user directly inputs a product review, and the system analyzes the product review in real time. If the review is not completed, the system will automatically complete the product review for the user. If the user accepts it, the target review corresponding to the target product can be directly determined based on the pending review generated by the shopping review large language model.
[0094] In another specific implementation, if the quality of user reviews is too poor or the user actively initiates the generation of reviews, a personalized template for product reviews will pop up to guide the user to quickly collect usage experience information, and then generate new product reviews based on user experience. If the user adopts the pending comments generated by the shopping review large language model, the pending comments can be directly used to overwrite the original comments.
[0095] Step S24, obtaining the evaluation information generated by the target user based on the comment to be confirmed, adjusting the random number factor in the preset comment generation model based on the evaluation information, and jumping to the step of generating the large model according to the prompt word, the target feature and the preset comment, and generating the comment to be confirmed corresponding to the target product, so as to obtain the target comment corresponding to the target product.
[0096] In this embodiment, if the user rejects the comment to be confirmed, the system will automatically adjust the random number factor of the shopping review language model based on the user's evaluation information, and regenerate product review information that is close to the user's actual usage experience, until the user is satisfied and accepts it, and then the user will publish the target review.
[0097] For a more specific processing procedure of the above step S21, reference may be made to the corresponding contents disclosed in the above embodiments, which will not be described in detail here.
[0098] As can be seen from the above, in this embodiment, the shopping review large language model is first trained with the existing product review data. After the shopping review large language model is used to generate the pending comments of the target product, the user evaluates the pending comments. If the user accepts them, the target comments can be directly obtained based on the pending comments. If the user refuses, the shopping review large language model is adjusted and the product reviews are regenerated until the user is satisfied and accepts them. In this way, by learning from the user's high-quality product reviews, the shopping review large language model has the ability to generate high-quality product reviews. It does not rely on the user's manual input and cultural level. It only needs a simple selection judgment to complete the product use evaluation. In addition, this embodiment can generate product reviews that are close to the user's real use experience based on user evaluations.
[0099] See also Figure 8 As shown, in a specific implementation, the product review generation process may specifically be:
[0100] a) When a user starts to comment, he can directly write a product review or select the comment assistance function. When a user directly writes a product review, the system quickly analyzes the review and produces a real-time completion effect.
[0101] b) When the quality of the review is poor, the review assisted generation function is turned on. Or if the user does not want to fill in the form by himself, he can actively turn on the review assisted generation function; the review assisted generation function will turn on different experience collection templates according to the category of the product purchased by the user, and the specific decision will be based on different products. The user only needs to check the questions in the template and simply describe the user experience. After completing the template, the system will generate product reviews based on the user's filled-in information.
[0102] c) The information collected in the above two steps will be used as the basic data for the input of the shopping review language model. At the same time, the user's personalized information, product information of the purchased goods, photos and videos uploaded by the user and other information will be collected for feature fusion to construct the prompt word instructions of the large model. Finally, it will be sent to the shopping review language model for analysis through the cross-attention mechanism to generate new user product review information.
[0103] d) The user will judge the generated product reviews. If the reviews are consistent with the user's feelings, the user can accept the product review information generated this time. If the product review information generated this time does not meet the user's subjective usage experience of the product, the user can enter a text evaluation of the product review information generated this time, or directly select the review experience provided by the system.
[0104] e) If the user rejects the product review, the system will automatically adjust the random number factor based on the user's comments and regenerate product review information that is close to the user's actual experience, and this will continue until the user is satisfied and accepts it, and then the user will publish the review. In practical tests, users can generally reach a satisfactory state and accept it after one or two modifications.
[0105] Accordingly, see Fig. 9 As shown, the embodiment of the present application also provides a product review generating device, which may include:
[0106] The prompt word generation module 11 is used to obtain the initial review information corresponding to the target product, and use a preset prompt word generation template to generate a prompt word corresponding to the target product according to the initial review information, the product information of the target product and the user information of the target user;
[0107] The to-be-confirmed comment generation module 12 is used to determine the target feature corresponding to the initial comment information based on a preset multi-head attention model, and generate a large model according to the prompt word, the target feature and the preset comment to generate the to-be-confirmed comment corresponding to the target product;
[0108] The target review determination module 13 is used to obtain the evaluation information generated by the target user based on the review to be confirmed, and determine the target review corresponding to the target product based on the evaluation information.
[0109] As can be seen from the above, in this application, the initial review information corresponding to the target product is first obtained, and the preset prompt word generation template is used to generate the prompt word corresponding to the target product according to the initial review information, the product information of the target product and the user information of the target user; then, the target feature corresponding to the initial review information is determined based on the preset multi-head attention model, and a large model is generated based on the prompt word, the target feature and the preset comment to generate a comment to be confirmed corresponding to the target product; finally, the evaluation information generated by the target user based on the comment to be confirmed is obtained, and the target comment corresponding to the target product is determined based on the evaluation information. As can be seen from the above, this application can analyze and judge the initial review information in real time, generate corresponding prompt words in combination with product information and user information, and use the preset comment generation large model to assist in writing the user's product review based on the prompt word and initial review information, simplifying the steps of product review, reducing the workload and difficulty of writing product review, leveling the cultural level and age differences between users, helping users to effectively complete product reviews, and improving the quality of product reviews.
[0110] In some specific implementations, the prompt word generating module 11 may include:
[0111] An initial review information generating unit, configured to generate the initial review information corresponding to the target product based on a preset review template or a review writing instruction of a target user;
[0112] a preset marketing attribute determination unit, used to respectively determine a first target text corresponding to the initial comment information and a second target text corresponding to the user information of the target user, and determine a preset marketing attribute corresponding to the target product;
[0113] The prompt word generating unit is used to generate the prompt word corresponding to the target product according to the first target text, the second target text, the product information of the target product, and the preset marketing attribute by using the preset prompt word generating template.
[0114] In some specific implementations, the product review generating device may further include:
[0115] A first target word vector determination module, configured to determine a first target word vector corresponding to the first target text, the second target text, and the commodity information based on a preset word embedding technology;
[0116] A first initial feature determination module is used to extract features of the first target word vector according to a preset converter encoder model to obtain first initial features corresponding to the initial comment information, the user information and the product information.
[0117] In some specific implementations, the product review generating device may further include:
[0118] A target key frame extraction module, used to determine the target video and target picture that may be included in the initial comment information, and extract the target key frame in the target video based on a preset frame difference extraction method;
[0119] A second image feature determination module is used to extract first image features corresponding to the target key frame and the target picture based on a preset convolutional neural network model, and perform fusion processing on the first image features according to a preset model construction method to obtain corresponding second image features;
[0120] The third image feature determination module is used to perform corresponding dimensionality reduction processing on the second image feature using a preset principal component analysis method, and determine the third image feature corresponding to the second image feature after dimensionality reduction according to a preset visual model.
[0121] In some specific implementations, the product review generating device may further include:
[0122] A text feature determination module, used to determine a third target text in the target video according to a preset speech recognition method, and determine a text feature corresponding to the third target text according to a preset text convolutional neural network model;
[0123] A second initial feature determination module, configured to determine a second initial feature corresponding to the initial comment information based on a preset cross-attention mechanism, the text feature and the third image feature;
[0124] Accordingly, the to-be-confirmed comment generating module 12 may include:
[0125] A feature-to-be-fused determining unit, configured to determine corresponding features to be fused based on the preset multi-head attention model, the preset normalized exponential function, the first initial features, and the second initial features;
[0126] A target feature determination unit is used to fuse the feature to be fused and the first initial feature according to the preset model construction method to obtain the target feature corresponding to the initial comment information.
[0127] In some specific implementations, the to-be-confirmed comment generating module 12 may include:
[0128] The pending-confirmation comment generation unit is used to determine the second target word vector corresponding to the prompt word based on the preset word embedding technology, and input the second target word vector and the target feature into the preset comment generation model to generate the pending-confirmation comment corresponding to the target product.
[0129] In some specific implementations, the target review determination module 13 may include:
[0130] A first target review determination unit, configured to directly determine the review to be confirmed as the target review corresponding to the target product based on the evaluation information;
[0131] The second target comment determination unit is used to adjust the random number factor in the preset comment generation model based on the evaluation information, and jump to the step of generating the large model according to the prompt word, the target feature and the preset comment, and generating the to-be-confirmed comment corresponding to the target product, so as to obtain the target comment corresponding to the target product.
[0132] Furthermore, the present application also discloses an electronic device. Fig.10 It is a structural diagram of an electronic device 20 shown according to an exemplary embodiment, and the content in the figure cannot be regarded as any limitation on the scope of use of this application. The electronic device 20 may specifically include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input and output interface 25 and a communication bus 26. Among them, the memory 22 is used to store a computer program, and the computer program is loaded and executed by the processor 21 to implement the relevant steps in the product review generation method disclosed in any of the aforementioned embodiments. In addition, the electronic device 20 in this embodiment can specifically be an electronic computer.
[0133] In this embodiment, the power supply 23 is used to provide working voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and the external device, and the communication protocol it follows is any communication protocol that can be applied to the technical solution of the present application, and is not specifically limited here; the input and output interface 25 is used to obtain external input data or output data to the outside world, and its specific interface type can be selected according to specific application needs and is not specifically limited here.
[0134] In addition, the memory 22, as a carrier for storing resources, can be a read-only memory, a random access memory, a disk or an optical disk, etc. The resources stored thereon can include an operating system 221, a computer program 222, etc., and the storage method can be temporary storage or permanent storage.
[0135] The operating system 221 is used to manage and control the hardware devices and computer program 222 on the electronic device 20, which can be Windows Server, Netware, Unix, Linux, etc. In addition to including a computer program that can be used to complete the product review generation method performed by the electronic device 20 disclosed in any of the aforementioned embodiments, the computer program 222 can further include a computer program that can be used to complete other specific tasks.
[0136] Furthermore, the present application also discloses a computer-readable storage medium for storing a computer program; wherein the computer program, when executed by a processor, implements the aforementioned disclosed method for generating product reviews. The specific steps of the method can be referred to the corresponding contents disclosed in the aforementioned embodiments, and will not be repeated here.
[0137] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.
[0138] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0139] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
[0140] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.
[0141] The technical solution provided by the present application is introduced in detail above. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea. At the same time, for general technicians in this field, according to the idea of the present application, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.
Claims
1. A method for generating product reviews, characterized in that: include: Acquire initial review information corresponding to the target product, and generate a prompt word corresponding to the target product according to the initial review information, product information of the target product, and user information of the target user using a preset prompt word generation template; Determine the target feature corresponding to the initial review information based on a preset multi-head attention model, and generate a large model according to the prompt word, the target feature and the preset review to generate a review to be confirmed corresponding to the target product; The evaluation information generated by the target user based on the comment to be confirmed is obtained, and the target comment corresponding to the target product is determined based on the evaluation information.
2. The method for generating product reviews according to claim 1, characterized in that: The using a preset prompt word generation template to generate a prompt word corresponding to the target product according to the initial review information, the product information of the target product and the user information of the target user includes: Generate the initial review information corresponding to the target product based on a preset review template or a review writing instruction of a target user; Respectively determining a first target text corresponding to the initial review information and a second target text corresponding to the user information of the target user, and determining a preset marketing attribute corresponding to the target product; The preset prompt word generation template is used to generate the prompt word corresponding to the target product according to the first target text, the second target text, the product information of the target product, and the preset marketing attribute.
3. The method for generating product reviews according to claim 2, characterized in that: Before determining the target feature corresponding to the initial comment information based on the preset multi-head attention model, the method further includes: Determine a first target word vector corresponding to the first target text, the second target text, and the product information based on a preset word embedding technology; The features of the first target word vector are extracted according to a preset converter encoder model to obtain first initial features corresponding to the initial comment information, the user information, and the product information.
4. The method for generating product reviews according to claim 3, characterized in that: Before determining the target feature corresponding to the initial comment information based on the preset multi-head attention model, the method further includes: Determine a target video and a target picture that may be included in the initial comment information, and extract a target key frame in the target video based on a preset frame difference extraction method; Extracting first image features corresponding to the target key frame and the target image based on a preset convolutional neural network model, and fusing the first image features according to a preset model construction method to obtain corresponding second image features; A preset principal component analysis method is used to perform corresponding dimensionality reduction processing on the second image feature, and a third image feature corresponding to the second image feature after dimensionality reduction is determined according to a preset visual model.
5. The method for generating product reviews according to claim 4, characterized in that: Before determining the target feature corresponding to the initial comment information based on the preset multi-head attention model, the method further includes: Determine a third target text in the target video according to a preset speech recognition method, and determine a text feature corresponding to the third target text according to a preset text convolutional neural network model; Determine a second initial feature corresponding to the initial comment information based on a preset cross-attention mechanism, the text feature, and the third image feature; Accordingly, determining the target features corresponding to the initial comment information based on the preset multi-head attention model includes: Determining corresponding features to be fused based on the preset multi-head attention model, the preset normalized exponential function, the first initial features, and the second initial features; The feature to be fused and the first initial feature are fused according to the preset model building method to obtain the target feature corresponding to the initial comment information.
6. The method for generating product reviews according to claim 1, characterized in that: The step of generating a macro model according to the prompt word, the target feature and the preset comments, and generating the comments to be confirmed corresponding to the target product, includes: Based on the preset word embedding technology, a second target word vector corresponding to the prompt word is determined, and the second target word vector and the target feature are input into the preset comment generation model to generate the comment to be confirmed corresponding to the target product.
7. The method for generating product reviews according to any one of claims 1 to 6, characterized in that: The determining a target review corresponding to the target product based on the evaluation information includes: Directly determining the review to be confirmed as the target review corresponding to the target product based on the evaluation information; Or, based on the evaluation information, adjust the random number factor in the preset comment generation model, and jump to the step of generating the large model according to the prompt word, the target feature and the preset comment, and generating the pending comment corresponding to the target product, so as to obtain the target comment corresponding to the target product.
8. A product review generating device, characterized in that: include: A prompt word generation module, used to obtain initial review information corresponding to a target product, and generate a prompt word corresponding to the target product according to the initial review information, product information of the target product and user information of the target user using a preset prompt word generation template; A module for generating comments to be confirmed is used to determine the target feature corresponding to the initial comment information based on a preset multi-head attention model, and generate a large model according to the prompt word, the target feature and the preset comments to generate the comments to be confirmed corresponding to the target product; The target review determination module is used to obtain the evaluation information generated by the target user based on the review to be confirmed, and determine the target review corresponding to the target product based on the evaluation information.
9. An electronic device, characterized in that: The electronic device includes a processor and a memory; wherein the memory is used to store a computer program, and the computer program is loaded and executed by the processor to implement the product review generating method as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: Used to store a computer program, which, when executed by a processor, implements the product review generating method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Microblog case aspect-level viewpoint identification method based on text comment interactive attention
CN112926336A
Comment generation method and device, electronic equipment and storage medium
CN117454867A
Commodity label generation method based on large language model and electronic equipment
CN117788109A
Blog generation method, system and equipment based on tourism scene and storage medium
CN117875295A
Visual emotion recognition method, device and equipment and readable storage medium
CN117911929A