Intelligent public opinion report generation method and device

The public opinion large language model generated by parallel coupled multiple fine-tuning training, combined with AdaLoRA and HydraLoRA methods for knowledge fine-tuning and instruction alignment training, solves the problem of low public opinion reporting quality caused by splitting knowledge fine-tuning and instruction alignment in the existing technology, and achieves higher accuracy and consistency.

CN120124601AInactive Publication Date: 2025-06-10RENMIN ZHONGKE (JINAN) INTELLIGENT TECH CO LTD

Patent Information

Application Number
CN202510618963.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-14
Publication Date
2025-06-10
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

When the prior art applies the general large language model to the automatic generation of public opinion reports, the quality of the generated public opinion reports is not high, and there are problems such as hallucination and loss of command following ability.

Method used

The public opinion large language model is generated through parallel coupled multiple fine-tuning training, and knowledge fine-tuning and instruction alignment training is carried out in combination with AdaLoRA and HydraLoRA methods to ensure that the instruction following ability is retained during the knowledge injection process, and the inference efficiency is improved through batch instruction optimization.

Benefits of technology

It effectively avoids the problem of hallucination phenomena and loss of instruction following ability, improves the accuracy and consistency of public opinion reports, and ensures that the generated reports can truly reflect the current public opinion situation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120124601A_ABST
    Figure CN120124601A_ABST
Patent Text Reader

Abstract

The invention belongs to the technical field of Internet information processing, and particularly relates to an intelligent generation method and device of a public opinion report. The method comprises the following steps: acquiring all-around public opinion data about a specific theme or event, and preprocessing to form a public opinion file of the theme or event; the public opinion file is input into a public opinion big language model, a public opinion report for the theme or the event is output, and the public opinion big language model is generated by a general big language model through a plurality of parallel-coupled fine tuning trainings; the fine tuning training at least comprises knowledge fine tuning training in the public opinion field and instruction alignment training generated for a public opinion report; and performing data accuracy verification and semantic consistency verification on the public opinion report, and taking the public opinion report passing the verification as a finally generated public opinion report. According to the method, the hallucination phenomenon of applying a large language model to the field of public opinion report generation is reduced or even avoided.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of Internet information processing technology, and specifically relates to a method and device for intelligently generating a public opinion report. Background Art

[0002] In traditional public opinion analysis, public opinion reports, as an important means of reflecting public opinions and social dynamics, have always occupied an irreplaceable position. However, the preparation process of traditional public opinion reports is highly dependent on manual operations, which is not only inefficient, but also easily affected by personal cognitive biases, making it difficult to ensure the comprehensiveness and objectivity of information processing.

[0003] The development of deep learning, especially large pre-trained models (such as various variants under the Transformer architecture), has made it possible to automatically generate public opinion reports. With its excellent text understanding and generation capabilities, this type of large language model can effectively process unstructured data from multiple channels. It can not only capture the explicit opinions in news reports and social media posts, but also deeply analyze the subtle differences such as metaphors and emotional tendencies hidden behind them. When a general language model is applied to the generation of public opinion reports, hallucinations will occur due to unfamiliarity with public opinion field data, which will seriously affect the quality of public opinion reports generated based on the general language model. The current solution based on large language models mainly alleviates the hallucination problem through domain knowledge fine-tuning and instruction alignment: domain knowledge fine-tuning uses full parameter fine-tuning (FullFine-tuning) or standard LoRA method to adapt the general model to the public opinion field data (also known as knowledge injection). Instruction alignment training often uses supervised fine-tuning (SFT) for instruction adaptation.

[0004] However, in the existing scheme, knowledge fine-tuning and instruction alignment are two independent optimization processes in two stages, which may lead to the loss of instruction following ability during knowledge injection (such as the "catastrophic forgetting" phenomenon) and lack of domain knowledge calibration during instruction optimization, exacerbating the risk of hallucination (such as confusing similar policy names). Summary of the invention

[0005] The disclosed embodiment proposes an intelligent generation scheme for public opinion reports based on a large language model to overcome the problem that the quality of the generated public opinion reports is low due to the separation of knowledge fine-tuning and instruction alignment when the general large language model is currently applied to the field of automatic generation of public opinion reports.

[0006] A first aspect of an embodiment of the present disclosure provides an intelligent generation method of a public opinion report, comprising:

[0007] Obtain all-round public opinion data on a specific topic or event, and form a public opinion file on the topic or event after preprocessing;

[0008] Input the public opinion file into a public opinion large language model to output a public opinion report for the theme or event. Among them, the public opinion large language model is generated by a general large language model through multiple fine-tuning trainings in parallel coupling, and the fine-tuning training at least includes knowledge fine-tuning training in the public opinion field and instruction alignment training for public opinion report generation;

[0009] Verify the data accuracy and semantic consistency of the public opinion report, and use the verified public opinion report as the finally generated public opinion report.

[0010] In some embodiments of the present disclosure, the obtaining of all-round public opinion data on a specific theme or event includes:

[0011] Determine the theme or event to be monitored, and through the API interface or web crawler technology, grab the latest public opinion information related to the theme or event from multiple online platforms at preset time intervals. Among them, the online platforms include but are not limited to news portals, social networks, professional forums, and blogs.

[0012] In some embodiments of the present disclosure, the preprocessing to form the public opinion file of the theme or event includes:

[0013] Remove the noise data and outliers in the public opinion data;

[0014] Unify the data format of the public opinion data after removing the noise data and outliers, and store it in a database in a structured manner to form the public opinion file of the theme or event.

[0015] In some embodiments of the present disclosure, the generation of the public opinion large language model by a general large language model through multiple fine-tuning trainings in parallel coupling includes:

[0016] Keep the original weights of the general large model unchanged, establish a first branch network, and through knowledge fine-tuning training in the public opinion field, obtain the first weight update amount of the first branch network;

[0017] Keep the original weights of the general large model and the first weight update amount unchanged, establish a second branch network, and through instruction alignment training for public opinion report generation, obtain the second weight update amount of the second branch network;

[0018] Superimpose the first weight update amount and the second weight update amount on the original weights to form the weights of the public opinion large language model. The formula is , where:

[0019] are the weights of the public opinion large language model, are the original weights of the general large model, The first weight update amount is obtained through fine-tuning training of public opinion domain knowledge. The second weight update amount is obtained through instruction alignment training for public opinion report generation.

[0020] In some embodiments of the present disclosure, establishing the first side branch network and obtaining the first weight update amount of the first side branch network through fine-tuning training of public opinion domain knowledge includes:

[0021] Randomly sample without replacement from the public opinion archives and then intercept any segment of public opinion text as input, and use the shifted text data containing the next token as output to construct an input-output text pair as the first dataset for the large language model to fine-tune and train on public opinion domain knowledge.

[0022] Keep the original weights of the general large model unchanged, establish a first side branch network suitable for AdaLoRA fine-tuning training, and train the first side branch network using the AdaLoRA-based fine-tuning training method based on the first dataset to obtain the first weight update amount of the first side branch network.

[0023] In some embodiments of the present disclosure, establishing the second side branch network and obtaining the second weight update amount of the second side branch network through instruction alignment training for public opinion report generation includes:

[0024] Obtain historical public opinion data and the historical public opinion reports written therefrom, and construct a second dataset for instruction alignment training. Each piece of training data in the second dataset includes an instruction, an input, and an output. Among them, the instruction is the specific task required to generate a public opinion analysis report, the input is the current public opinion situation obtained from historical public opinion data, and the output is the content of the public opinion analysis report written by professionals for the instruction and the current public opinion situation.

[0025] Keep the original weights of the general large model and the first weight update amount unchanged, establish a second side branch network suitable for HydraLoRA fine-tuning training, and train the second side branch network using the HydraLoRA-based fine-tuning training method based on the second dataset to obtain the second weight update amount of the second side branch network.

[0026] In some embodiments of the present disclosure, HydraLoRA can dynamically adjust weight updates. Training the second side branch network using the HydraLoRA-based fine-tuning training method based on the second dataset includes:

[0027] Use the mean of all training samples in the second dataset as the parameter of the second weight update amount to decouple the relationship between the second weight update amount and the input parameters.

[0028] In some embodiments of the present disclosure, the verification of the data accuracy of the public opinion report includes:

[0029] Extracting public opinion data from the public opinion report based on regular expressions;

[0030] Scoring the public opinion data based on preset rules, where the preset rules at least include: if the public opinion data appears in both the public opinion report and the public opinion file data, then give the public opinion data a score higher than the first preset value; if the public opinion data only appears in the public opinion report but does not appear in the public opinion file, then give the public opinion data a score higher than the second preset value but lower than the first preset value; if the public opinion data does not appear in the public opinion report but appears in the public opinion file, then give the public opinion data a score of zero, where ;

[0031] Summarize the total scores of all the public opinion data. If the total score is lower than the first preset threshold, then mark that there are large errors in the public opinion report.

[0032] In some embodiments of the present disclosure, the verification of the semantic consistency of the public opinion report includes:

[0033] Segment the public opinion report by sentences, extract the semantic vectors of each sentence, and form a first semantic vector set;

[0034] Extract the semantic vectors of each piece of text in the public opinion file to form a second semantic vector set;

[0035] Take the average value of the maximum similarity between the first semantic vector set and the second semantic vector set as the semantic consistency score. If the semantic consistency score is lower than the second preset threshold, then mark that there are errors in the public opinion report.

[0036] The second aspect of the embodiments of the present disclosure provides an intelligent generation device for a public opinion report, including:

[0037] An acquisition module, configured to acquire all-round public opinion data on a specific topic or event, and form a public opinion file for the topic or event after preprocessing;

[0038] An inference module, configured to input the public opinion file into a public opinion large language model, and output a public opinion report for the topic or event, where the public opinion large language model is generated by a general large language model through multiple fine-tuning trainings in parallel coupling, and the fine-tuning trainings at least include knowledge fine-tuning training in the public opinion field and instruction alignment training for public opinion report generation;

[0039] A verification module is used to verify the data accuracy and semantic consistency of the public opinion report, and take the verified public opinion report as the finally generated public opinion report.

[0040] In summary, the intelligent generation methods and devices for public opinion reports provided by the various embodiments of the present disclosure avoid various problems in the prior art caused by the separation of knowledge fine-tuning and instruction alignment through a coupled training process based on knowledge fine-tuning and instruction alignment. In particular, during knowledge fine-tuning, the rank adaptation mechanism of AdaLoRA avoids the overfitting risk caused by low parameter efficiency during full-parameter fine-tuning in the prior art or the problem of insufficient knowledge coverage caused by the difficulty of capturing multi-level semantics unique to the public opinion field with a fixed-rank adapter when using standard LoRA. During instruction alignment, batch instruction optimization is achieved based on the improved HydraLoRA using the mean approximation method, avoiding the inference efficiency bottleneck caused by the SFT calculating gradients for each input sample separately. Finally, the present disclosure further avoids possible hallucinations by verifying the generated public opinion report based on data accuracy and semantic consistency. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] The features and advantages of the present disclosure will be more clearly understood by referring to the accompanying drawings. The drawings are schematic and should not be construed as imposing any limitation on the present disclosure. In the drawings:

[0042] Figure 1 is the intelligent generation framework of the public opinion report shown in the present disclosure;

[0043] Figure 2 is a flowchart of an intelligent generation method for a public opinion report according to some embodiments of the present disclosure;

[0044] Figure 3 is a schematic diagram of an intelligent generation device for a public opinion report according to some embodiments of the present disclosure;

[0045] Figure 4 is a schematic diagram of an intelligent generation device for a public opinion report according to some embodiments of the present disclosure. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0046] In the following detailed description, many specific details of the present disclosure are set forth by way of example in order to provide a thorough understanding of the relevant disclosure. However, it will be apparent to those of ordinary skill in the art that the present disclosure can be practiced without these details. It should be understood that the terms "system", "device", "unit" and / or "module" used in the present disclosure are a way to distinguish different components, elements, parts or assemblies at different levels in a sequential arrangement. However, if other expressions can achieve the same purpose, these terms can be replaced by other expressions.

[0047] It should be understood that when a device, unit or module is referred to as being "on", "connected to" or "coupled to" another device, unit or module, it can be directly on the other device, unit or module, connected or coupled to or communicating with the other device, unit or module, or there may be intermediate devices, units or modules, unless the context clearly indicates an exception. For example, the term "and / or" as used in the present disclosure includes any and all combinations of one or more of the related listed items.

[0048] The terms used in the present disclosure are only for the purpose of describing specific embodiments and are not intended to limit the scope of the present disclosure. As shown in the specification and claims of the present disclosure, unless the context clearly indicates an exception, words such as "a", "an", "one" and / or "the" are not specifically singular and may also include the plural. Generally speaking, the terms "comprising" and "including" only indicate the inclusion of the expressly identified features, wholes, steps, operations, elements and / or components, and such expressions do not constitute an exclusive listing, and other features, wholes, steps, operations, elements and / or components may also be included.

[0049] Referring to the following description and the accompanying drawings, these or other features and characteristics of the present disclosure, the operating methods, the functions of the relevant elements of the structure, the combination of the parts, and the economy of manufacture can be better understood, wherein the description and the drawings form a part of the specification. However, it should be clearly understood that the drawings are only for the purpose of illustration and description and are not intended to limit the scope of protection of the present disclosure. It is understood that the drawings are not drawn to scale.

[0050] A variety of structure diagrams are used in the present disclosure to illustrate various variations according to the embodiments of the present disclosure. It should be understood that the structures before or below are not used to limit the present disclosure. The scope of protection of the present disclosure is subject to the claims.

[0051] With the rapid development of information technology, especially the continuous progress of Internet, big data and artificial intelligence technologies, the way of information dissemination in modern society has undergone profound changes. The rapid generation and diffusion of information in cyberspace have put forward higher requirements for public opinion monitoring. How to efficiently and accurately analyze public sentiment and grasp the trend of social public opinion has become one of the urgent problems to be solved at present. Implementing the automated processing and in-depth analysis of public opinion information through intelligent algorithms, and identifying potential risks and providing decision-making support with the help of Natural Language Processing (NLP) technology are of great significance for maintaining social stability and promoting the modernization of public governance.

[0052] In traditional public opinion analysis, public opinion reports, as an important means of reflecting public opinion and social dynamics, have always occupied an irreplaceable position. However, the preparation process of traditional public opinion reports is highly dependent on manual operations, which is not only inefficient, but also easily affected by personal cognitive biases, making it difficult to ensure the comprehensiveness and objectivity of information processing. In the past, organizations often used basic data collection tools to assist in public opinion monitoring, but these methods can often only provide superficial data summaries, lack deep insights and guiding value, and cannot meet the needs of accurate public opinion analysis in today's complex and changing social environment. Specifically, the production of traditional public opinion reports faces the following challenges:

[0053] 1. High resource consumption: Screening valuable content from massive information sources and conducting comprehensive analysis is a time-consuming and laborious task.

[0054] 2. Interference from subjective factors: Due to the high level of human involvement, the report is easily influenced by the analyst’s personal views, affecting its fairness and accuracy.

[0055] 3. Narrow coverage: Due to limited human and technical conditions, it is difficult to cover all relevant topics and audience groups, resulting in blind spots in public opinion monitoring.

[0056] 4. Poor timeliness: Regularly released public opinion reports are difficult to track emergencies and their subsequent impacts in real time, and there is a serious lag.

[0057] 5. Lack of personalized services: General template reports make it difficult to provide customized solutions for the specific needs of different customers.

[0058] In recent years, with the development of deep learning, especially large pre-trained models (such as various variants under the Transformer architecture), new possibilities have been provided for the automatic generation of public opinion reports. With excellent text understanding and generation capabilities, such models can effectively process unstructured data from multiple channels, not only capturing the explicit opinions in news reports and social media posts, but also deeply analyzing the metaphors, emotional tendencies and other nuances hidden behind them. This marks the transition of public opinion analysis from simple keyword matching to a more intelligent era of emotional computing.

[0059] Nevertheless, when faced with specific fields such as the generation of public opinion reports, existing general language models will produce hallucinations due to unfamiliarity with public opinion data, which seriously affects the quality of public opinion reports generated based on general language models. In order to reduce or even avoid hallucinations, it is necessary to fine-tune the large language model through proprietary data sets in the field to enhance professional adaptability.

[0060] Current large language model-based solutions mainly alleviate the hallucination problem through domain knowledge fine-tuning and instruction alignment. Among them, domain knowledge fine-tuning adopts full-parameter fine-tuning (FullFine-tuning) or the standard LoRA method to adapt the general model to the data in the public opinion field (also known as knowledge injection). Instruction alignment mostly adopts supervised fine-tuning (SFT).

[0061] However, in the current solutions, knowledge fine-tuning and instruction alignment are two separate optimization processes in different stages, resulting in the possible loss of instruction-following ability (such as the "catastrophic forgetting" phenomenon) during the knowledge injection process and the lack of domain knowledge calibration during instruction optimization, exacerbating the hallucination risk (such as confusing similar policy names). At the same time, in the domain knowledge fine-tuning stage, if full-parameter fine-tuning is adopted, all model parameters will be modified, which may lead to the risk of overfitting when public opinion data is sparse; if the standard LoRA scheme is adopted, the fixed-rank adapters used in the standard LoRA are difficult to capture the multi-level semantics unique to the public opinion field (such as policy terms, regional expressions, etc.). The SFT in the instruction alignment stage needs to calculate gradients for each input sample separately and cannot achieve batch optimization, thus there is an inference efficiency bottleneck.

[0062] To solve the above problems, the present disclosure proposes an intelligent generation scheme for public opinion reports based on large language models. By inputting public opinion data on a specific topic into a public opinion large language model, a public opinion report is automatically output, where the public opinion large language model is generated by fine-tuning and training a general large language model through multiple parallel couplings. The intelligent generation framework of the public opinion report shown in the present disclosure is as Figure 1 shown. In some embodiments, the flowchart of the intelligent generation method of the public opinion report is as Figure 2 shown, specifically including the following steps:

[0063] S210 Obtain comprehensive public opinion data on a specific topic or event, and form a public opinion file of the topic or event after preprocessing.

[0064] Some embodiments of the present disclosure adopt web crawler technology to crawl public opinion information related to a specific topic or event from various online platforms (including news websites, social media, blogs, forums, etc.), construct a comprehensive public opinion information database; then apply advanced data cleaning and preprocessing technologies to remove noise data and outliers, unify the data format, and store the relevant information in the database in a structured manner to form a detailed public opinion file for each event or topic.

[0065] Some other embodiments of the present disclosure further include further mining potential patterns and trends in the data through methods such as time series analysis to lay a foundation for subsequent analysis.

[0066] S220. Input the public opinion file into the public opinion large language model, and output a public opinion report for the theme or event. Among them, the public opinion large language model is generated by a general large language model through multiple fine-tuning trainings in parallel coupling. The fine-tuning training at least includes knowledge fine-tuning training in the public opinion field and instruction alignment training for public opinion report generation.

[0067] This disclosure automatically generates a public opinion report for a specific theme or event by using a public opinion large language model based on a public opinion file.

[0068] The public opinion large language model of this disclosure is generated by a general large language model through multiple fine-tuning trainings in parallel coupling:

[0069] Among them, the knowledge fine-tuning training in the public opinion field is carried out based on the AdaLoRA method. Specifically:

[0070] First, construct a first training dataset for knowledge fine-tuning training:

[0071] Randomly sample without replacement from the public opinion file and then intercept any section of public opinion text as input, and use the shifted text data containing the next token as output to construct an input-output text pair as the training dataset for the large language model's knowledge fine-tuning training in the public opinion field;

[0072] Then keep the original parameters of the general large model unchanged, establish a branch network, apply SVD singular value decomposition to the branch network, and obtain the weight update amount of the branch network . When performing singular value decomposition, each singular value corresponds to a left singular vector and a right singular vector. r singular values form an r×r singular value matrix, where r left singular vectors (each vector has a dimension of d 1 ) form the left ambiguity matrix , and r right singular vectors (each vector has a dimension of d 2 ) form the right singular matrix . is a diagonal matrix, which is set as a zero matrix with a dimension of r×r at the beginning of training. Then, based on the first training dataset, use gradient descent to update the parameters and , then fix and , recalculate the gradient of the diagonal matrix , and adopt the pruning strategy mentioned in the AdaLoRA paper to obtain the update of the diagonal matrix . Keep training until convergence or reach the preset number of training rounds to obtain a set of trained weight update amounts , where 、 , are respectively the left singular matrix after training, the diagonal matrix with r singular values on the diagonal obtained after training, and the right singular matrix after training.

[0073] The reason why this disclosure adopts AdaLoRA instead of standard LoRA for knowledge injection is that the fixed-rank adapter adopted by standard LoRA is difficult to capture the multi-level semantics unique to the public opinion field (such as policy terms, regional expressions, etc.). The corresponding AdaLoRA can first enhance the key features of public opinion (such as sensitive entity recognition) based on dynamically allocating the adapter rank

[0074] The instruction alignment training for public opinion report generation is based on HydraLoRA which can dynamically adjust weight updates. Specifically:

[0075] First, construct a second training dataset for instruction alignment training:

[0076] This disclosure constructs a second training dataset for instruction alignment training based on historical public opinion data and the historical public opinion reports written therefrom. Each piece of training data in the second training dataset includes an instruction, an input, and an output. Among them, the instruction is the specific task required to generate a public opinion analysis report, the input is the current public opinion situation obtained from historical public opinion data, and the output is the content of the public opinion analysis report written by professionals for the instruction and the current public opinion situation. During training, the instruction and input of the training data are combined as the input of the model.

[0077] Then, use the HydraLoRA method with dynamically adjusted weight updates for training. Specifically:

[0078] First, freeze the original parameters of the general large model and the parameters of the side branch network trained as described above , and model the new side branch network.

[0079] Based on the basic LoRA network structure, rewrite the upsampling matrix in the original structure as a MoE structure, that is, a linear weighted sum of N experts. Among them is the th expert in the MoE structure, is the weight of the th expert, and its result is calculated from the following formula , where represents a trainable linear network layer, is the input feature vector (similar to the transformers model, generally obtained by extracting tokens through an embedding layer network), .

[0080] Secondly, based on the triple instruction alignment dataset in the second training dataset (instruction, input, output), complete the parameter training of the alignment branch network.

[0081] Its training process is the same as that of the basic LoRA:

[0082] Step 1, initialize all experts For matrix, is a random Gaussian matrix, ensuring that in the initial state is matrix.

[0083] Step 2, randomly sample a mini-batch dataset from the triple instruction alignment dataset, and based on the gradient descent of the target loss function, obtain the parameters at the next moment based on the parameters at the current moment , and iterate until the parameters converge or reach the total number of iteration steps . At this time

[0084] corresponds to the newly arrived instruction and input , and the routing weight is At this time, the weight function of the entire instruction alignment branch network is

[0085] .

[0086] Step 3, note that this weight function is related to the input. To accelerate model inference, since the training sentiment report instruction alignment is consistent with the distribution in the actual scenario, the present disclosure uses the (instruction, input) of the training data as the input of the entire model, assuming that all these inputs are , where is the scale of the training samples, is the serial number of the training samples, and the present disclosure uses the mean value of the training samples to approximate the actual input , so that the input does not need to affect the trained network weights during the actual inference process.

[0087]

[0088] Thus, the final weight of the instruction alignment branch network is obtained

[0089] The present disclosure can decouple the relationship between the weights and input parameters, and can retain the knowledge fine-tuning results while achieving batch instruction optimization.

[0090] Finally, the parameter weights of the branch network obtained by the above two-step fine-tuning are superimposed on the original model to form the parameters of the final public opinion large language model. . Among them, is the weight of the public opinion large language model, is the original weight of the general large model, is the first weight update amount obtained through fine-tuning training with public opinion domain knowledge, is the second weight update amount obtained through instruction alignment training for public opinion report generation.

[0091] The inference process follows the standard inference process of the general large model, but thanks to the fine-tuned model, it can more accurately understand and generate public opinion-related content.

[0092] Through this hybrid fine-tuning strategy, the present disclosure not only enhances the model's understanding of the public opinion field but also significantly improves its accuracy and practicality in automatic public opinion report generation.

[0093] S230, verify the data accuracy and semantic consistency of the public opinion report, and use the verified public opinion report as the finally generated public opinion report.

[0094] The present disclosure further verifies the generated public opinion report based on data accuracy and semantic consistency to ensure the elimination of hallucination phenomena in the application of the general large model in the field of public opinion report generation.

[0095] Among them, the verification based on data accuracy includes:

[0096] 1. Extract key public opinion data from the generated public opinion report through regular expressions .

[0097] 2. For each public opinion data , consider all of the following situations:

[0098] Situation 1: If the public opinion data appears in both the generated public opinion report and the original public opinion data set (i.e., ), then a higher score is given; here, represents the data set extracted from the report, while is the original public opinion data set.

[0099] Situation 2: If the public opinion data appears only in the generated report but not in the original data set (i.e., ), then it is considered an "hallucination" generated by the large language model, and a lower score is given.

[0100] Case 3: For the data that exists in the original public opinion data set but is not mentioned in the generated report (i.e., ), this disclosure believes that the large model has ignored this basic information and gives it a score of zero .

[0101] 3. Calculate the total verification score according to the formula , where represents the number of elements in the set .

[0102] 4. If the total verification score is lower than the preset first verification threshold, mark that there may be a large error in this public opinion report and recommend re-reviewing or amending it

[0103] The verification based on semantic consistency includes

[0104] 1. Split the generated public opinion report into sentences, and a total of sentences are obtained. Extract the semantic vector of each sentence to form a semantic vector set .

[0105] Assume that the original public opinion data contains pieces of text. Similarly, extract the semantic vector of each piece of text to form a set . Use a sentence vector model such as text2vec to extract the semantic vector and find the original public opinion content that is most similar to each generated sentence , where is the sentence number of the generated public opinion report is the total number of sentences in the generated public opinion report The serial number is The semantic vector extracted from the sentence, and its vector transpose is ; is the serial number of the original public opinion data is the total number of elements in the public opinion data set is the th semantic vector extracted from the public opinion data in the set is an operator, indicating the that makes the dot product of two vectors the largest, that is, find the piece of public opinion data in the generated public opinion report sentence that is most similar in semantics to the original public opinion data

[0106] Obtain the average value of the maximum sentence similarity as the semantic consistency score through the calculation formula , where is the sentence number of the generated public opinion report is the total number of sentences in the generated public opinion report The semantic vector extracted from the sentence with the serial number is transposed to ; is the serial number of the original public opinion data, is the total number of elements in the public opinion data set, is the semantic vector extracted from the th piece of public opinion data in the set. max is an operator, which means to find the maximum value of the dot product between two vectors in the set of generated sentence semantic vectors and the set of original data semantic vectors. For the sentences in the public opinion report, we use the average value of the maximum similarity as the semantic consistency score.

[0107] 4. If the semantic consistency score is lower than the preset second verification threshold, it indicates that the generated public opinion report has a significant difference in semantics from the provided original public opinion content, which may affect the factuality and logic of the report and needs to be marked as having an error.

[0108] Through the above two verification steps, the present disclosure can effectively improve the accuracy and consistency of the generated public opinion report, ensure that the finally output public opinion report can truly reflect the current public opinion situation, and provide strong support to decision-makers and relevant stakeholders. This method not only enhances the professionalism of the report but also improves its value in practical applications.

[0109] Figure 3 is a schematic diagram of an intelligent generation device for a public opinion report according to some embodiments of the present disclosure. As Figure 4 shown, the intelligent generation device 300 for the public opinion report includes an acquisition module 310, an inference module 320, and a verification module 330. Among them:

[0110] The acquisition module 310 is configured to acquire all-round public opinion data on a specific topic or event, and form a public opinion file of the topic or event after preprocessing;

[0111] The inference module 320 is configured to input the public opinion file into a public opinion large language model and output a public opinion report for the topic or event. Among them, the public opinion large language model is generated by multiple fine-tuning trainings of a general large language model in parallel coupling, and the fine-tuning training at least includes knowledge fine-tuning training in the public opinion field and instruction alignment training for public opinion report generation;

[0112] The verification module 330 is configured to perform data accuracy verification and semantic consistency verification on the public opinion report, and use the public opinion report after passing the verification as the finally generated public opinion report.

[0113] Figure 4 is a schematic diagram of an intelligent generation device for a public opinion report according to some embodiments of the present disclosure. AsFigure 4 As shown, the intelligent generation device 400 of the public opinion report includes a memory 420 and a processor 410. The memory 420 is used to store computer programs. The processor 410 is used to implement the following when executing the computer programs: Figure 2 The intelligent generation method of the public opinion report described in S210 - S230 in

[0114] In summary, for the intelligent generation methods, devices, and equipment of the public opinion report provided in the embodiments of the present disclosure, through the coupled training process based on knowledge fine - tuning and instruction alignment, various problems caused by the separation of knowledge fine - tuning and instruction alignment in the prior art are avoided. Specifically, during knowledge fine - tuning, through the rank - adaptive mechanism of AdaLoRA, the overfitting risk caused by low parameter efficiency when using full - parameter fine - tuning in the prior art or the problem of insufficient knowledge coverage caused by the difficulty of capturing multi - level semantics unique to the public opinion field when using standard LoRA is avoided; during instruction alignment, based on the improved HydraLoRA, the mean approximation method is used to achieve batch instruction optimization, avoiding the inference efficiency bottleneck caused by the SFT calculating gradients for each input sample separately. Finally, the present disclosure further avoids possible hallucinations by verifying the generated public opinion report based on data accuracy and semantic consistency.

[0115] Although the subject matter described herein is provided in the general context of execution with an operating system and application programs on a computer system, those skilled in the art will recognize that other implementations can also be performed in combination with other types of program modules. Generally, program modules include routines, programs, components, data structures, and other types of structures that perform specific tasks or implement specific abstract data types. Those skilled in the art can understand that the subject matter described herein can be practiced using other computer system configurations, including handheld devices, multiprocessor systems, microprocessor - based or programmable consumer electronics, minicomputers, mainframe computers, etc., and can also be used in a distributed computing environment where tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules can be located in both local and remote memory storage devices.

[0116] Those of ordinary skill in the art can realize that the units and method steps of each example described in combination with the embodiments disclosed herein can be implemented by electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are executed in a hardware or software manner depends on the specific application and design constraints of the technical solution. Professional technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the present disclosure.

[0117] It should be understood that the above specific embodiments of the present disclosure are only for illustrative explanation or interpretation of the principles of the present disclosure, and do not constitute a limitation on the present disclosure. Therefore, any modifications, equivalent substitutions, improvements, etc. made without departing from the spirit and scope of the present disclosure shall be included within the protection scope of the present disclosure. In addition, the appended claims of the present disclosure are intended to cover all changes and modifications that fall within the scope and boundaries of the appended claims, or equivalent forms of such scope and boundaries.

Claims

1. A method for intelligently generating a public opinion report, characterized in that: include: Obtain all-round public opinion data on a specific topic or event, and form a public opinion file on the topic or event after preprocessing; Inputting the public opinion archive into the public opinion large language model, and outputting a public opinion report for the topic or event, wherein the public opinion large language model is generated by a general large language model through multiple fine-tuning trainings coupled in parallel, and the fine-tuning training at least includes knowledge fine-tuning training in the public opinion field and instruction alignment training for generating the public opinion report; The public opinion report is verified for data accuracy and semantic consistency, and the public opinion report that passes the verification is used as the final public opinion report.

2. The method according to claim 1, characterized in that: The acquisition of all-round public opinion data on a specific topic or event includes: Determine the topics or events that need to be monitored, and use API interfaces or crawler technology to capture the latest public opinion information related to the topics or events from multiple online platforms at preset time intervals, where the online platforms include but are not limited to news portals, social networks, professional forums, and blogs.

3. The method according to claim 1, characterized in that: The public opinion archive of the topic or event formed after the preprocessing includes: Removing noise data and outliers from the public opinion data; The public opinion data after removing noise data and outliers are unified in data format and structuredly stored in a database to form a public opinion archive of the topic or event.

4. The method according to claim 1, characterized in that: The public opinion large language model is generated by a general large language model through multiple fine-tuning trainings coupled in parallel, including: Keep the original weight of the general large model unchanged, establish a first side network, and fine-tune the training through public opinion domain knowledge to obtain a first weight update amount of the first side network; Keeping the original weight of the general large model and the first weight update amount unchanged, establishing a second side branch network, and obtaining a second weight update amount of the second side branch network through instruction alignment training generated for the public opinion report; The first weight update amount and the second weight update amount are added to the original weight to form the weight of the public opinion large language model, and the formula is: ,in: is the weight of the public opinion language model, are the original weights of the general large model, is the first weight update amount obtained through fine-tuning training of public opinion domain knowledge, It is the second weight update amount obtained by aligning training on instructions generated by public opinion reports.

5. The method according to claim 4, characterized in that: The step of establishing the first side network and fine-tuning the training with public opinion domain knowledge to obtain the first weight update amount of the first side network includes: Randomly sample without replacement from the public opinion archive and then intercept any section of public opinion text as input, take the shifted text data containing the next token as output, construct input and output text pairs as the first data set for fine-tuning training of the large language model for public opinion domain knowledge; Keeping the original weights of the general large model unchanged, establishing a first side network suitable for AdaLoRA fine-tuning training, training the first side network based on the AdaLoRA fine-tuning training method based on the first data set, and obtaining a first weight update amount of the first side network.

6. The method according to claim 4, characterized in that: The step of establishing a second side branch network and obtaining a second weight update amount of the second side branch network by aligning training with instructions generated by the public opinion report includes: Obtaining historical public opinion data and historical public opinion reports written therefrom, and constructing a second data set for instruction alignment training, wherein each piece of training data in the second data set includes an instruction, an input, and an output, wherein the instruction is a specific task required to generate a public opinion analysis report, the input is the current public opinion situation obtained from the historical public opinion data, and the output is the content of the public opinion analysis report written by professionals for the instruction and the current public opinion situation; Keeping the original weights of the general large model and the first weight update amount unchanged, a second side branch network suitable for fine-tuning training of HydraLoRA is established, and the second side branch network is trained based on the second data set using a fine-tuning training method based on HydraLoRA to obtain a second weight update amount of the second side branch network.

7. The method according to claim 6, characterized in that: The HydraLoRA can dynamically adjust weight updates, and the training of the second side network based on the second data set using a fine-tuning training method based on HydraLoRA includes: The mean value of all training samples of the second data set is used as a parameter of the second weight update amount to decouple the relationship between the second weight update amount and the input parameter.

8. The method according to claim 1, characterized in that: The data accuracy verification of the public opinion report includes: Extracting public opinion data from the public opinion report based on regular expressions; The public opinion data is scored based on preset rules, wherein the preset rules at least include: if the public opinion data appears in both the public opinion report and the public opinion file data, the public opinion data is given a score higher than a first preset value; if the public opinion data only appears in the public opinion report but not in the public opinion file, the public opinion data is given a score higher than a second preset value but lower than the first preset value; if the public opinion data does not appear in the public opinion report but appears in the public opinion file, the public opinion data is given a score of zero, wherein, ; The total scores of all the public opinion data are summarized, and if the total score is lower than a first preset threshold, it is marked that the public opinion report has a large error.

9. The method according to claim 1, characterized in that: Verifying the semantic consistency of the public opinion report includes: Segment the public opinion report by sentences, extract a semantic vector for each sentence, and form a first semantic vector set; Extracting a semantic vector from each text in the public opinion archive to form a second semantic vector set; The maximum similarity mean between the first semantic vector set and the second semantic vector set is used as a semantic consistency score. If the semantic consistency score is lower than a second preset threshold, the public opinion report is marked as having errors.

10. An intelligent device for generating public opinion reports, characterized in that: include: An acquisition module is used to acquire all-round public opinion data on a specific topic or event, and to form a public opinion file of the topic or event after preprocessing; An inference module, used for inputting the public opinion archive into a public opinion large language model, and outputting a public opinion report for the topic or event, wherein the public opinion large language model is generated by a general large language model through a plurality of fine-tuning trainings coupled in parallel, and the fine-tuning training at least includes knowledge fine-tuning training in the public opinion field and instruction alignment training for generating a public opinion report; The verification module is used to verify the data accuracy and semantic consistency of the public opinion report, and use the public opinion report that has passed the verification as the final public opinion report.

Citation Information

Patent Citations

  • Learning situation report generation method and system based on large language model

    CN118428348A

  • Public opinion monitoring method and device, computer equipment and storage medium

    CN119862253A

Cited By

  • Burned data monitoring management method and system based on large language model and medium

    CN120973940A