User comment fine-grained analysis method based on large language model

Through the fine-grained analysis method of user comments based on the large language model, combined with data preprocessing, domain knowledge injection and dynamic tuning prompts, the problem that traditional methods are difficult to achieve fine-grained analysis is solved, and efficient and accurate user comment analysis is achieved.

CN119760140AActive Publication Date: 2025-04-04CHINA AUTOMOTIVE INFORMATION TECH (TIANJIN) CO LTD
View PDF 8 Cites 0 Cited by

Patent Information

Application Number
CN202510272656.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-10
Publication Date
2025-04-04
Estimated Expiration
2045-03-10

AI Technical Summary

Technical Problem

Traditional user comment analysis methods are difficult to achieve fine-grained analysis, and require a large amount of manual annotation training data, which is time-consuming and labor-intensive and difficult to adapt to rapidly changing market demand.

Method used

A fine-grained analysis method of user comments based on a large language model is adopted, and fine-grained analysis of user comments is achieved through data preprocessing, domain knowledge injection, large language model training and dynamic tuning prompts.

Benefits of technology

It realizes the identification and satisfaction analysis of fine-grained objects in user comments, improves the accuracy and efficiency of the analysis, and is suitable for various scenarios where in-depth understanding of user feedback.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119760140A_ABST
    Figure CN119760140A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of semantic understanding, in particular to a user comment fine-grained analysis method based on a large language model. The method comprises the steps of preprocessing comments of a user; matching the comments in professional knowledge in a specific field to obtain target knowledge; training the large language model based on a target task and the dynamic tuning prompt, wherein the target task comprises aspect word extraction and emotion polarity classification; and fusing the comments and the target knowledge, and inputting the fused comments and the target knowledge into the large language model to obtain an analysis result of the comments. According to the method, the comments of the user are subjected to fine-grained analysis by utilizing a large language model and an optimization prompt strategy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of semantic understanding, and in particular to a fine-grained parsing method for user comments based on a large language model. Background Art

[0002] With the rapid development of e-commerce and online services, user review analysis has become an important means to understand customer needs and improve product and service quality. Traditional review analysis methods can only provide coarse-grained sentiment analysis or keyword extraction, which makes it difficult to accurately capture users' evaluations of specific aspects of products or services. In addition, these methods usually require a large amount of manually annotated training data, which is time-consuming and labor-intensive and difficult to adapt to rapidly changing market demands.

[0003] In recent years, large language models have made significant breakthroughs in the field of natural language processing, demonstrating powerful language understanding and generation capabilities. However, how to effectively use these models to improve fine-grained user review analysis while ensuring the accuracy and efficiency of the analysis remains a technical problem that needs to be solved. Summary of the invention

[0004] The purpose of the present invention is to provide a method for fine-grained analysis of user comments based on a large language model, which utilizes a large language model and an optimized prompt strategy to perform fine-grained analysis on user comments.

[0005] In order to achieve the above object, the present invention adopts the following technical solutions: The present invention provides a user comment fine-grained parsing method based on a large language model, comprising: Pre-process user comments; Matching the comments with expertise in a specific field to obtain target knowledge; Training a large language model based on target tasks and dynamic tuning cues, wherein the target tasks include aspect word extraction and sentiment polarity classification; The comment is integrated with the target knowledge and input into the large language model to obtain a parsed result of the comment.

[0006] Compared with the prior art, the present invention has the following beneficial effects: The present invention uses the powerful language understanding ability of the large language model to achieve the recognition of fine-grained objects in user comments and satisfaction analysis. The present invention includes the process of data preprocessing, domain knowledge injection, model training, and fine-grained analysis of the large language model, which can efficiently and accurately analyze user comments and provide valuable customer insights for enterprises. The present invention is particularly suitable for various scenarios that require in-depth understanding of user feedback and has broad application prospects. BRIEF DESCRIPTION OF THE DRAWINGS

[0007] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0008] Figure 1 It is a flowchart of a method for fine-grained analysis of user comments based on a large language model provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0009] The following is a description of exemplary embodiments of the present invention in conjunction with the accompanying drawings, including various details of the embodiments of the present invention to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present invention. Similarly, for clarity and conciseness, the description of well-known functions and structures is omitted in the following description.

[0010] Example 1 The method provided in this embodiment is used to perform fine-grained analysis on user comments to obtain the semantics contained in the comments. The method can be executed by an electronic device. Figure 1 The present invention provides a user comment fine-grained parsing method based on a large language model, comprising: S110: Pre-process the user's comments.

[0011] Perform text cleaning, spelling correction, word segmentation and part-of-speech tagging, and normalization on user comments. Specifically, (1) Text cleaning: Remove HTML (Hyper Text Markup Language) tags: Use the regular expression `<[^>]+>` to match and remove HTML tags. Normalize URLs (Uniform Resource Locator): Replace URLs with the special tag `[URL]`. Process emoticons: Convert emoticons to text descriptions.

[0012] (2) Spelling Correction: Use the edit distance algorithm to detect potential spelling errors. Correct the comments to obtain multiple candidate correction words, calculate the perplexity of the candidate correction words, and select the best correction result.

[0013] (3) Word segmentation and part-of-speech tagging: Use a Transformer-based sequence labeling model for word segmentation and part-of-speech tagging. The structure of the sequence labeling model can be BERT + BiLSTM + CRF. The labeling set uses the Penn Treebank part-of-speech tagging set. Among them, BERT (Bidirectional Encoder Representations from Transformers) is a pre-trained language model based on the Transformer architecture. BiLSTM (Bidirectional LSTM) is a bidirectional long short-term memory network. Through forward and backward propagation, it can simultaneously obtain information in both the front and back directions of the sequence. For some tasks that require comprehensive context information for decision-making, BiLSTM has obvious advantages. The CRF model (Conditional RandomField) is a discriminative probability model that is often used in sequence labeling tasks, such as part-of-speech tagging and named entity recognition in natural language processing.

[0014] (4) Standardized processing: Unify case: convert all text to lowercase. Number processing: unify the number format, such as converting "10,000" to "10000".

[0015] S120, matching the comments with the professional knowledge in a specific field to obtain target knowledge.

[0016] This step is responsible for integrating domain-specific expertise into the large language model. Optionally, first obtain domain-specific expertise. For example, through existing knowledge graphs, or capture automotive expertise from professional websites, forums, and literature. For example, for the smartphone field, general knowledge such as "smartphones have cameras" and "battery capacity affects battery life" can be obtained. In addition to general knowledge, a large amount of domain-specific knowledge is also collected and organized. This knowledge may come from industry reports, professional literature, or summaries by domain experts, including professional information such as product features, technical parameters, and evaluation criteria.

[0017] After acquiring expertise in a specific field, in order to achieve the characterization and accuracy of knowledge injection, the comments are matched in the expertise to obtain the target knowledge according to the semantic similarity matching algorithm. For example, when a user comment is received, the comment content is first analyzed preliminarily to extract the keywords and topics. Then, based on these extracted keywords and topics, the most matching knowledge items (i.e., target knowledge) are retrieved from the pre-acquired expertise based on the semantic similarity matching algorithm to ensure that the selected target knowledge is highly relevant to the comment content. For example, if the user comment mentions the camera function of the mobile phone, the target knowledge related to the camera and image quality will be retrieved first.

[0018] S130, training a large language model based on target tasks and dynamic tuning prompts, where the target tasks include aspect word extraction and sentiment polarity classification.

[0019] Aspect words are words used to describe or describe a specific aspect, field or perspective, such as spatial aspect words, specific technical field aspect words (battery field, body-in-white field, etc.), service features, product features. Sentiment polarity classification is to classify the sentiment polarity of each extracted aspect word, which can be determined according to business needs, such as positive, neutral, and negative.

[0020] The large language model includes but is not limited to the LLaMA model, which can generate text, has the ability to have conversations, provide personalized suggestions, solve problems, and provide support. The main purpose of this step is to train the large language model through unique dynamic prompts, so that the large language model can obtain more accurate and fine-grained parsing results according to the guidance direction of the dynamic prompts.

[0021] This embodiment uses the prompt mode to train the large language model, that is, by inputting the pre-processed comments and prompts into the large language model, the large language model outputs aspect words and sentiment polarity classification. In the process of iteratively training the parameters of the large language model, it is difficult to obtain a satisfactory parsing result at one time. It is necessary to continuously optimize the prompt template and prompt content, that is, dynamically tune the prompt, so that the output of the large language model is closer to the optimal parsing result.

[0022] The core idea of ​​S130 is to guide the model to produce more accurate and relevant outputs by continuously optimizing and adjusting prompts. Dynamic prompt tuning combines task-specific requirements with the real-time characteristics of user comments, allowing the model to continuously adjust and optimize itself during the analysis process.

[0023] S140, the comments are integrated with the target knowledge and input into the large language model to obtain the parsed result of the comments.

[0024] S130 trains the large language model to obtain a usable large language model. S140 mainly uses the large language model to parse the user's comments to obtain aspect words and sentiment polarity classification for the aspect words.

[0025] In order to effectively integrate the comments with the target knowledge, this embodiment designs a variety of knowledge templates to adapt to different types of knowledge and parsing tasks. The knowledge template determines how the knowledge is organized and presented to the model. First, according to the relevance of the target knowledge and the naturalness of the expression, a suitable knowledge template is selected. The semantic similarity between the target knowledge and the comment is calculated, and the semantic similarity is used as the relevance of the target knowledge; the naturalness of the expression can be determined by a rule-based method, such as determining whether the target knowledge has grammatical and syntactic errors / inappropriateness through a grammar checker and a syntactic analyzer. If there are no errors / inappropriateness, the naturalness is 100 points, and the naturalness is obtained by decreasing the score based on 100 points according to the number of errors / inappropriateness. If both the relevance and the naturalness of the expression exceed the set threshold, a template for hierarchical display of key points is selected; otherwise, the knowledge only provides supplementary information, and a simplified template can be selected to ensure the naturalness and clarity of the information presentation. Among them, the template for hierarchical display of key points lists the necessary details of the core knowledge in points, such as definition, cause, and impact, and then retains only the most relevant information, directly explains the relevance of knowledge and comments in combination with the comment content, and uses the shortest sentence or example to show the application scenario. Simplified templates directly describe the core content of knowledge in a single sentence or phrase.

[0026] Then, according to the type of target knowledge, the target knowledge is embedded in the appropriate position of the selected knowledge template. If the type of target knowledge is basic attributes (such as knowledge describing the basic attributes of a product), the target knowledge is embedded in the beginning of the selected knowledge template; if the type of target knowledge is function introduction (such as a detailed description of a specific function), the target knowledge is embedded in the selected knowledge template near the comments. By embedding different types of target knowledge in the appropriate position of the knowledge template, the model can learn the basic attributes first, then the function introduction, so as to progressively learn the knowledge in a specific field and achieve better integration. Finally, the knowledge template is spliced ​​with the comments.

[0027] For example, a knowledge template may look like this: "When analyzing the following reviews, please consider these key information: [Product A] belongs to [Category X], [Product A] has features [Feature Y, Feature Z]. Feature Y has an impact on product performance of [influence]. Now, please analyze the following user reviews to identify the mentioned product features and their sentiment polarity: [User Review]". This knowledge template allows for flexible insertion of different domain knowledge while providing clear analysis guidance for the model.

[0028] This step cleverly integrates domain-specific knowledge into the processing flow of the large language model, enhancing the model's ability to understand user comments in a specific field, thereby improving the accuracy and relevance of the analysis. In addition, this knowledge injection method enables the model to be equipped with the most relevant and valuable domain knowledge when analyzing each comment, which not only improves the model's ability to understand and analyze comments, but also makes the analysis results more accurate and insightful. For example, when analyzing a comment about the battery life of a smartphone, the system may inject expertise about battery capacity and power management technology, allowing the model to more accurately understand and evaluate the user's experience.

[0029] This example successfully combines professional knowledge with the powerful processing capabilities of a large language model, significantly improving the system's performance on fine-grained user review analysis tasks. This method is not only applicable to the smartphone field, but can also be easily extended to other fields, such as car reviews, restaurant reviews, etc., showing strong versatility and potential.

[0030] Example 2 This embodiment optimizes the training process of the large language model based on the above embodiment. Specifically, the large language model is trained based on the target task and the dynamic tuning prompt, including the following four steps.

[0031] Step 1: Build a large language model, training samples, and model training strategy.

[0032] Optionally, LLaMA-7B is selected as the base model. This model is open source, requires relatively low computing resources, and has excellent performance.

[0033] Collect and annotate a small amount of high-quality domain-specific data (about 1,000), including review samples and their corresponding labels: aspect words and sentiment polarity classification. Then, use data augmentation techniques to expand the training set. Data augmentation techniques include but are not limited to: 1) Synonym replacement. 2) Back translation: Back translation through a multilingual translation model to generate synonymous expressions. 3) EDA (Easy Data Augmentation): Randomly insert, delete, and exchange words. EDA is a simple but very effective text data augmentation technique that aims to increase the diversity of text data through a series of operations, thereby improving the performance of text classification tasks.

[0034] Step 2: Build a basic prompt template library.

[0035] The basic prompt template library includes a variety of initial prompt templates. This basic prompt template library contains a variety of initial prompt templates for different types of review analysis tasks. For example, for the product feature recognition task, there may be an initial prompt template like this: "Please identify the product features mentioned in the following user reviews and indicate the evaluation tendency of each feature (positive, negative or neutral)". For the sentiment intensity analysis task, the initial prompt template may be: "Please analyze the sentiment intensity expressed in the following user reviews, using a scale of 1-5, where 1 means very negative and 5 means very positive". These initial prompt templates provide a starting point for subsequent dynamic tuning. Generally speaking, the initial prompt template can be: Analyze the following reviews, extract product features and give the corresponding sentiment polarity (positive / negative / neutral): Comments: [User Comments] Output format: Feature 1: [Emotional Polarity] Feature 2: [Emotional Polarity] Step 3: During the model training process, dynamic tuning is performed based on the initial prompt template to obtain a dynamically tuned prompt template.

[0036] Use LoRA (Low-Rank Adaptation) technology to efficiently fine-tune the parameters of large language models. Optionally, LoRA configuration is as follows: rank: 8, adaptive learning rate: 2e -4 , weight decay: 0.1. Training parameters include: batch size: 32, number of training rounds: 5. The optimizer uses AdamW (Adaptive Moment Estimation), which is an optimizer based on the gradient descent algorithm. Mixed precision training is used to improve training efficiency.

[0037] In this step, when dynamically tuning the initial prompt template, a fusion of multiple strategies is used to improve the parsing accuracy of the model: The first step is to add prompts corresponding to the content features to the initial prompt template during the model training process according to the content features of the comment samples, so as to obtain the first dynamically optimized prompt template.

[0038] For example, a preliminary analysis is performed on the review sample to extract key information, such as the topic, sentiment, and language style used. Based on this key information, the most suitable initial prompt template is selected from the basic prompt template library. The initial prompt template is then dynamically adjusted according to the content characteristics of the review sample. For example, if it is detected that the review sample contains a large number of technical terms, an instruction such as "Please pay special attention to the technical details in the review" will be added to the prompt. If the review sample shows strong emotional color, the prompt will be adjusted to pay more attention to the analysis of emotional intensity.

[0039] The second step is to compare the output of the large language model with the comment sample to determine the comment content ignored in the output, and generate a second dynamic tuning prompt template based on the ignored comment content and the first dynamic tuning prompt template.

[0040] The dynamic tuning strategy for this step is iterative optimization, which compares the initial output of the large language model with the review sample. If it finds that the analysis of some aspects is not sufficient or accurate, it will automatically generate additional prompts. For example, if the large language model ignores an important product feature in the review sample in the first round of analysis, a new prompt will be automatically generated, similar to "Please check the review again, paying special attention to the description of [the ignored review content]". This iterative process can be repeated for multiple rounds until the analysis results reach the expected quality level.

[0041] The third step is to select multiple historical comment samples that are successful in the historical training process; select historical comment samples similar to the comment samples, and historical dynamic tuning prompt templates corresponding to the historical comment samples; select and combine the historical dynamic tuning prompt templates, and combine them with the second dynamic tuning prompt template to generate a third dynamic tuning prompt template.

[0042] In order to further improve the effect of the prompt, this step also introduces a context-aware mechanism. The historical training process is the process of parsing historical comment samples. This embodiment retains similar comments that have been parsed before and their successful prompt patterns. When encountering new comments, these historical comment samples will be referenced. By comparing the similarity of the comment content, historical comment samples that are semantically similar to the current comment sample and the historical dynamically tuned prompt template corresponding to the historical comment sample are determined. This template is considered to be a successful template. Select and combine effective prompt elements from the successful template, such as prompts for emotions of special concern, key prompts for a certain feature of the product, etc. This method can use accumulated experience to continuously optimize the prompt strategy.

[0043] Step 4: During the model training process, the effect of the third dynamic tuning prompt template after each iteration is evaluated; and the third dynamic tuning prompt template that passes the evaluation is strengthened.

[0044] This step implements reinforcement learning of the prompt template through a self-learning component. This step continuously monitors the parsing effect of different dynamically tuned prompt templates, including indicators such as the accuracy of model parsing and the relevance of parsed content to comment content. Dynamically tuned prompt templates with better performance will be strengthened, while those with poor performance will be adjusted or eliminated. This process uses a lightweight reinforcement learning algorithm that can continuously improve the performance of the training model without requiring a large amount of additional training data.

[0045] Step 5: Continue training the large language model according to the dynamic tuning prompt template.

[0046] Each time the dynamic tuning prompt template is adjusted, it will be injected into the large language model for further analysis, guiding the large language model to obtain accurate analysis results and complete the model training process.

[0047] Dynamic prompt tuning significantly improves the model's performance in a variety of complex review scenarios. For example, when processing long reviews that include multiple product comparisons, dynamically tuned prompts can guide the large language model to more systematically analyze the pros and cons of each product and make a more balanced and comprehensive evaluation. When analyzing highly specialized reviews, such as detailed product reviews in technical blogs, tuned prompts can help the model more accurately capture and interpret professional terms and technical details.

[0048] In general, dynamically tuning the prompt template opens up new possibilities for the application of large language models in fine-grained user review analysis tasks. It enables the model to adapt to different types of reviews and analysis needs more flexibly and accurately, greatly improving the overall performance and applicability. This approach not only improves the accuracy of the analysis, but also enhances the interpretability and controllability, providing enterprises with more valuable and reliable user feedback insights.

[0049] Example 3 Based on the above embodiment, this embodiment optimizes the use process of the trained large language model, including the injected domain knowledge and dynamic tuning prompts, to conduct in-depth and detailed analysis of user comments, maximize the reasoning ability of the large language model, and ensure the accuracy and interpretability of the analysis results. Specifically, the comments are fused with the target knowledge and input into the large language model to obtain the parsing results of the comments, including the following two steps: Step 1: Perform similarity matching on the comments in the comment samples, determine similar comment samples and dynamically tuned prompt templates corresponding to the similar comment samples.

[0050] The preprocessed comments are matched among multiple comment samples using a semantic similarity matching algorithm to determine semantically similar comment samples. In the previous training process, the semantically similar comment samples have a dynamic tuning prompt template used for training, which combines easily overlooked comment content, successful historical dynamic tuning prompt templates, and comment content features. When parsing new comments in this step, the dynamic tuning prompt template can still be used.

[0051] Step 2: Fuse the dynamically tuned prompt template, the comments and the target knowledge, and input them into the large language model to obtain the parsing result of the comments.

[0052] First, the preprocessed comments, target knowledge, and dynamically tuned prompt templates (including prompt content) are integrated. Together, these pieces of information form the input basis for the large language model. These elements are automatically and cleverly combined into a structured input, for example: "Based on the following domain knowledge: [injected relevant knowledge], please analyze this user comment: [preprocessed comment text]. Pay special attention to [dynamically tuned prompt template: points emphasized in the dynamic prompt]".

[0053] Next, a multi-stage parsing process is initiated. The first is the aspect word extraction stage. In this stage, the big language model no longer uses the traditional named entity recognition method alone, but uses the semantic understanding ability of the big language model combined with the injected target knowledge to identify the product or service features mentioned in the review. The big language model lists all relevant aspects mentioned in the review and provides the location and context of each aspect in the original text. This approach is able to capture more subtle and implicit aspect expressions.

[0054] This is followed by the sentiment polarity classification stage. This embodiment generates a dedicated prompt for each identified aspect word. These prompts incorporate previously injected target knowledge and dynamic tuning prompts. For example, for the camera performance of a smartphone, the prompt may be: "Considering the development trend of modern smartphone camera technology and the points of general concern of users, please analyze the emotional tendencies expressed in the descriptions of 'camera' in the reviews. Please consider aspects such as clarity, low-light performance, zoom capability, and give positive, negative, or neutral judgments, and provide brief reasons." This context-rich prompt can guide the model to perform a more detailed and professional analysis.

[0055] In some embodiments, the parsing results of the comments are evaluated for detail and confidence; the detail evaluation can be judged from the completeness of the aspect word extraction, the coverage of the sentiment polarity classification, and whether the parsing instructions are sufficient; the confidence evaluation can be quantified based on the probability output of the model for the sentiment analysis of the various aspects of the words or the confidence score provided. When the confidence is lower than the preset threshold, the iterative parsing can be triggered by prompting again or supplementing the domain knowledge to ensure that the results are more reliable. If the detail evaluation or the confidence evaluation fails, new prompt content is generated according to the defects of the parsing results; the new prompt content is input into the large language model to obtain a new parsing result; the step of performing detail evaluation and confidence evaluation on the parsing results of the comments is returned until the parsing results pass the detail evaluation and confidence evaluation. This iterative parsing method will automatically generate follow-up prompts when the initial analysis results of the model are not detailed enough or the confidence is not high, requiring the model to conduct a more in-depth analysis or clarify a specific point of view. For example, if the parsing of a certain aspect word is not in-depth enough, please conduct an in-depth analysis in combination with the domain knowledge of the aspect word. This process may be repeated multiple times until a satisfactory result is obtained or a preset iteration limit is reached.

[0056] In some embodiments, if a detailed and high-confidence parsing result cannot be obtained even after the aforementioned iterative parsing method, the first result is obtained by understanding the context of the comment; the second result is obtained by identifying the tone of the comment; the third result is obtained by identifying the association between aspect words in the comment; the first result, the second result, and the third result are used to generate new prompt content. Then, the new prompt content is input into the large language model to obtain a new parsing result; the step of performing detail evaluation and confidence evaluation on the parsing result of the comment is returned until the parsing result passes the detail evaluation and confidence evaluation.

[0057] When a comment has multiple sentences, a natural language model can be used to learn the contextual meaning between sentences to obtain the first result. For example, if a user expresses dissatisfaction with a certain aspect at the beginning of the comment, but gives a positive overall evaluation in the summary, the reason behind this seemingly contradictory emotional expression will be understood, which is conducive to improving the confidence of the large language model. Tone recognition is an important aspect of natural language understanding. It involves accurate judgment of the tone in a sentence or speech to understand the true intention and emotion of the comment. By adding tone to the prompt, it is easier to get accurate sentiment polarity classification. The correlation between aspect words includes causal relationship, parallel relationship, opposition relationship, etc. Adding the correlation relationship to the prompt can enable the large language model to more accurately identify the semantics of the comment.

[0058] This embodiment concatenates the first result, the second result, and the third result to generate new prompt content, and injects the new prompt content into the large language model, so that the large language model can obtain more accurate analysis results based on context understanding, tone, and the relationship between aspect words.

[0059] In some embodiments, the consistency of the parsing results with the injected target knowledge, the clarity of the user's comments, and the self-correction or hesitation of the large language model during the analysis process can also be considered, and the analysis can be automatically performed again. For example, for parsing results with low confidence, when it is believed that the comment part has a clear tendency of the parsing results, or the output of the large language model has hesitation or erroneous content, a pre-written explanation template will be called, and the "uncertainty" of the parsing results will be marked in the explanation template, and the following content will be added to the explanation template: "Contents that are inconsistent with the injected target knowledge, unclear user comments, and self-correction or hesitation of the large language model" are unreliable, and the large language model will be automatically prompted to perform further analysis on these unreliable contents.

[0060] Finally, this embodiment generates a comprehensive report that includes not only each identified aspect word and its sentiment polarity, but also provides an overall sentiment analysis summary, indicating the main points of the user's comments, the main reasons for the sentiment tendency, and possible contradictions or special expressions. This report is output in a structured format to facilitate subsequent data analysis and visualization.

[0061] In this way, a deep understanding and refined analysis of user comments is achieved. It fully leverages domain knowledge and optimization tips to enable large language models to perform more accurate, comprehensive, and insightful analysis. This not only improves the quality of the analysis, but also enhances the interpretability and practicality of the results, providing companies with valuable insights into user feedback.

[0062] The following is a specific embodiment provided by the embodiment of the present invention: Taking the smartphone product reviews on a certain e-commerce platform as an example, the specific application process of the present invention is demonstrated: 1. After preprocessing the user's comments, the following content is obtained: The camera on this phone is great, and the photos are super clear! However, the battery life is a little bit poor, and the charging speed is not fast enough. Overall, it is still a good choice.

[0063] 2. Obtain target knowledge based on comments. Example of injected target knowledge: Smartphones have features: camera, battery, processor, screen Camera-related attributes: clarity, night view, zoom Battery-related attributes: battery life, charging speed 3. Train the large language model: Use 5,000 annotated smartphone review data to fine-tune the parameters of the LLaMA model and the dynamic tuning prompt template.

[0064] 4. Use a large language model for fine-grained analysis. The large language model outputs aspect words and sentiment polarity, and finally gives a summary: json { "aspects": [ { "term": "camera", "sentiment": "positive", "confidence": 0.95, "evidence": "Great, the photos are very clear" }, { "term": "Battery life", "sentiment": "negative", "confidence": 0.85, "evidence": "a little bit worse" }, { "term": "Charging speed", "sentiment": "negative", "confidence": 0.80, "evidence": "Not fast enough }, { "term": "Overall Rating", "sentiment": "positive", "confidence": 0.75, "evidence": "Overall, it is a very good choice", Summary: This user is very satisfied with the camera function of the phone, especially the clarity of the photos. However, the battery performance is a pain point, including the battery life and charging speed are not satisfactory. Despite this, the user still gave a positive overall evaluation and believed that this phone is a good choice.

[0065] }] } The present invention has the following technical effects: 1. High-precision analysis: By leveraging the powerful language understanding capabilities of large language models, it is able to accurately identify fine-grained review objects and perform sentiment analysis, providing in-depth customer insights.

[0066] 2. Strong domain adaptability: Through domain knowledge injection and targeted fine-tuning, it can quickly adapt to the specific needs of different industries without the need for a large amount of domain labeled data.

[0067] 3. Low resource requirements: The use of parameter-efficient fine-tuning techniques (such as LoRA) greatly reduces the computing resource requirements, making high-quality review analysis services affordable for small and medium-sized enterprises.

[0068] 4. Dynamic adaptability: Through dynamic prompt generation and knowledge injection, it can flexibly respond to different types of reviews and changing market trends.

[0069] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution disclosed in the present invention can be achieved, and this document does not limit this.

[0070] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims

1. A fine-grained parsing method for user comments based on a large language model, characterized in that: include: Pre-process user comments; Matching the comments with expertise in a specific field to obtain target knowledge; Training a large language model based on target tasks and dynamic tuning cues, wherein the target tasks include aspect word extraction and sentiment polarity classification; The comment is integrated with the target knowledge and input into the large language model to obtain a parsed result of the comment.

2. The method for fine-grained parsing of user comments based on a large language model according to claim 1 is characterized in that: Preprocessing of user comments includes: Perform text cleaning, spelling correction, word segmentation and part-of-speech tagging, and normalization on user comments.

3. The method for fine-grained parsing of user comments based on a large language model according to claim 1 is characterized in that: Match the comments with the expertise in a specific field to obtain target knowledge, including: Acquire expertise in a specific area; According to a semantic similarity matching algorithm, the comments are matched with the professional knowledge to obtain target knowledge; The review is integrated with the target knowledge, including: Selecting an appropriate knowledge template according to the relevance of the target knowledge and the naturalness of its expression; According to the type of target knowledge, embedding the target knowledge into a suitable position of the selected knowledge template; The knowledge template is concatenated with the comment.

4. The method for fine-grained analysis of user comments based on a large language model according to claim 3 is characterized in that: According to the relevance of the target knowledge and the naturalness of expression, select the appropriate knowledge template, including: Calculating the semantic similarity between the target knowledge and the comment, and using the semantic similarity as the relevance of the target knowledge; If both the relevance and the naturalness of the expression exceed the set threshold, a template that displays the key points in a hierarchical manner is selected; otherwise, a simplified template is selected.

5. The method for fine-grained analysis of user comments based on a large language model according to claim 4 is characterized in that: According to the type of target knowledge, the target knowledge is embedded into the appropriate position of the selected knowledge template, including: If the type of the target knowledge is basic attribute, embedding the target knowledge into the beginning of the selected knowledge template; If the type of the target knowledge is function introduction, the target knowledge is embedded into the selected knowledge template at a position close to the comment.

6. The method for fine-grained analysis of user comments based on a large language model according to claim 1, characterized in that: Train large language models based on target tasks and dynamic tuning cues, including: Build large language models, training samples, and model training strategies; Building a basic prompt template library, wherein the basic prompt template library includes a plurality of initial prompt templates; During the model training process, dynamic tuning is performed on the basis of the initial prompt template to obtain a dynamically tuned prompt template; The large language model continues to be trained according to the dynamic tuning prompt template.

7. The method for fine-grained analysis of user comments based on a large language model according to claim 6 is characterized in that: During the model training process, dynamic tuning is performed on the basis of the initial prompt template to obtain a dynamically tuned prompt template, including: During the model training process, according to the content features of the review sample, a prompt corresponding to the content features is added to the initial prompt template to obtain a first dynamically optimized prompt template; Comparing the output of the large language model with the comment sample, determining the comment content ignored in the output, and generating a second dynamic tuning prompt template according to the ignored comment content and the first dynamic tuning prompt template; Select multiple historical review samples that are successful in the historical training process; select historical review samples similar to the review samples, and historical dynamic tuning prompt templates corresponding to the historical review samples; select and combine the historical dynamic tuning prompt templates, and combine them with the second dynamic tuning prompt template to generate a third dynamic tuning prompt template; During the model training process, the effect of the third dynamic tuning prompt template after each iteration is evaluated; and the third dynamic tuning prompt template that passes the evaluation is strengthened.

8. The method for fine-grained analysis of user comments based on a large language model according to claim 7 is characterized in that: The comment is integrated with the target knowledge and input into the large language model to obtain the parsing result of the comment, including: Performing similarity matching on the comments in the comment samples, determining similar comment samples and dynamic tuning prompt templates corresponding to the similar comment samples; The dynamic tuning prompt template, the comment and the target knowledge are integrated and input into the large language model to obtain the parsing result of the comment.

9. The method for fine-grained analysis of user comments based on a large language model according to claim 8, characterized in that: The dynamic tuning prompt template, the comment and the target knowledge are integrated and input into the large language model to obtain the parsing result of the comment, including: Performing detail evaluation and confidence evaluation on the parsing results of the comments; If the detail evaluation or confidence evaluation fails, new prompt content is generated according to the defects of the analysis results; Inputting the new prompt content into the large language model to obtain a new parsing result; Return to the step of performing detail evaluation and confidence evaluation on the parsed result of the comment, until the parsed result passes the detail evaluation and confidence evaluation.

10. The method for fine-grained analysis of user comments based on a large language model according to claim 9, characterized in that: After the detailed evaluation and confidence evaluation of the parsed results of the comments, the following are also included: If the detail evaluation or the confidence evaluation fails, the context of the comment is understood to obtain a first result; the tone of voice is recognized to obtain a second result; the association relationship between aspect words of the comment is recognized to obtain a third result; The first result, the second result and the third result are used to generate new prompt content.

Citation Information

Patent Citations

  • Aspect-level sentiment polarity classification method based on fused linguistic knowledge

    CN114764564A

  • Heterogeneous graph convolution-based multi-modal comment sentiment analysis method and system

    CN116258147A

  • Emotion analysis method and device and big language model training method and device

    CN117436438A

  • Problem generation method and system based on large language model, electronic equipment and medium

    CN118468034A

  • Service combination method based on large language model

    CN118709784A