User comment recognition and classification method, system and model
Through the custom BERT model and CRF layer identification network, user comments are classified into demand attention, pre-buy decisions and post-buy feedback, which solves the problem that existing technology is difficult to identify and classify user comments, and realizes accurate identification of comments and generation of detailed evaluation reports, helping brands optimize products and marketing strategies.
Patent Information
- Application Number
- CN202410508376.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-25
- Publication Date
- 2025-03-25
AI Technical Summary
The existing technology is difficult to effectively identify and classify the feedback before and after purchase in user comments, and it is impossible to deeply analyze consumers' pre-buy questions and after-buy feedback, resulting in brand parties missing the opportunity to optimize their products and marketing strategies.
By annotating user comments, using a custom BERT model and a CRF layer identification network, comments are classified into demand attention, pre-buy decisions and post-buy feedback. The method includes annotating the training data set, training the recognition network, and inputting the user comments to be identified into the network to output the classification results.
It realizes the professional technical classification of user reviews, can accurately identify the needs of comments, pre-buy decisions or post-buy feedback, and generates detailed evaluation reports to help brands optimize their products and marketing strategies.
Smart Images

Figure CN119691603A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of corpus analysis and processing, and in particular to a method for classifying user comments through a big data model. Background Art
[0002] With the development of Internet technology, in the current e-commerce environment, brands are faced with the challenge of how to effectively capture and understand consumer needs. Although social media platforms provide a large amount of user feedback, it is very difficult to extract valuable information from these feedbacks to guide brand decisions. If the language processing technology in the existing technology is directly applied to the field of comment screening, it can only use a large language model to obtain keywords or sentiment tendencies, and cannot judge whether the comments are purchase feedback. It is often impossible to deeply analyze consumers' pre-purchase questions and post-purchase feedback, causing brands to miss opportunities to optimize products and marketing strategies. Summary of the invention
[0003] Therefore, it is necessary to provide a professional technical classification solution that can provide feedback on user review information before and after purchase.
[0004] To achieve the above-mentioned purpose, the inventor provides a method for identifying and classifying user comments, comprising the following steps: annotating a first training data set, wherein the annotated labels include primary labels and secondary labels; the primary labels include: demand concern, pre-purchase decision, and post-purchase feedback, and the secondary labels are secondary classification categories subordinate to the primary labels; inputting the annotated first training data set into a first recognition network for training to obtain a trained first recognition network, deploying the first recognition network, inputting user comments to be identified into the first recognition network, and the first recognition network outputting classification results of whether the user comments belong to demand concern, pre-purchase decision, or post-purchase feedback.
[0005] In one embodiment of the present application, the secondary label items of demand concern include: one or more of applicable groups, user pain points, applicable scenarios, pre-purchase needs, and intended products; the secondary labels subordinate to pre-purchase decisions include: one or more of questions, prices, purchase intentions, urging replenishment, and purchase motivations; the secondary labels subordinate to post-purchase feedback include: one or more of brand awareness, brand image, user's first purchase, will not repurchase, will repurchase, already purchased, recommendation, feeling experience, functional pain points, service commitment-unmet, purchase channels, usage status, follow-up reviews, and comparisons.
[0006] In one embodiment of the present application, the method further includes the step of: the first recognition network outputting the named entities in the user comments that hit the primary tag or the secondary tag.
[0007] In one embodiment of the present application, the step is also included to automatically generate an evaluation report based on the word frequency of the named entities that hit the first-level label or the second-level label in the user comments output by the first recognition network and the classification results of the user comments belonging to demand concerns, pre-purchase decisions or post-purchase feedback.
[0008] In one embodiment of the present application, the first recognition network is a custom BERT model, and the custom BERT model includes a conversion layer, a first fully connected layer, and a second fully connected layer connected in sequence.
[0009] In one embodiment of the present application, the custom BERT model also includes a CRF layer, the CRF layer is connected to the second fully connected layer, and the CRF layer includes an Adam optimizer.
[0010] In one embodiment of the present application, the conversion layer is 12 layers; the hidden layer size of the conversion layer is 12×768, and it is also equipped with 12 self-attention heads; the input of the conversion layer is serialized text data, and the output is a 768-dimensional feature vector for each Token; the input dimension of the first fully connected layer is 768, and the output dimension is 512, and the first connection layer uses ReLU as an activation function; the input dimension of the second fully connected layer is 512, and the output dimension is N, where N is the number of secondary labels.
[0011] A user comment recognition and classification system comprises a labeling unit, a training unit and a recognition unit, wherein the labeling unit is used to label a first training data set, and the labeled labels include primary labels and secondary labels; the primary labels include: demand concern, pre-purchase decision, and post-purchase feedback, and the secondary labels are secondary classification categories subordinate to the primary labels; the training unit is used to input the labeled first training data set into a first recognition network for training to obtain a trained first recognition network; the recognition unit is used to deploy the first recognition network, input the user comments to be recognized into the first recognition network, and the first recognition network outputs the classification result of whether the user comments belong to demand concern, pre-purchase decision, or post-purchase feedback.
[0012] In one embodiment of the present application, the recognition unit is also used to deploy a first recognition network to output the named entities in the user comments that hit the first-level label or the second-level label, and also includes an evaluation report unit, which is used to automatically generate an evaluation report based on the word frequency of the named entities in the user comments that hit the first-level label or the second-level label output by the first recognition network and the classification results of the user comments belonging to demand concerns, pre-purchase decisions or post-purchase feedback.
[0013] A user comment recognition and classification model, the classification model is a custom BERT model, the custom BERT model includes a conversion layer, a first fully connected layer, a second fully connected layer connected in sequence, and a CRF layer, the CRF layer is connected to the second fully connected layer, the CRF layer includes an Adam optimizer, the conversion layer has 12 layers; the hidden layer size of the conversion layer is 12×768, and it is also equipped with 12 self-attention heads; the input of the conversion layer is serialized text data, and the output is a 768-dimensional feature vector for each Token; the input dimension of the first fully connected layer is 768, and the output dimension is 512, and the first connection layer uses ReLU as an activation function; the input dimension of the second fully connected layer is 512, and the output dimension is N, where N is the number of secondary labels.
[0014] Through the above steps, this solution can achieve the technical effect of identifying the classification of user comments by performing a new secondary labeling method on the training set and training the first recognition network to output the classification results of whether the user comments belong to pre-purchase or post-purchase.
[0015] The above-mentioned records related to the invention content are only an overview of the technical solution of the present application. In order to enable ordinary technicians in the field to more clearly understand the technical solution of the present application, and then implement it according to the text of the specification and the contents recorded in the drawings, and to make the above-mentioned purpose and other purposes, features and advantages of the present application easier to understand, the following is an explanation in combination with the specific implementation mode and drawings of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] The drawings are only used to illustrate the principles, implementation methods, applications, characteristics and effects of the specific embodiments of the present application and other related contents, and shall not be considered as limitations of the present application.
[0017] Figure 1 It is a flow chart of the method for identifying and classifying user comments described in the specific implementation mode;
[0018] Figure 2 A flow chart of a method for identifying and classifying user comments according to another embodiment;
[0019] Figure 3 This is a schematic diagram of a user comment identification and classification system according to a specific implementation method. DETAILED DESCRIPTION
[0020] In order to explain the technical content, structural features, achieved objectives and effects of the technical solution in detail, the following is a detailed description in conjunction with specific embodiments and accompanying drawings.
[0021] Reference to "embodiment" herein means that the specific features, structures or characteristics described in conjunction with the embodiment may be included in at least one embodiment of the present application. The term "embodiment" appearing in various places in the specification does not necessarily refer to the same embodiment, nor does it particularly limit its independence or association with other embodiments. In principle, in the present application, as long as there is no technical contradiction or conflict, the various technical features mentioned in the embodiments can be combined in any way to form a corresponding implementable technical solution.
[0022] Unless otherwise defined, the technical terms used in this document have the same meanings as those generally understood by those skilled in the art to which this application belongs; the use of relevant terms in this document is only for describing specific embodiments and is not intended to limit this application.
[0023] In the description of this application, the term "and / or" is an expression used to describe the logical relationship between objects, indicating that three relationships may exist, for example, A and / or B, which means: A exists, B exists, and A and B exist at the same time. In addition, the character " / " in this article generally indicates that the objects before and after are in an "or" logical relationship.
[0024] In the present application, terms such as “first” and “second” are merely used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship of quantity, priority or sequence between these entities or operations.
[0025] Without further limitations, in this application, the words "include", "comprises", "has" or other similar expressions used in the sentences are intended to cover non-exclusive inclusion. These expressions do not exclude the presence of additional elements in the process, method or product including the elements, so that the process, method or product including a series of elements may include not only those limited elements, but also other elements not explicitly listed, or also include elements inherent to such process, method or product.
[0026] Similar to the understanding in the Examination Guidelines, in this application, expressions such as "greater than", "less than", "exceed" and the like are understood to exclude the number itself; expressions such as "above", "below", "within" and the like are understood to include the number itself. In addition, in the description of the embodiments of this application, "multiple" means more than two (including two), and similar expressions related to "multiple" are also understood in this way, such as "multiple groups", "multiple times", etc., unless otherwise clearly and specifically limited.
[0027] In the description of the embodiments of the present application, space-related expressions used, such as "center", "longitudinal", "lateral", "length", "width", "thickness", "up", "down", "front", "back", "left", "right", "vertical", "horizontal", "vertical", "top", "bottom", "inside", "outside", "clockwise", "counterclockwise", "axial", "radial", "circumferential", etc., indicate the orientation or position relationship based on the orientation or position relationship shown in the specific embodiments or drawings, and are only for the convenience of describing the specific embodiments of the present application or facilitating the reader's understanding, and do not indicate or imply that the referred device or component must have a specific position, a specific orientation, or be constructed or operated in a specific orientation, and therefore cannot be understood as a limitation on the embodiments of the present application.
[0028] Unless otherwise expressly specified or limited, in the description of the embodiments of the present application, the terms such as "install", "connect", "connect", "fix", "set", etc. used should be understood in a broad sense. For example, the "connection" can be a fixed connection, a detachable connection, or an integrated setting; it can be a mechanical connection, an electrical connection, or a communication connection; it can be a direct connection, or it can be indirectly connected through an intermediate medium; it can be the internal connection of two elements or the interaction relationship between two elements. For technicians in the technical field to which the present application belongs, the specific meanings of the above terms in the embodiments of the present application can be understood according to the specific circumstances.
[0029] In some embodiments, see Figure 1 , a method for identifying and classifying user comments, including the following steps, S100 annotating a first training data set, the annotated labels include primary labels and secondary labels; the primary labels include: demand concern, pre-purchase decision, post-purchase feedback, and the secondary labels are secondary classification categories subordinate to the primary labels; S102 inputting the annotated first training data set into a first recognition network for training to obtain a trained first recognition network, S104 deploying the first recognition network, inputting the user comments to be identified into the first recognition network, and the first recognition network outputting the classification results of the user comments belonging to demand concern, pre-purchase decision or post-purchase feedback. Through the above steps, this solution can achieve the technical effect of identifying the classification of user comments by performing a new secondary annotation method on the training set and training the first recognition network to output the classification results of whether the user comments belong to pre-purchase or post-purchase.
[0030] In some embodiments of the present application, in order to better distinguish which user comment category it belongs to, the secondary label items can also be expanded. Specifically, the secondary label items that need to be concerned include: one or more of the applicable population, user pain points, applicable scenarios, pre-purchase needs, and intended products; the secondary labels subordinate to the pre-purchase decision include: one or more of questions, prices, purchase intentions, urging replenishment, and purchase motivations; the secondary labels subordinate to post-purchase feedback include: brand awareness, brand image, user first purchase, will not repurchase, will repurchase, purchased, recommended, experience, functional pain points, service commitments-unsatisfied, purchase channels, usage status, follow-up reviews, and comparisons. One or more of the categories of comments on the Internet are getting longer and longer, and they tend to evolve into comment articles. By setting up fine secondary label classifications, the recognition network can have a better understanding of long articles, and ultimately make the classification and recognition of user comments more accurate.
[0031] In some specific embodiments, Figure 2 As shown, it also includes step S106, the first recognition network outputs the named entities in the user comments that hit the first-level label or the second-level label. The named entity can be a phrase, word or sentence in the user comment. The method of outputting the named entity can be determined by the starting position and the ending position of the named entity in the text, and so on. For example, the specific price that appears in the text hits the second-level label "pre-purchase decision-price", and the first recognition network outputs it by marking its position, or it can be directly displayed in the display unit by highlighting it. For another example, the field in the text that indicates "talk about the feeling again" hits the second-level label "post-purchase feedback-follow-up review", and the first recognition network outputs it by marking its position, or it can be directly displayed in the display unit by highlighting it. Outputting the named entity by the above method can give the user a more intuitive feeling and facilitate inductive processing.
[0032] Some such as Figure 2 In the illustrated embodiment, it can be seen that the method further includes a step of automatically generating an evaluation report based on the frequency of the named entities that hit the primary label or the secondary label in the user comments output by the first recognition network and the classification results of whether the user comments belong to demand concerns, pre-purchase decisions, or post-purchase feedback. Automatically generating an evaluation report can summarize the classification results and provide feedback to improve the user experience.
[0033] In some specific embodiments, the first recognition network is a custom BERT model, and the custom BERT model includes a conversion layer, a first fully connected layer, and a second fully connected layer connected in sequence. BERT stands for Bidirectional Encoder Representations from Transformers. BERT aims to pre-train deep bidirectional representations by jointly adjusting the left and right contexts in all layers. The advantage of choosing the first recognition network as a custom BERT model is that only the BERT representation needs to be fine-tuned to be applicable to user comment classification without the need for a large number of task-specific model structure modifications.
[0034] In some specific embodiments, the custom BERT model also includes a CRF layer, which is connected to the second fully connected layer, and the CRF layer includes an Adam optimizer. The characteristic of the CRF layer is that it can take into account the transition probability between context tags, perform global parameter optimization and decoding in a serialized form, thereby solving the label bias problem that other discriminant models (such as maximum entropy Markov models) may encounter. In addition, the CRF model can also fuse multiple features and make full use of context information to make the model performance better. In this embodiment, the CRF layer receives the output of the second fully connected layer, uses the CRF model to consider the dependencies between entity tags, and optimizes the tag sequence of the entire sentence. The CRF layer can ensure that the final output tag sequence is globally optimal, which is more accurate than predicting each tag separately. The specific optimization of the CRF layer is adopted as follows: loss function: combine the likelihood loss of the CRF layer and the cross entropy loss of the fully connected layer to optimize the parameters of the model. Optimization algorithm: Use the AdamW optimizer, which combines weight decay (a form of L2 regularization) and the adaptive learning rate of the Adam optimizer, which is suitable for deep learning models.
[0035] In one embodiment of the present application, the conversion layer is 12 layers; the hidden layer size of the conversion layer is 12×768, and it is also equipped with 12 self-attention heads; the input of the conversion layer is serialized text data, and the output is a 768-dimensional feature vector for each Token; the input dimension of the first fully connected layer is 768, the output dimension is 512, and the first connection layer uses ReLU as the activation function; the input dimension of the second fully connected layer is 512, and the output dimension is N, where N is the number of secondary labels. Among them, the first connection layer can further refine the features from BERT and reduce them to a more moderate dimension for fine-grained feature extraction. Using ReLU as an activation function increases nonlinearity. The second connection layer can map the output of the first fully connected layer to the space of entity categories. Without using an activation function, the score of each category is directly output to prepare for the CRF layer. By adding two fully connected layers after the BERT output, the model can adapt to specific NER tasks more flexibly and enhance the model's ability to discriminate entity types.
[0036] Please see here Figure 3 The present application also provides a user comment recognition and classification system, including a labeling unit 300, a training unit 302, and a recognition unit 304. The labeling unit is used to label the first training data set, and the labeled labels include primary labels and secondary labels; the primary labels include: demand concern, pre-purchase decision, and post-purchase feedback, and the secondary labels are secondary classification categories subordinate to the primary labels; the training unit is used to input the labeled first training data set into the first recognition network for training to obtain a trained first recognition network; the recognition unit is used to deploy the first recognition network, input the user comments to be identified into the first recognition network, and the first recognition network outputs the classification results of the user comments belonging to demand concern, pre-purchase decision, or post-purchase feedback. Through the above system, this solution can achieve the technical effect of identifying the classification of user comments by performing a new secondary labeling method on the training set and training the first recognition network to output the classification results of whether the user comments belong to pre-purchase or post-purchase.
[0037] In one embodiment of the present application, the recognition unit is also used to deploy a first recognition network to output the named entities in the user comments that hit the first-level label or the second-level label, and also includes an evaluation report unit, which is used to automatically generate an evaluation report based on the word frequency of the named entities in the user comments that hit the first-level label or the second-level label output by the first recognition network and the classification results of the user comments belonging to demand concerns, pre-purchase decisions or post-purchase feedback.
[0038] A user comment recognition and classification model, the classification model is a custom BERT model, the custom BERT model includes a conversion layer, a first fully connected layer, a second fully connected layer connected in sequence, and a CRF layer, the CRF layer is connected to the second fully connected layer, the CRF layer includes an Adam optimizer, the conversion layer has 12 layers; the hidden layer size of the conversion layer is 12×768, and it is also equipped with 12 self-attention heads; the input of the conversion layer is serialized text data, and the output is a 768-dimensional feature vector for each Token; the input dimension of the first fully connected layer is 768, and the output dimension is 512, and the first connection layer uses ReLU as an activation function; the input dimension of the second fully connected layer is 512, and the output dimension is N, where N is the number of secondary labels.
[0039] Through the above model, this solution can achieve the technical effect of identifying the classification of user comments by performing a new secondary labeling method on the training set and training the first recognition network to output the classification results of whether the user comments belong to pre-purchase or post-purchase.
[0040] It should be noted that, although the above embodiments have been described in this article, the patent protection scope of the present invention is not limited thereby. Therefore, based on the innovative concept of the present invention, changes and modifications made to the embodiments described herein, or equivalent structures or equivalent process changes made using the contents of the present invention specification and drawings, directly or indirectly applying the above technical solutions to other related technical fields, are all included in the patent protection scope of the present invention.
Claims
1. A method for identifying and classifying user comments, characterized in that: The method comprises the following steps: labeling a first training data set, wherein the labeled labels include a primary label and a secondary label; The first-level tags include: demand attention, pre-purchase decision, and post-purchase feedback, and the second-level tags are second-level classification categories subordinate to the first-level tags; Inputting the labeled first training data set into the first recognition network for training to obtain a trained first recognition network; A first recognition network is deployed, and user comments to be recognized are input into the first recognition network, and the first recognition network outputs classification results of whether the user comments belong to demand concerns, pre-purchase decisions, or post-purchase feedback.
2. The user comment recognition and classification method according to claim 1 is characterized in that: The secondary label items of demand focus include: applicable population, user pain points, applicable scenarios, pre-purchase needs, intended products, one or more of the following; the secondary labels subordinate to pre-purchase decisions include: questions, prices, purchase intentions, urging replenishment, purchase motivations, one or more of the following; the secondary labels subordinate to post-purchase feedback include: brand awareness, brand image, user's first purchase, will not repurchase, will repurchase, already purchased, recommendation, experience, functional pain points, service commitments-unmet, purchase channels, usage status, follow-up reviews, and comparisons, one or more of the following.
3. The user comment recognition and classification method according to claim 1, characterized in that: The method also includes a step in which the first recognition network outputs the named entities in the user comments that hit the primary tag or the secondary tag.
4. The user comment recognition and classification method according to claim 3 is characterized in that: The method also includes a step of automatically generating an evaluation report based on the word frequency of the named entities that hit the first-level label or the second-level label in the user comments output by the first recognition network and the classification results of the user comments belonging to demand concerns, pre-purchase decisions or post-purchase feedback.
5. The user comment recognition and classification method according to claim 1, characterized in that: The first recognition network is a custom BERT model, and the custom BERT model includes a conversion layer, a first fully connected layer, and a second fully connected layer connected in sequence.
6. The method for identifying and classifying user comments according to claim 5, characterized in that: The custom BERT model also includes a CRF layer, which is connected to the second fully connected layer, and the CRF layer includes an Adam optimizer.
7. The method for identifying and classifying user comments according to claim 5, characterized in that: The conversion layer has 12 layers; the hidden layer size of the conversion layer is 12×768, and it is also equipped with 12 self-attention heads; the input of the conversion layer is serialized text data, and the output is a 768-dimensional feature vector for each Token; The input dimension of the first fully connected layer is 768, the output dimension is 512, and the first connected layer uses ReLU as the activation function; The input dimension of the second fully connected layer is 512, and the output dimension is N, where N is the number of secondary labels.
8. A user comment recognition and classification system, characterized in that: Including labeling unit, training unit, and recognition unit, The labeling unit is used to label the first training data set, and the labeled labels include primary labels and secondary labels; the primary labels include: demand attention, pre-purchase decision, and post-purchase feedback, and the secondary labels are secondary classification categories subordinate to the primary labels; The training unit is used to input the labeled first training data set into the first recognition network for training to obtain a trained first recognition network; The recognition unit is used to deploy a first recognition network, input the user comments to be recognized into the first recognition network, and the first recognition network outputs a classification result of whether the user comments belong to demand concern, pre-purchase decision or post-purchase feedback.
9. The user comment recognition and classification system according to claim 8, characterized in that: The recognition unit is also used to deploy a first recognition network to output the named entities in the user comments that hit the first-level label or the second-level label, and also includes an evaluation report unit, which is used to automatically generate an evaluation report based on the word frequency of the named entities in the user comments that hit the first-level label or the second-level label output by the first recognition network and the classification results of the user comments belonging to demand concerns, pre-purchase decisions or post-purchase feedback.
10. A user comment recognition and classification model, characterized in that: The classification model is a custom BERT model, which includes a conversion layer, a first fully connected layer, and a second fully connected layer connected in sequence, and also includes a CRF layer, the CRF layer is connected to the second fully connected layer, and the CRF layer includes an Adam optimizer; The conversion layer has 12 layers; the hidden layer size of the conversion layer is 12×768, and it is also equipped with 12 self-attention heads; the input of the conversion layer is serialized text data, and the output is a 768-dimensional feature vector for each Token; The input dimension of the first fully connected layer is 768, the output dimension is 512, and the first connected layer uses ReLU as the activation function; The input dimension of the second fully connected layer is 512, and the output dimension is N, where N is the number of secondary labels.