Method, device and equipment for constructing network public opinion viewpoint analysis model
By constructing a network public opinion perspective analysis model based on pre-trained language model, the problem of difficulty in accurately analyzing and predicting real-time online public opinion perspectives in the existing technology is solved, and accurate analysis and high-precision prediction of online public opinion are achieved.
Patent Information
- Application Number
- CN202510227818.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-28
- Publication Date
- 2025-06-27
AI Technical Summary
It is difficult for the existing technology to accurately analyze the views of real-time online public opinion, and traditional methods have shortcomings in coverage, context sensitivity and nonlinear emotional processing capabilities, making it difficult to meet the needs of accurate and forward-looking predictions of views of public opinion.
By obtaining multi-source network information on different topics, extracting basic information and comment information from each stage of public opinion development, marking online public opinion opinions and their proportions, and combining this information into a sample data set, fine-tuning training based on the pre-trained language model, and building an online public opinion opinion analysis model. This model outputs the results of analysis of online public opinion opinions, including opinions, their proportion and comment information collection.
It realizes accurate analysis and prediction of real-time online public opinion views, improves the accuracy and forward-looking nature of public opinion views, and can more effectively deal with the complexity and diversity of online public opinion.
Smart Images

Figure CN120218060A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical field of Internet data processing, and in particular to a technology for constructing a network public opinion view analysis model. Background Art
[0002] With the development of the Internet, Internet-based social media, forums, news comment sections, etc. have become important places for the public to express opinions and exchange ideas, forming a vast amount of network public opinion data. These network data contain rich social emotions, public attitudes, and potential public opinion development trend information. Accurate analysis and prediction of network public opinion are crucial for strategy formulation, market decision-making, and public opinion management.
[0003] However, network public opinion data has characteristics such as high fragmentation, strong real-time nature, large fluctuations, and diversified topics, which bring great difficulties to effective monitoring and analysis. Traditional methods such as statistical-based methods are limited by their coverage, context sensitivity, and non-linear emotion processing ability, and are difficult to cope with the complexity of network public opinion and meet the need for accurate and forward-looking prediction of public opinion views.
[0004] Therefore, how to analyze the network public opinion information in the Internet to achieve accurate analysis of real-time network public opinion views and further provide forward-looking and accurate prediction has become an urgent problem to be solved. Summary of the Invention
[0005] The purpose of this application is to provide a method, device, and equipment for constructing a network public opinion view analysis model to at least partially solve the technical problem in the prior art that it is difficult to accurately analyze real-time network public opinion views.
[0006] According to one aspect of this application, a method for constructing a network public opinion view analysis model is provided, wherein the method includes:
[0007] Obtain multi-source network information of different topics;
[0008] For one public opinion development stage of one topic, extract the basic information of the public opinion development stage of the topic and several comment information from the multi-source network information, and according to the several comment information, label one or more network public opinion views and the proportion of each network public opinion view, and form a first sample data with the network public opinion view and its proportion, the basic information, and the several comment information. Traverse each public opinion development stage of each topic, and use the obtained several first sample data as the first data set;
[0009] Train a pre-trained language model based on the first data set and the first preset prompt template, and determine the trained pre-trained language model that passes the verification as a network public opinion view analysis model, where the network public opinion view analysis model outputs a network public opinion view analysis result, including at least one or more network public opinions corresponding to the input and their proportions, and a set of comment information included in each network public opinion.
[0010] Optionally, the verification of the trained pre-trained language model includes:
[0011] View correspondence verification and clustering result consistency verification.
[0012] Optionally, the view correspondence verification includes:
[0013] Convert each network public opinion marked in the first sample data for verification and each network public opinion output by the trained pre-trained language model into sentence vectors respectively, calculate the similarity between the two pairwise, and determine the marked network public opinion and the network public opinion output by the model corresponding to the two with the highest similarity as a pair of matching views, and count the proportion of the number of matching views whose similarity meets the first preset threshold;
[0014] Traverse all the first sample data for verification, count the proportion of the number of samples whose proportion of the number of matching views whose similarity meets the first preset threshold meets the second preset threshold, and judge whether the view correspondence verification passes according to the statistical results.
[0015] Optionally, the clustering result consistency verification includes:
[0016] Based on all the first sample data for verification, determine the set of comment information corresponding to each marked network public opinion, and perform clustering processing on the comment information corresponding to the network public opinions output by the trained pre-trained language model corresponding to all the first sample data for verification, to obtain several clusters corresponding to the network public opinions output by the model, where each cluster corresponds to the set of comment information corresponding to a network public opinion output by the trained pre-trained language model;
[0017] Calculate the similarity between one network public opinion output by the model corresponding to each cluster and each marked network public opinion respectively to determine the marked network public opinion corresponding to each cluster;
[0018] Construct a confusion matrix according to the set of comment information corresponding to each cluster and the marked network public opinion matched with it, determine the clustering result consistency index, and judge whether the clustering result consistency verification passes.
[0019] Optionally, the method for constructing a network public opinion view analysis model further includes:
[0020] For the basic information of each stage of public opinion development for each topic, mark the key progress information;
[0021] Input the basic information of one stage of public opinion development of a topic and several comment information into the network public opinion view analysis model to obtain the network public opinion view analysis result corresponding to the stage of public opinion development of the topic, and form the key progress information, the network public opinion view analysis result, the basic information of the stage of public opinion development of the topic, and several comment information into a second sample data. Traverse each stage of public opinion development of each topic, and use the obtained several second sample data as the second data set;
[0022] Based on the second data set and the second preset prompt template, train the network public opinion view analysis model, and determine the trained network public opinion view analysis model that passes the verification as the network public opinion view prediction model. Among them, the network public opinion view prediction model outputs the network public opinion view prediction result, which at least includes one or more network public opinions and their intensity levels corresponding to the input. When the possible progress information is input, the network public opinion view prediction result also includes the predicted network public opinion and its intensity level in the next stage of public opinion development after the occurrence of the possible key progress.
[0023] Optionally, among them, the verification of the trained network public opinion view analysis model includes:
[0024] For a second sample data used for verification, determine the intensity level of each marked network public opinion according to the proportion of each marked network public opinion in the second sample data;
[0025] Input the second sample data into the trained network public opinion view analysis model to obtain the corresponding network public opinion view prediction result, where the network public opinion view prediction result at least includes one or more predicted network public opinions and their intensity levels;
[0026] Convert each marked network public opinion and each predicted network public opinion into sentence vectors respectively, calculate the similarity between the two pairwise, and determine the marked network public opinion and the predicted network public opinion corresponding to the two with the highest similarity as a pair of matching opinions;
[0027] Evaluate the intensity levels of each pair of matching opinions to obtain the evaluation result corresponding to the second sample data;
[0028] Traverse each second sample data for verification, and determine whether the verification of the trained network public opinion view analysis model passes according to the evaluation results of all the second sample data for verification summarized.
[0029] Optionally, wherein the evaluating the strength levels of each pair of matching views to obtain the evaluation result corresponding to the second sample data includes:
[0030] Calculate the mean absolute error and Pearson correlation coefficient of the strength levels of all network public opinion views and the strength levels of all predicted network public opinion views according to the strength levels of each pair of labeled network public opinion views and predicted network public opinion views;
[0031] Determine the evaluation result corresponding to the second sample data according to the mean absolute error and Pearson correlation coefficient.
[0032] Optionally, wherein the determining the trained pre-trained language model that passes the verification as the network public opinion view analysis model includes:
[0033] Verify multiple trained pre-trained language models, and if the verification passes, obtain several network public opinion view analysis models;
[0034] Wherein, the inputting the basic information of a public opinion development stage of a theme and several comment information into the network public opinion view analysis model includes:
[0035] Input the basic information of a public opinion development stage of a theme and several comment information into any one of the network public opinion view analysis models.
[0036] Optionally, wherein the inputting the basic information of a public opinion development stage of a theme and several comment information into the network public opinion view analysis model, obtaining the network public opinion view analysis result corresponding to the public opinion development stage of the theme, and forming a second sample data with the key progress information, the network public opinion view analysis result, the basic information of the public opinion development stage of the theme and several comment information includes:
[0037] Input the basic information of a public opinion development stage of a theme and several comment information into each network public opinion view analysis model respectively, obtain several network public opinion view analysis results corresponding to the public opinion development stage of the theme, and determine the final network public opinion view analysis result corresponding to the public opinion development stage of the theme according to the several network public opinion view analysis results;
[0038] Form a second sample data with the key progress information, the final network public opinion view analysis result, the basic information of the theme and several comment information of the public opinion development stage.
[0039] Optionally, the determining of the final online public opinion view analysis result corresponding to the public opinion development stage of the subject according to the plurality of online public opinion view analysis results includes:
[0040] Processing the plurality of online public opinion view analysis results by using a voting mechanism to determine the final online public opinion view analysis result corresponding to the public opinion development stage of the subject.
[0041] Optionally, the method for constructing an online public opinion view analysis model further includes:
[0042] Inputting the basic information and a plurality of comment information of the current public opinion development stage of the to-be-predicted subject obtained into the online public opinion view prediction model to output the online public opinion view and its intensity level of the current public opinion development stage of the subject.
[0043] Optionally, the method for constructing an online public opinion view analysis model further includes:
[0044] Inputting the possible key progress information into the online public opinion view prediction model to output the predicted online public opinion view and its intensity level of the next public opinion development stage of the subject after the occurrence of the possible key progress.
[0045] Optionally, the method for constructing an online public opinion view analysis model further includes:
[0046] Performing data structuring processing on the output of the online public opinion view prediction model to save and / or visually display the output after data structuring.
[0047] According to another aspect of the present application, there is provided an apparatus for constructing an online public opinion view analysis model, wherein the apparatus includes:
[0048] A first module for obtaining multi-source network information of different subjects;
[0049] A second module for, for one public opinion development stage of one subject, extracting the basic information of the public opinion development stage of the subject and a plurality of comment information from the multi-source network information, and according to the plurality of comment information, annotating one or more online public opinion views and the proportion of each online public opinion view, and forming a first sample data with the online public opinion view and its proportion, the basic information and the plurality of comment information, traversing each public opinion development stage of each subject, and using the obtained plurality of first sample data as a first data set;
[0050] A third module, configured to train a pre-trained language model based on the first data set and a first preset prompt template, and determine the trained pre-trained language model that passes the verification as a network public opinion view analysis model, wherein the network public opinion view analysis model outputs a network public opinion view analysis result, including at least one or more network public opinions corresponding to the input and their proportions, and a set of comment information included in each network public opinion.
[0051] Optionally, the apparatus for constructing a network public opinion view analysis model further includes:
[0052] A fourth module, configured to label key progress information for the basic information of each public opinion development stage of each topic;
[0053] A fifth module, configured to input the basic information of one public opinion development stage of one topic and several comment information into the network public opinion view analysis model, obtain a network public opinion view analysis result corresponding to the public opinion development stage of the topic, and form the key progress information, the network public opinion view analysis result, the basic information of the public opinion development stage of the topic, and several comment information into a second sample data. Traverse each public opinion development stage of each topic, and use the obtained several second sample data as a second data set;
[0054] A sixth module, configured to train the network public opinion view analysis model based on the second data set and a second preset prompt template, and determine the trained network public opinion view analysis model that passes the verification as a network public opinion view prediction model, wherein the network public opinion view prediction model outputs a network public opinion view prediction result, including at least one or more network public opinions corresponding to the input and their intensity levels. When possible progress information is input, the network public opinion view prediction result further includes a predicted network public opinion and its intensity level in the next public opinion development stage after the occurrence of the possible key progress.
[0055] Optionally, the apparatus for constructing a network public opinion view analysis model further includes:
[0056] A seventh module, configured to input the basic information of the current public opinion development stage of the to-be-predicted topic and several comment information obtained into the network public opinion view prediction model to output the network public opinion and its intensity level of the current public opinion development stage of the topic.
[0057] Optionally, the apparatus for constructing a network public opinion view analysis model further includes:
[0058] An eighth module, configured to input possible key progress information into the online public opinion view prediction model, so as to output a predicted online public opinion view and its intensity level at the next public opinion development stage of the subject after the occurrence of the possible key progress.
[0059] Optionally, the apparatus for constructing an online public opinion view analysis model further includes:
[0060] A ninth module, configured to perform data structuring processing on the output of the online public opinion view prediction model, so as to save and / or visually display the output after data structuring.
[0061] Compared with the prior art, the present application provides a method, apparatus and device for constructing a network public opinion view analysis model. The method includes: obtaining multi-source network information of different topics; for a public opinion development stage of a topic, extracting the basic information of the public opinion development stage of the topic and a number of comment information from the multi-source network information, and according to the number of comment information, labeling one or more network public opinion views and the proportion of each network public opinion view, and combining the network public opinion view and its proportion, the basic information and the number of comment information into a first sample data, traversing each public opinion development stage of each topic, and using the obtained number of first sample data as a first data set; training a pre-trained language model based on the first data set and a first preset prompt template, and determining the trained pre-trained language model that passes the verification as a network public opinion view analysis model, wherein the network public opinion view analysis model outputs a network public opinion view analysis result, at least including one or more network public opinion views and their proportions corresponding to the input, and each network public opinion view includes a set of comment information. Further, the method further includes: labeling key progress information for the basic information of each public opinion development stage of each topic; inputting the basic information and a number of comment information of a public opinion development stage of a topic into the network public opinion view analysis model, obtaining a network public opinion view analysis result corresponding to the public opinion development stage of the topic, and combining the key progress information, the network public opinion view analysis result, the basic information and the number of comment information of the public opinion development stage of the topic into a second sample data, traversing each public opinion development stage of each topic, and using the obtained number of second sample data as a second data set; training the network public opinion view analysis model based on the second data set and a second preset prompt template, and determining the trained network public opinion view analysis model that passes the verification as a network public opinion view prediction model, wherein the network public opinion view prediction model outputs a network public opinion view prediction result, at least including one or more network public opinion views and their intensity levels corresponding to the input, and when the input is possible progress information, the network public opinion view prediction result further includes the predicted network public opinion view and its intensity level in the next public opinion development stage after the possible key progress appears. Through this method, by fine-tuning and training a pre-trained language model with strong language understanding ability, a network public opinion view analysis model can be constructed for accurate analysis of real-time network public opinion data. Further, in combination with possible progress information, high-precision prediction of network public opinion views in the next public opinion development stage after the possible key progress appears can be performed. BRIEF DESCRIPTION OF THE DRAWINGS
[0062] Other features, objects and advantages of the present invention will become more apparent from the following detailed description of non-limiting embodiments read in conjunction with the accompanying drawings:
[0063] Figure 1 Shows a schematic flowchart of a method for constructing an online public opinion view analysis model according to an aspect of the present application;
[0064] Figure 2 Shows a schematic diagram of a device for constructing an online public opinion view analysis model according to another aspect of the present application;
[0065] Like reference numerals in the drawings represent like or similar components. Detailed implementation manners
[0066] The present invention will be further described in detail below with reference to the drawings.
[0067] In a typical configuration of each embodiment of the present application, each trusted party of the device, system, and / or each module of the device may include one or more processors (CPUs), input / output interfaces, network interfaces, and memories.
[0068] The memory may include non - permanent memory in the computer - readable medium, random access memory (RAM) and / or non - volatile memory in the form of, for example, read - only memory (ROM) or flash memory (flash RAM). The memory is an example of a computer - readable medium.
[0069] Computer - readable media includes both permanent and non - permanent, removable and non - removable media and can store information by any method or technology. The information can be computer - readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, phase - change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read - only memory (ROM), electrically erasable programmable read - only memory (EEPROM), flash memory or other memory technologies, compact disc read - only memory (CD - ROM), digital versatile disc (DVD) or other optical storage, magnetic cassette tapes, magnetic disk storage or other magnetic storage devices, or any other non - transitory medium that can be used to store information accessible by a computing device. As defined herein, computer - readable media does not include transitory media such as modulated data signals and carrier waves.
[0070] The present application provides a method, apparatus, and device for constructing a network public opinion view analysis model. By constructing a first data set and a preset first prompt template, the existing pre-trained large language model is fine-tuned to obtain a network public opinion view analysis model, which can be used to analyze the network public opinion views of real-time network information at the current public opinion development stage of a certain topic. The second data set can also be constructed according to the first data set and the network public opinion view analysis model, and the network public opinion view analysis model is fine-tuned by the constructed second data set and a preset second prompt template to obtain a network public opinion view prediction model, which can be used to analyze the network public opinion views of real-time network information at the current public opinion development stage of a certain topic and can highly accurately predict the network public opinion views at the next public opinion development stage after possible key progress. In addition, the model output is processed in a data-structured manner for storage and / or visual display.
[0071] To further elaborate on the technical means and achieved effects adopted in the present application, the technical solutions of the present application will be clearly and completely described below with reference to the accompanying drawings and preferred embodiments.
[0072] Figure 1 The schematic flowchart of a method for constructing a network public opinion view analysis model according to an aspect of the present application is shown. Among them, the method of one embodiment includes:
[0073] S101 Obtain multi-source network information of different topics;
[0074] S102 For a public opinion development stage of a topic, extract the basic information of the public opinion development stage of the topic and several comment messages from the multi-source network information, and according to the several comment messages, label one or more network public opinion views and the proportion of each network public opinion view, and form a first sample data with the network public opinion view and its proportion, the basic information, and the several comment messages. Traverse each public opinion development stage of each topic, and use the obtained several first sample data as the first data set;
[0075] S103 Train the pre-trained language model based on the first data set and the first preset prompt template, and determine the trained pre-trained language model that passes the verification as the network public opinion view analysis model. The network public opinion view analysis model outputs network public opinion view analysis results, including at least one or more network public opinion views and their proportions corresponding to the input, and the set of comment messages included in each network public opinion view.
[0076] In this application, each method embodiment / optional embodiment can be implemented or executed by device 100, where device 100 is a computer device with corresponding software and hardware environments. Among them, the computer device includes, but is not limited to, personal computers, laptop computers, industrial computers, servers, network hosts, single network servers or network server clusters. Here, the computer device is only for illustration, and other existing or future possible devices and / or resource platforms applicable to this application should also be included in the protection scope of this application, and are hereby included by reference.
[0077] In this embodiment, in step S101, device 100 can obtain multi-source network information of different topics. Among them, for historical topics, multi-source network information of different public opinion development stages of different topics can be collected from the Internet. Among them, different topics can include representative events, topics or social phenomena in different fields / industries, and can cover different enterprises, social institutions, brands, figures, industries, public policies, laws and regulations, social phenomena, etc. In the Internet, the life cycle of a topic can usually be divided into multiple different public opinion development stages, which can include the latent period, the rising period, the outbreak period, the decline period, and some topics may also include the rebound period. Based on the topic name, methods such as combined keyword retrieval can be used to collect multi-source network information of different public opinion development stages of relevant topics from the Internet. For example, multi-source network information of different public opinion development stages related to topics such as enterprise mergers and acquisitions, brand new product launches, public policy releases, and social hot events. Among them, the sources of network information can cover search engines, news websites, social media platforms, forums, blogs, etc. Among them, in order to improve the subsequent data processing efficiency, before using the obtained multi-source network information for subsequent processing, preprocessing measures such as cleaning, deduplication, word segmentation, and removal of invalid information can also be taken for the obtained multi-source network information.
[0078] Continuing in this embodiment, in step S102, device 100 can extract the basic information and several comment information of the public opinion development stage of the topic from the multi-source network information for a public opinion development stage of a topic, and based on the several comment information, label one or more network public opinion views and the proportion of each network public opinion view, and form a first sample data with the network public opinion view and its proportion, the basic information and the several comment information. Traverse each public opinion development stage of each topic, and use the obtained several first sample data as the first data set.
[0079] Among them, the device 100 can extract the basic information of each public opinion development stage of each theme from the obtained multi-source network information for different themes, and extract several representative comment information from the numerous comment information related to the public opinion development stage of the theme according to a pre-determined strategy. Then, for the basic information and several comment information of a public opinion development stage of a theme, professional personnel with certain professional capabilities and experience (such as public opinion analysts, etc.) analyze each comment information according to the online public opinion views expressed therein, and then classify them. The several comment information may all reflect one online public opinion view, or may reflect different online public opinion views. Therefore, the several comment information can reflect one or more online public opinion views. The professional personnel can label each online public opinion view and its proportion reflected by the basic information and several comment information related to the public opinion development stage of the theme (that is, the ratio of the number of comment information of an online public opinion view to the total number of the several comment information). Among them, one comment information should only reflect one online public opinion view. Among them, the online public opinion view can be reflected by the online public opinion view identifier and the text description of the online public opinion view. Exemplarily, regarding the online public opinion of theme A in the rising period, from the multi-source network information obtained from the Internet, the basic information of theme A in the rising period and N comment information are extracted. After being analyzed and sorted by a public opinion analyst, it can be determined that there are three types of online public opinion views M1, M2, and M3. Among them, there are N1 comment information reflecting the online public opinion view M1, N2 comment information reflecting the online public opinion view M2, and N3 comment information reflecting the online public opinion view M3. Among them, N1 + N2 + N3 = N, and the proportion of each online public opinion view can be statistically calculated as N1 / N, N2 / N, and N3 / N respectively.
[0080] After determining the basic information and several comment information of a public opinion development stage of a theme, and labeling the corresponding one or more online public opinion views and their proportions, the basic information and several comment information of the public opinion development stage of the theme, as well as the corresponding online public opinion views and their proportions can be combined together to form a first sample data.
[0081] Traversing each public opinion development stage of each theme in different themes, according to the above operations, several first sample data can be obtained, and these several first sample data can be used as the first data set.
[0082] Continuing in this embodiment, in step S103, device 100 can train a pre-trained language model based on the first data set and the first preset prompt template, and determine the trained pre-trained language model that passes the verification as the network public opinion view analysis model. Among them, the network public opinion view analysis model outputs the network public opinion view analysis result, including at least one or more network public opinions corresponding to the input and their proportions, and the comment information set included in each network public opinion.
[0083] Among them, in view of the fact that the language model that has been pre-trained on a large scale without supervision has powerful language understanding capabilities and can accurately grasp the context and understand complex semantic structures, it can be combined with specific tasks in the actual application scenario to perform targeted supervised fine-tuning training on a small amount of data of the pre-trained language model to adapt to the specific tasks in the actual application scenario. In this application, based on the pre-trained language model, for the network public opinion view analysis task of this application, a prompt template can be designed according to the fine-tuning training strategy to perform supervised training on the selected pre-trained language model to complete the network public opinion view analysis task with higher accuracy and robustness.
[0084] Among them, an existing pre-trained language model can be selected as the model to be fine-tuned. For example, existing pre-trained language models such as Wenxin Yiyan, Tongyi Qianwen, T5, and Shusheng·Puyu can be selected. These basic pre-trained language models have strong generalization capabilities and are highly compatible with the network public opinion view analysis task. Among them, according to the requirements of the network public opinion view analysis task of this application, a first preset prompt template can be designed to guide the selected pre-trained language model to complete the network public opinion view analysis task by inserting prompt words and / or constructing specific sentence patterns. An exemplary first preset prompt template is as follows:
[0085] Prompt:
[0086] Task description: As a public opinion analyst, conduct in-depth analysis of the network public opinion related to the theme. It is necessary to analyze the text content based on the basic information of the provided theme and the relevant comment information, identify, classify the network public opinion views of each comment information, and then perform clustering analysis to calculate the proportion of various network public opinion views in all comment information.
[0087] - Text content analysis: Pay attention to the identification of key elements of the theme and understand the public opinion background.
[0088] - Network public opinion view identification and classification: Pay attention to the identification of complex expressions such as metaphors, irony, and satire, and strive for accurate, comprehensive, and unified standards in identification.
[0089] - Network public opinion view clustering analysis: The clustering results should have clear category boundaries and representative category centers.
[0090] Input information: including the topic name, basic information about the stage of public opinion development, and relevant comment information.
[0091] Output result: Output in the format of "Online public opinion view 1 - View description, accounting for **%, comment information set reflecting this view; View 2 - View description, accounting for **%, comment information set reflecting this view;...".
[0092] Among them, the first dataset can be divided into a first training dataset and a first validation dataset, and the selected model to be fine-tuned is fine-tuned using the first training dataset and the first preset prompt template.
[0093] Before fine-tuning training, first, a cross-entropy loss function can be selected to measure the training effect. Among them, the calculation of the cross-entropy loss function can adopt the following formula (1),
[0094] L = -logp M (X|P) (1)
[0095] Among them, P is the model input, X is the model output, and p M (X|P) represents the probability distribution of obtaining output X when the input P is given and X is the true value, which can be obtained according to formula (2),
[0096] p M (X|P) = ∏ i p M (x i |X 0,...,i-1 ,P) (2)
[0097] Among them, i represents the i-th output in X, and X 0,...,i-1 is the output before x i .
[0098] Secondly, in the fine-tuning training of the pre-trained language model, hyperparameters such as the training batch size, the number of training iterations, the maximum sequence length, and the learning rate have a direct impact on the training effect and efficiency of the model. Reasonable hyperparameters such as the batch size, the number of iterations, the maximum sequence length, the learning rate, and the early stopping condition can be set, and a suitable optimizer can be selected, such as the AdamW optimizer based on weight decay. An exemplary partial hyperparameter configuration is shown in Table 1 below.
[0099] Table 1
[0100]
[0101] Among them, after each fine-tuning training of the selected model to be fine-tuned, the trained model to be fine-tuned can be verified using the first validation dataset. According to the requirements of the actual application scenario, appropriate verification metrics can be used to evaluate the verification results. If the verification results of the verification metrics of the trained model to be fine-tuned for the first validation dataset meet the preset threshold, the trained model to be fine-tuned meets the requirements and can be used as the network public opinion view analysis model of this application. If the verification results of the verification metrics of the trained model to be fine-tuned for the first validation dataset do not meet the preset threshold, then, combined with the verification results, targeted adjustment and optimization can be performed on the model to be fine-tuned, such as adjusting hyperparameters, increasing the diversity of the first sample data in the first dataset, replacing different pre-trained language models as the model to be fine-tuned, etc. Then, continuous iterative training and verification are carried out until the verification results of the trained model to be fine-tuned meet the requirements, so as to obtain the network public opinion view analysis model of this application.
[0102] Among them, the basic information of a certain stage of the development of a certain public opinion topic and several related comment information are input into the network public opinion view analysis model, and the network public opinion view analysis results are output. The content is related to the first preset prompt template, but should at least include one or more network public opinion views obtained by the model analyzing the basic information and several comment information, the proportion of each network public opinion view, that is, the ratio of the number of comment information corresponding to each network public opinion view to the total number of comment information, and the set of comment information included in each network public opinion view, that is, the set of comment information corresponding to each network public opinion view that expresses the network public opinion view.
[0103] Optionally, in step S103, the verification of the trained pre-trained language model includes:
[0104] View correspondence verification and clustering result consistency verification.
[0105] Among them, the verification of the trained pre-trained language model can include two aspects: view correspondence verification of network public opinion views and clustering result consistency verification.
[0106] Among them, each piece of comment information contains a key meaning, and different key meanings have obvious boundaries or differences. The ability of the trained pre-trained language model to extract the most key meaning from the comment information can be evaluated through view correspondence verification, that is, verifying the text similarity of the key meanings extracted from different comment information.
[0107] Among them, the ability of the trained pre-trained language model to aggregate different comment information of the same network public opinion view can be evaluated through clustering consistency verification.
[0108] In this application, only when the verification results of these two aspects pass can it be considered that the verification passes.
[0109] Optionally, the view correspondence verification includes:
[0110] Convert each labeled online public opinion view in the first sample data for verification and each online public opinion view output by the trained pre-trained language model into sentence vectors, calculate the similarity between the two pairwise, determine the labeled online public opinion view and the model output online public opinion view corresponding to the two with the highest similarity as a pair of matching views, and count the proportion of the number of matching views whose similarity meets the first preset threshold;
[0111] Traverse all the first sample data for verification, count the proportion of the number of samples whose proportion of the number of matching views whose similarity meets the first preset threshold meets the second preset threshold, and judge whether the view correspondence verification passes according to the statistical results.
[0112] Among them, for the process of verifying the view correspondence of the trained pre-trained language model, first, for a first sample data for verification, that is, a sample data in the first validation set, each labeled online public opinion view therein is converted into a sentence vector through a trained sentence vector model to obtain a corresponding number of sentence vectors. Among them, the sentence vector model can adopt models such as InferSent model, Universal Sentence Encoder model, Sentence-BERT model, etc. Then, the sample data is input into the trained pre-trained language model to obtain the analysis result of the online public opinion view. Each online public opinion view therein is also converted into a sentence vector through the same sentence vector model to obtain a corresponding number of sentence vectors. Then, the similarity between the corresponding number of sentence vectors of the labeled online public opinion view corresponding to the sample data and the corresponding number of sentence vectors of the online public opinion view output by the model is calculated pairwise. The pair of the labeled online public opinion view and the online public opinion view output by the model with the highest similarity is determined as a pair of matching views, and its similarity is recorded. And the proportion of the number of matching views whose similarity meets the first preset threshold corresponding to the first sample data is counted, and it is judged whether the proportion of the number of matching views corresponding to the first sample data meets the second preset threshold. Among them, the similarity can adopt cosine similarity, Euclidean distance or other existing methods for measuring the similarity between vectors. Here, it is not limited, and any vector similarity measurement method that meets the present application is applicable to the present application. Each first sample data for verification is traversed, that is, each sample data in the first validation set is traversed. Then, the proportion of the number of samples whose proportion of the number of matching views whose similarity meets the first preset threshold meets the second preset threshold is counted. Then, according to the statistical result, it is judged whether the view correspondence verification passes. An example is that the first preset threshold is a similarity threshold, assumed to be 80%, and the second preset threshold is a view proportion threshold, that is, in a sample data, the view proportion threshold that meets the first preset threshold, assumed to be 60%. Suppose, for a first sample data for verification, its labeled online public opinion views include views 1, 2, and 3; the online public opinion views output after inputting into the trained pre-trained language model include views 1', 2', and 3'. After converting each view into a sentence vector and calculating the similarity pairwise, assume the obtained results are: the first pair of matching views includes view 1 and view 1', and its similarity is 85%; the second pair of matching views includes view 2 and view 3', and its similarity is 80%; the third pair of matching views includes view 3 and view 2', and its similarity is 75%. Among them, the similarities of the first pair and the second pair both meet the first preset threshold. Therefore, for this first sample data, the proportion of the number of matching views whose similarity meets the first preset threshold is 67% (that is, 2 / 3), which meets the second preset threshold.When traversing all the first sample data for verification, after performing the above operations, then count the proportion of the number of samples that are the same as the above sample data, that is, the proportion of the number of matching viewpoints whose similarity meets the first preset threshold to the number of samples whose proportion of the number of viewpoints meeting the second preset threshold to the total number of samples used for verification. Determine whether the viewpoint correspondence verification passes based on this counted proportion of the number of samples. Suppose the counted proportion of the number of samples meets the preset threshold (such as 80%), then it can be confirmed that the viewpoint correspondence verification for the trained pre-trained language model passes.
[0113] Among them, the number of online public opinion viewpoints output by the model does not exceed the number of online public opinion viewpoints marked. If the number of online public opinion viewpoints output by the model does not match the number of online public opinion viewpoints marked, then process it based on the principle of padding with zeros. For example, when the number of online public opinion viewpoints output by the model is less than the number of online public opinion viewpoints marked, new online public opinion viewpoints output by the model are added, and their proportion is 0.
[0114] Optionally, among them, the clustering result consistency verification includes:
[0115] Based on all the first sample data used for verification, determine the set of comment information corresponding to each marked online public opinion viewpoint, and perform clustering processing on the comment information corresponding to the online public opinion viewpoints output by the trained pre-trained language model corresponding to all the first sample data used for verification, to obtain several clusters corresponding to the online public opinion viewpoints output by the model, where each cluster corresponds to the set of comment information corresponding to an online public opinion viewpoint output by the trained pre-trained language model;
[0116] Calculate the similarity between an online public opinion viewpoint output by the model corresponding to each cluster and each marked online public opinion viewpoint respectively, to determine the marked online public opinion viewpoint corresponding to each cluster;
[0117] According to the set of comment information corresponding to each cluster and the marked online public opinion viewpoint that matches it respectively, construct a confusion matrix, determine the clustering result consistency index, to judge whether the clustering result consistency verification passes.
[0118] Among them, for the clustering consistency verification process of the trained pre-trained language model, first, for all the first sample data used for verification, that is, all the sample data in the first validation set, determine the set of comment information corresponding to each labeled online public opinion view, that is, group the comment information labeled with the same online public opinion view together. Perform clustering on the comment information corresponding to each online public opinion view output by the trained pre-trained language model for all the first sample data used for verification, and obtain several clusters corresponding to the online public opinion views output by the model. Among them, each cluster corresponds to the set of comment information corresponding to an online public opinion view output by the trained pre-trained language model. Each piece of comment information in this set of comment information corresponds one-to-one with a data point in this cluster. Then, calculate the similarity between an online public opinion view output by the model corresponding to each cluster and each labeled online public opinion view respectively, and determine the pair with the highest similarity as the matching relationship to determine a labeled online public opinion view corresponding to each cluster. Among them, the similarity can adopt cosine similarity, Euclidean distance or other existing methods for measuring the similarity between vectors. Here, it is not limited, and any vector similarity measurement method that meets the requirements of this application is applicable to this application. Then, according to the set of comment information corresponding to each cluster and a labeled online public opinion view that matches it, construct a confusion matrix, compare the set of comment information corresponding to each online public opinion view output by the clustering with the set of comment information corresponding to the labeled online public opinion view, determine the clustering result consistency index, and judge whether the clustering result consistency verification passes according to this clustering result consistency index. Among them, the clustering result consistency index can be ARI (Adjusted Rand Index), NMI (Normalized Mutual Information), Homogeneity, Completeness, V-Measure, etc.
[0119] ARI measures the similarity between clustering assignments and labels through pairwise comparisons. In this application, as an example of using ARI as the clustering result consistency index, assume that all the sample data in the first validation set used for verification includes a total of N pieces of comment information. After statistics, there are H labeled online public opinion views. After clustering the analysis results of the online public opinion views output by the model for all the sample data, K clusters are obtained. Then, a K x H confusion matrix C can be constructed. The element C of this confusion matrix ij represents the number of identical comment information in the set of comment information corresponding to an online public opinion view output by the model corresponding to the i-th cluster and the set of comment information corresponding to the j-th labeled online public opinion view. The process of determining the clustering result consistency index ARI can be as follows:
[0120] Step 1: Determine the number of pairs a where the data points corresponding to two comment messages are in the same cluster and the labeled online public opinion views of the two comment messages are the same;
[0121] Step 2: Determine the number of pairs b where the data points corresponding to two comment messages are in different clusters and the labeled online public opinion views of the two comment messages are also different;
[0122] Step 3: Determine the number of pairs c where the data points corresponding to two comment messages are in the same cluster but the labeled online public opinion views of the two comment messages are different;
[0123] Step 4: Determine the number of pairs d where the data points corresponding to two comment messages are in different clusters but the labeled online public opinion views of the two comment messages are the same.
[0124] Among them, the total number of pairs should be That is, the combination number of taking any 2 from a total of N comment messages. The calculation of the clustering result consistency index ARI can refer to formulas (3) to (6).
[0125] ARI = (I - E) / (MI - E) (3)
[0126] Among them,
[0127] I = (a + b) / (a + b + c + d) (4)
[0128] E = ((a + b + c + d) 2 - (a + c)(b + d)) / 2(N 2 - N) (5)
[0129] MI = (N 2 - N) / 2 (6)
[0130] Among them, the value range of the calculated ARI is [-1, 1]. 1 indicates a perfect match and the best consistency. 0 indicates the expected value of consistency under random clustering assignment. A negative value indicates a worse match than random clustering assignment and the worst consistency.
[0131] It can be judged whether the clustering result consistency verification passes according to the calculated ARI value. For example, if the calculated ARI value is greater than a preset threshold (such as 0), it can be judged that the clustering result consistency verification passes.
[0132] In order to predict the subsequent online public opinion views at the current public opinion development stage of the monitored theme, optionally, the method for constructing an online public opinion view analysis model further includes:
[0133] S104 Label key progress information for the basic information of each public opinion development stage of each theme;
[0134] S105 inputs the basic information of a public opinion development stage of a subject and several comment information into the online public opinion view analysis model, obtains the online public opinion view analysis result corresponding to the public opinion development stage of the subject, and forms the key progress information, the online public opinion view analysis result, the basic information of the public opinion development stage of the subject and several comment information into a second sample data. Traverse each public opinion development stage of each subject, and use the obtained several second sample data as the second data set;
[0135] S106 trains the online public opinion view analysis model based on the second data set and the second preset prompt template, and determines the trained online public opinion view analysis model that passes the verification as the online public opinion view prediction model. The online public opinion view prediction model outputs the online public opinion view prediction result, which at least includes one or more online public opinion views and their intensity levels corresponding to the input. When possible progress information is input, the online public opinion view prediction result also includes the predicted online public opinion view and its intensity level in the next public opinion development stage after the occurrence of the possible key progress.
[0136] In this alternative embodiment, in step S104, device 100 can also label the corresponding key progress information according to the basic information of each public opinion development stage of each subject. The key progress information can include: the name, type, and content description of one or more key progress related to the public opinion development stage of the subject. The key progress type can be preset in combination with the actual application scenario, and can include exposure, news release, official statement, in-depth investigation, liability determination, legal litigation and judgment, handling and accountability, victim compensation, policy change, comprehensive rectification, etc.
[0137] Among them, several historical subjects different from those in the foregoing step S101 can also be reselected, multi-source network information of these historical subjects is obtained from the Internet, and then for each public opinion development stage of each subject, the basic information of the public opinion development stage of the subject and several comment information are extracted, and the corresponding key progress information is labeled according to the basic information of the public opinion development stage of the subject. The basic information, several comment information, and the corresponding key information progress of each public opinion development stage of each subject can be obtained.
[0138] Continuing in this alternative embodiment, in step S105, the device 100 may input the basic information and a number of comment information of a public opinion development stage of a topic obtained through step S104 into the online public opinion view analysis model, and obtain an online public opinion view analysis result corresponding to the public opinion development stage of the topic. Among them, the online public opinion view analysis result at least includes one or more online public opinion views and their proportions corresponding to the basic information and a number of comment information of the public opinion development stage of the topic, and the set of comment information included in each online public opinion view. The basic information, a number of comment information, the corresponding key progress information, and the online public opinion view analysis result of the public opinion development stage of the topic can be combined to form a second sample data set.
[0139] Traverse each public opinion development stage of each topic. According to the above operations, a number of second sample data sets can be obtained, and these second sample data sets can be used as the second data set.
[0140] Continuing in this alternative embodiment, in step S106, the device 100 may train the online public opinion view analysis model based on the second data set and the second preset prompt template, and verify the trained online public opinion view analysis model to obtain an online public opinion view prediction model.
[0141] Among them, the online public opinion view analysis model obtained in step S103 can be used as the basic model. For the online public opinion view prediction task of this application, according to the second preset prompt template designed according to the fine-tuning strategy, the basic model is supervised trained to improve the performance of the basic model in the online public opinion view prediction task.
[0142] Among them, according to the task requirements of the online public opinion view prediction of this application, a second preset prompt (Prompt) template can be designed to guide the model to identify the key progress and online public opinion views of the relevant topic at the current stage through the analysis of the text (basic information, comment information, etc.), and combine the possible key progress to further predict the online public opinion views and their intensity levels. An exemplary second preset prompt template is as follows:
[0143] Prompt:
[0144] Task background: As a public opinion analyst, conduct in-depth analysis and prediction of online public opinion related to the topic.
[0145] Task description: Based on the basic information and comment information of the public opinion development stage where the given topic is located, analyze the online public opinion views at the current stage and the current progress, and predict the online public opinion views and their intensity levels (five-point scale) at the next public opinion development stage after the development of online public opinion and the possible key progress.
[0146] Input information: Basic information (including the topic name and the stage of the public opinion development of the topic) and comment information of the stage of the public opinion development of the topic.
[0147] Output result: Prediction result format: "In the next stage, if there is **progress, Viewpoint 1 (including the viewpoint identifier and the viewpoint description), intensity level; Viewpoint 2 (including the viewpoint identifier and the viewpoint description), intensity level;...".
[0148] Among them, the second dataset can be divided into a second training dataset and a test dataset, and the network public opinion view analysis model as the basic model is fine-tuned and trained using the second training dataset and the second preset prompt template.
[0149] Among them, the same cross-entropy loss function as described above can be selected to measure the training effect. In the fine-tuning training of the basic model, relevant hyperparameters, optimizers, etc. can be set and selected in combination with the requirements of the actual application scenario, or the relevant settings and selections in step S103 above can be referred to.
[0150] Among them, after each fine-tuning training of the basic model, the test dataset can be used to verify the trained basic model.
[0151] Optionally, in step 106, the verification of the trained network public opinion view analysis model includes:
[0152] For a second sample data used for verification, according to the proportion of each labeled network public opinion view in the second sample data, determine the intensity level of each labeled network public opinion view;
[0153] Input the second sample data into the trained network public opinion view analysis model to obtain the corresponding network public opinion view prediction result, where the network public opinion view prediction result includes at least one or more predicted network public opinion views and their intensity levels;
[0154] Convert each labeled network public opinion view and each predicted network public opinion view into sentence vectors respectively, calculate the similarity between them pairwise, and determine the labeled network public opinion view and the predicted network public opinion view corresponding to the two with the highest similarity as a pair of matching views;
[0155] Evaluate the intensity levels of each pair of matching views to obtain the evaluation result corresponding to the second sample data;
[0156] Traverse each second sample data used for verification, and judge whether the verification of the trained network public opinion view analysis model passes according to the evaluation results of all the second sample data used for verification.
[0157] In this alternative embodiment, the test data set obtained from the division of the second data set can be used to verify the trained network public opinion view analysis model. First, for a second sample data for verification in the test data set, according to the proportion of each labeled network public opinion view in the second sample data (i.e., the ratio of the number of comment information belonging to the labeled network public opinion view to the total number of comment information in the second sample data), the proportion can be converted into an intensity level in a five-star scale according to a preset rule (such as proportional division or a preset division level threshold, etc.), so as to determine the intensity level of each labeled network public opinion view. For example, a proportion of less than 20% can be converted into 1 (less) in the five-star scale; a proportion of 20% - 40% can be converted into 2 (lesser) in the five-star scale; a proportion of 40% - 60% can be converted into 3 (average) in the five-star scale; a proportion of 60% - 80% can be converted into 4 (more) in the five-star scale; a proportion of more than 80% can be converted into 5 (many) in the five-star scale. Secondly, input the second sample data into the trained network public opinion view analysis model to obtain the corresponding network public opinion view prediction result, where the network public opinion view prediction result at least includes one or more predicted network public opinion views and their intensity levels. Then, for the second sample data, each labeled network public opinion view and each predicted network public opinion view are respectively converted into sentence vectors through the trained sentence vector model, where each view corresponds to a sentence vector, so as to obtain two corresponding groups of sentence vectors. Calculate the similarity between the two for each pair, and determine the pair of labeled network public opinion view and predicted network public opinion view corresponding to the pair with the highest similarity as a pair of matching views. Here, the similarity can adopt cosine similarity, Euclidean distance or other existing methods for measuring the similarity between vectors. Here, it is not limited, and any vector similarity measurement method that meets the requirements of this application is applicable to this application. Then, according to the corresponding relationship between each labeled network public opinion view and the predicted network public opinion view, evaluate the intensity levels of each pair of matching views to obtain the evaluation result corresponding to the second sample data.
[0158] Traverse each second sample data for verification, that is, traverse each sample data in the test data set. After the above operations, summarize the evaluation results of all second sample data for verification. According to the summarized evaluation results, determine whether the verification of the trained network public opinion view analysis model passes.
[0159] Among them, if the trained network public opinion view analysis model passes the verification, it can be used as the network public opinion view prediction model of this application. If the trained basic model fails to pass the verification, the network public opinion view analysis model can be adjusted and optimized specifically in combination with the verification results, such as adjusting hyperparameters, increasing the diversity of the second sample data in the second dataset, replacing the network public opinion view analysis model obtained by fine-tuning based on different pre-trained language models as the basic model, etc. Then, continuous iterative training and verification are carried out until the verification result of the trained network public opinion view analysis model meets the requirements, so as to obtain the network public opinion view prediction model of this application.
[0160] Optionally, among them, the evaluation of the strength level of each pair of matching views to obtain the evaluation result corresponding to the second sample data includes:
[0161] According to the strength levels of each pair of labeled network public opinion views and predicted network public opinion views, calculate the mean absolute error and Pearson correlation coefficient of the strength levels of all network public opinion views and all predicted network public opinion views corresponding to the second sample data;
[0162] Determine the evaluation result corresponding to the second sample data according to the mean absolute error and Pearson correlation coefficient.
[0163] Among them, according to the strength levels of each pair of labeled network public opinion views and predicted network public opinion views of a second sample data, the MAE (Mean Absolute Error) value of the strength levels of the labeled network public opinion views and predicted network public opinion views corresponding to the second sample data can be calculated according to the following formula (7), and the PCC (Pearson Correlation Coefficient) value of the strength levels of the labeled network public opinion views and predicted network public opinion views corresponding to the second sample data can be calculated according to the following formula (8).
[0164]
[0165] Among them, a i ∈A, p i ∈P respectively represent the strength level of the i-th labeled network public opinion view in the labeled network public opinion view set A corresponding to a sample data and the strength level of the corresponding predicted network public opinion view in the predicted network public opinion view set P corresponding to the sample data, and N represents the number of labeled network public opinion views corresponding to the sample data.
[0166]
[0167] Among them, a i ∈A, pi ∈P represents the intensity level of the i-th labeled online public opinion view in the set A of labeled online public opinion views corresponding to a sample data and the intensity level of the corresponding predicted online public opinion view in the set P of predicted online public opinion views corresponding to this sample data. N represents the number of labeled online public opinion views corresponding to this sample data, μ A and σ A represent the mean and standard deviation of A respectively.
[0168] Among them, the number of predicted online public opinion views does not exceed the number of labeled online public opinion views. If the number of predicted online public opinion views does not match the number of labeled online public opinion views, it is processed based on the principle of padding with zeros. For example, when the number of predicted online public opinion views is less than the number of labeled online public opinion views, new predicted online public opinion views are added, and their intensity levels are given the lowest intensity level.
[0169] A lower MAE value and a higher PCC value can represent more accurate prediction results. Based on the calculated MAE value and PCC value, the evaluation result corresponding to this second sample data can be determined.
[0170] Traverse each second sample data used for verification, that is, traverse each sample data in the test dataset. After the above operations, summarize the evaluation results of all second sample data used for verification. According to the summarized evaluation results, judge whether the verification of the trained online public opinion view analysis model passes. Among them, the proportion of the number of samples whose MAE value and PCC value corresponding to the evaluation result meet the preset threshold can be counted among all second sample data used for verification in the test dataset. If the proportion of the number of samples whose MAE value and PCC value corresponding to the evaluation result meet the preset threshold meets the preset threshold (such as 80%), it can be confirmed that the trained online public opinion view analysis model passes the verification and the online public opinion view prediction model is obtained. Among them, if the trained online public opinion view analysis model fails to pass the verification, the second training dataset and the test dataset should be re-divided based on the second dataset. Even specific types of sample data can be collected and sorted out, added to the second dataset, and then the second training dataset and the test dataset are re-divided, and the online public opinion view analysis model is iteratively trained again to improve the performance of the trained online public opinion view analysis model until the trained online public opinion view analysis model passes the verification of the test dataset.
[0171] The network public opinion view prediction model can be deployed according to the requirements of actual application scenarios, such as being deployed to an opinion monitoring system, a social media analysis platform, etc. It can extract basic information and a number of real-time comment information related to the current stage of public opinion development of a topic from real-time network information related to a hot topic collected from the Internet, and input it into the network public opinion view prediction model of the present application. The prediction result of the network public opinion view at the current stage of public opinion development of the topic can be output, including one or more network public opinion views and their intensity levels. When information on possible progress after the current stage of public opinion development of the topic is also input, the predicted network public opinion view and its intensity level at the next stage of public opinion development of the topic after the occurrence of such possible key progress can also be output.
[0172] Among them, relevant real-time network information on the stage of public opinion development of relevant topics can also be obtained regularly, relevant basic information and comment information can be extracted, and the prediction results of the model can be compared to evaluate the prediction accuracy and other effects of the model. And the basic information and comment information on the stage of public opinion development of relevant topics extracted regularly can be sorted into new sample data to supplement the data set, so as to maintain and update the model to further improve the performance of the model.
[0173] Optionally, in step S103, the determination of the pre-trained language model after training that has passed verification as a network public opinion view analysis model includes:
[0174] Verify multiple pre-trained language models after training. If the verification passes, a number of network public opinion view analysis models are obtained;
[0175] Among them, in step S105, the input of the basic information and a number of comment information of a stage of public opinion development of a topic into the network public opinion view analysis model includes:
[0176] Input the basic information and a number of comment information of a stage of public opinion development of a topic into any one of the network public opinion view analysis models.
[0177] In this alternative embodiment, to improve the accuracy of the analysis results of online public opinion views, in step S103, device 100 may also divide the first data set into several training data sets and corresponding validation data sets, and train a selected pre-trained language model in combination with the first preset prompt template, or use the same training data sets and validation data sets, and train different pre-trained language models based on different algorithms or architectures in combination with the first preset prompt template, and verify the trained pre-trained language models to obtain multiple online public opinion view analysis models. For example, BERT, RoBERTa, etc. based on Transformer, so as to obtain multiple online public opinion view analysis models with differences but complementarity. Among them, for each pre-trained language model, the same cross-entropy loss function as described above can be selected to measure the training effect. In the fine-tuning training of each pre-trained language model, relevant hyperparameters, optimizers, etc. can be set and selected in combination with the requirements of the actual application scenario, or the relevant settings and selections in step S103 above can be referred to.
[0178] Then, in step S105, input the basic information of a public opinion development stage of a theme and several comment information into any one of the above multiple online public opinion view analysis models to obtain the online public opinion view analysis result corresponding to the public opinion development stage of the theme. The online public opinion view analysis result can be stored in a data-structured manner, for example, stored in the form of CSV, JSON or a database. Among them, the data-structured form can be that each row of data represents an online public opinion view corresponding to a stage of a theme, and can include data corresponding to fields such as view identifiers and view descriptions.
[0179] Then combine the basic information of the public opinion development stage of the theme, several comment information, the corresponding key progress information and the final online public opinion view analysis result together to form a second sample data.
[0180] To further improve the accuracy of the analysis results of online public opinion views, optionally, in step S105, the inputting the basic information of a public opinion development stage of a theme and several comment information into the online public opinion view analysis model, obtaining the online public opinion view analysis result corresponding to the public opinion development stage of the theme, and combining the key progress information, the online public opinion view analysis result, the basic information of the public opinion development stage of the theme and several comment information into a second sample data includes:
[0181] Input the basic information of a public opinion development stage of a subject and several comment information into each online public opinion view analysis model respectively, to obtain several online public opinion view analysis results corresponding to the public opinion development stage of the subject, and determine the final online public opinion view analysis result corresponding to the public opinion development stage of the subject according to the several online public opinion view analysis results;
[0182] Form a second sample data by combining the key progress information, the final online public opinion view analysis result, the basic information of the subject, and several comment information of the public opinion development stage.
[0183] In this alternative embodiment, in step S105, the basic information of a public opinion development stage of a subject and several comment information can be input into each online public opinion view analysis model respectively to obtain multiple online public opinion view analysis results, and then according to these multiple online public opinion view analysis results, determine the final online public opinion view analysis result corresponding to the public opinion development stage of the subject. Then, combine the basic information, several comment information, corresponding key progress information, and final online public opinion view analysis result of the public opinion development stage of the subject together to form a second sample data.
[0184] Among them, several online public opinion view analysis models with complementary characteristics can be selected. In step S105, device 100 can first input the basic information of a public opinion development stage of a subject and several comment information into each online public opinion view analysis model respectively. Each online public opinion view analysis model outputs an online public opinion view analysis result with reference to the format in the first preset prompt template. Among them, each online public opinion view analysis result includes at least one or more online public opinion views and their proportions, and the comment information set included in each online public opinion view. Then, according to these multiple online public opinion view analysis results, determine the final online public opinion view corresponding to each comment information of the online public opinion stage of the subject, and then summarize to determine the final online public opinion view analysis result of the online public opinion stage of the subject. Then, combine the basic information, several comment information, corresponding key progress information, and final online public opinion view analysis result of the public opinion development stage of the subject together to form a second sample data.
[0185] Among them, one that best meets the requirements of the actual application scenario can be selected from multiple network public opinion view analysis models as the base model for subsequent further fine-tuning training. In step S107, device 100 can train the base model according to the second data set and the second preset prompt template, and verify the trained base model to obtain a network public opinion view prediction model. Among them, the second data set can be divided into a second training data set and a test data set, and the network public opinion view analysis model serving as the base model is fine-tuned and trained using the second training data set and the second preset prompt template. Among them, the same cross-entropy loss function as described above can be selected to measure the training effect. In the fine-tuning training of the base model, relevant hyperparameters, optimizers, etc. can be set and selected in combination with the requirements of the actual application scenario, or the relevant settings and selections in step S103 above can be referred to. Among them, after each fine-tuning training of the base model, the test data set can be used to verify the trained base model. Among them, if the trained network public opinion view analysis model passes the verification, it can be used as the network public opinion view prediction model of this application. If the trained base model fails to pass the verification, targeted adjustments and optimizations can be made to the network public opinion view analysis model in combination with the verification results, such as adjusting hyperparameters, increasing the diversity of the second sample data in the second data set, replacing the network public opinion view analysis model fine-tuned and trained based on different pre-trained language models as the base model, etc. Then, continuous iterative training and verification are carried out until the verification result of the trained network public opinion view analysis model meets the requirements, so as to obtain the network public opinion view prediction model of this application.
[0186] Optionally, among them, the determining the final network public opinion view analysis result corresponding to the public opinion development stage of the theme according to the several network public opinion view analysis results includes:
[0187] Processing the several network public opinion view analysis results using a voting mechanism to determine the final network public opinion view analysis result corresponding to the public opinion development stage of the theme.
[0188] Among them, a voting mechanism can be adopted. For the basic information and several comment messages of a public opinion development stage of a theme, for each comment message, determine the network public opinion view corresponding to this comment message in each network public opinion analysis result, and process it using a voting mechanism. If the network public opinion views corresponding to this comment message in more than a preset quantity or proportion (such as more than half) of the network public opinion analysis results are the same, then it can be determined that this network public opinion view is the final network public opinion view of this comment message. Then, summarize the final network public opinion views of each comment message, and the final network public opinion view analysis result corresponding to this public opinion development stage of this theme can be determined.
[0189] Optionally, the method for constructing a network public opinion view analysis model further includes:
[0190] S107 inputs the basic information and several comment information of the current public opinion development stage of the to-be-predicted topic obtained into the network public opinion view prediction model, so as to output the network public opinion view and its intensity level of the current public opinion development stage of the topic.
[0191] Among them, the device 100 can collect real-time multi-source network information of the current public opinion development stage of relevant topics from the network, extract the basic information and several comment information of the current public opinion development stage of the topic, and then input it into the deployed network public opinion view prediction model, and can output the network public opinion view and its intensity level of the current public opinion development stage of the topic.
[0192] Optionally, the method for constructing a network public opinion view analysis model further includes:
[0193] S108 inputs the possible key progress information into the network public opinion view prediction model, so as to output the predicted network public opinion view and its intensity level of the next public opinion development stage of the topic after the occurrence of the possible key progress.
[0194] Among them, based on step S107, the device 100 can further input the subsequent possible key progress information of the topic into the network public opinion view prediction model, and can output the network public opinion view and its intensity level of the next public opinion development stage of the topic after the occurrence of the possible key progress.
[0195] Optionally, the method for constructing a network public opinion view analysis model further includes:
[0196] S109 performs data structuring processing on the output of the network public opinion view prediction model, so as to save and / or visually display the output after data structuring.
[0197] Among them, in order to facilitate the subsequent use of the output of the network public opinion view prediction model, the output of the network public opinion view prediction model can be subjected to data structuring processing for storage to improve data storage efficiency, and / or visually display the output to enhance data readability. It can also facilitate the users of the output to take targeted measures according to the output.
[0198] Figure 2 Shows a schematic diagram of a device for constructing a network public opinion view analysis model according to another aspect of the present application. Among them, the device in one embodiment includes:
[0199] The first module 210 is used to obtain multi-source network information of different topics;
[0200] The second module 220 is configured to extract the basic information of the public opinion development stage of the subject and several pieces of comment information from the multi-source network information for a public opinion development stage of a subject, label one or more online public opinion views and the proportion of each online public opinion view according to the several pieces of comment information, and form the online public opinion views and their proportions, the basic information, and the several pieces of comment information into a first sample data. It traverses each public opinion development stage of each subject and uses the obtained several first sample data as a first data set.
[0201] The third module 230 is configured to train a pre-trained language model based on the first data set and a first preset prompt template, and determine the trained pre-trained language model that passes the verification as an online public opinion view analysis model. The online public opinion view analysis model outputs an online public opinion view analysis result, including at least one or more online public opinion views and their proportions corresponding to the input, and a set of comment information included in each online public opinion view.
[0202] In this embodiment, the device is deployed or integrated in the device 100 that executes the foregoing method embodiments and / or optional embodiments.
[0203] In this embodiment, through the first module 210 of the device, multi-source network information of different subjects can be obtained. Among them, for historical subjects, multi-source network information of different public opinion development stages of different subjects can be collected from the Internet. The sources of network information can cover search engines, news websites, social media platforms, forums, blogs, etc. In order to improve the subsequent data processing efficiency, before using the obtained multi-source network information for subsequent processing, preprocessing measures such as cleaning, deduplication, word segmentation, and removing invalid information can also be taken for the obtained multi-source network information.
[0204] Continuing in this embodiment, through the second module 220 of the device, for each stage of public opinion development of each topic among different topics, basic information of the stage of public opinion development of the topic can be extracted from the obtained multi-source network information, and according to a pre-determined strategy, several representative comment messages can be extracted from numerous comment messages related to the stage of public opinion development of the topic. Then, for the basic information and several comment messages of a stage of public opinion development of a topic, professionals with certain professional capabilities and experience (such as public opinion analysts, etc.) analyze each comment message according to the online public opinion views expressed therein, and then classify them. The several comment messages may all reflect one online public opinion view, or may reflect different online public opinion views. Therefore, the several comment messages can reflect one or more online public opinion views. The professionals can label each online public opinion view reflected by the basic information and several comment messages related to the stage of public opinion development of the topic and its proportion (i.e., the ratio of the number of comment messages of an online public opinion view to the total number of the several comment messages). Among them, one comment message should only reflect one online public opinion view. After determining the basic information and several comment messages of a stage of public opinion development of a topic, and labeling the corresponding one or more online public opinion views and their proportions, the basic information and several comment messages of the stage of public opinion development of the topic, as well as the corresponding online public opinion views and their proportions can be combined together to form a first sample data. Then, by traversing the basic information and several comment messages of each stage of public opinion development of each topic determined by the first module 210, several first sample data can be obtained, and these several first sample data can be used as the first data set.
[0205] Continuing with this embodiment, through the third module 230 of the device, a pre-trained language model can be trained based on the first data set and the first preset prompt template, and the trained pre-trained language model that passes the verification is determined as the online public opinion view analysis model. Among them, the online public opinion view analysis model outputs the online public opinion view analysis results, including at least one or more online public opinion views corresponding to the input and their proportions, and the set of comment information included in each online public opinion view. Among them, an existing pre-trained language model can be selected as the model to be fine-tuned according to the specific tasks of the actual application scenario, and targeted supervised fine-tuning training with a small amount of data can be carried out. The cross-entropy loss function can be selected to measure the training effect. Among them, the first data set can be divided into a first training data set and a first verification data set. The selected model to be fine-tuned is fine-tuned using the first training data set and the first preset prompt template. After each fine-tuning training of the selected model to be fine-tuned, the first verification data set can be used to verify the trained model to be fine-tuned. According to the requirements of the actual application scenario, appropriate verification metrics can be used to evaluate the verification results. If the verification result of the verification metric of the trained model to be fine-tuned for the first verification data set meets the preset threshold, the trained model to be fine-tuned meets the requirements and can be used as the online public opinion view analysis model of this application. If the verification result of the verification metric of the trained model to be fine-tuned for the first verification data set does not meet the preset threshold, targeted adjustment and optimization can be carried out on the model to be fine-tuned in combination with the verification result, such as adjusting hyperparameters, increasing the diversity of the first sample data in the first data set, replacing different pre-trained language models as the model to be fine-tuned, etc. Then, continuous iterative training and verification are carried out until the verification result of the trained model to be fine-tuned meets the requirements, so as to obtain the online public opinion view analysis model of this application.
[0206] Optionally, the device for constructing an online public opinion view analysis model further includes:
[0207] A fourth module 240, configured to label key progress information for the basic information of each stage of public opinion development for each topic;
[0208] A fifth module 250, configured to input the basic information of one stage of public opinion development of one topic and several pieces of comment information into the online public opinion view analysis model, obtain the online public opinion view analysis result corresponding to the stage of public opinion development of the topic, and form a second sample data with the key progress information, the online public opinion view analysis result, the basic information of the stage of public opinion development of the topic, and several pieces of comment information. Traverse each stage of public opinion development of each topic, and use the obtained several second sample data as the second data set;
[0209] The sixth module 260 is used to train the online public opinion view analysis model based on the second data set and the second preset prompt template, and determine the trained online public opinion view analysis model that passes the verification as the online public opinion view prediction model. Among them, the online public opinion view prediction model outputs the online public opinion view prediction result, which at least includes one or more online public opinion views and their intensity levels corresponding to the input. When the possible progress information is input, the online public opinion view prediction result also includes the predicted online public opinion views and their intensity levels in the next public opinion development stage after the occurrence of the possible key progress.
[0210] In this optional embodiment, through the fourth module 240 of the device, the corresponding key progress information can also be marked according to the basic information of each public opinion development stage of each theme. Among them, the key progress information may include: the name, type, and content description of one or more key progress related to the public opinion development stage of the theme. Among them, the key progress type can be preset in combination with the actual application scenario, and may include exposure, news release, official statement, in-depth investigation, liability determination, legal litigation and judgment, handling and accountability, victim compensation, policy change, comprehensive rectification, etc.
[0211] Continuing in this optional embodiment, through the fifth module 250 of the device, the basic information of a public opinion development stage of a theme and several comment information obtained through the fourth module 240 can be input into the online public opinion view analysis model to obtain the online public opinion view analysis result corresponding to the public opinion development stage of the theme. Among them, the online public opinion view analysis result at least includes one or more online public opinion views and their proportions corresponding to the basic information of the public opinion development stage of the theme and several comment information, and the comment information set included in each online public opinion view. The basic information of the public opinion development stage of the theme, several comment information, the corresponding key progress information, and the online public opinion view analysis result can be combined together to form a second sample data. Then, by traversing each public opinion development stage of each theme and performing the above operations, several second sample data can be obtained, and these several second sample data can be used as the second data set.
[0212] Continuing in this alternative embodiment, through the sixth module 260 of the device, the network public opinion view analysis model obtained through module 230 can be used as a base model. For the network public opinion view prediction task of the present application, according to the second preset prompt template designed according to the fine-tuning strategy, the second data set is divided into a second training data set and a test data set. The network public opinion view analysis model serving as the base model is fine-tuned and trained using the second training data set and the second preset prompt template to improve the performance of the base model in the network public opinion view prediction task, and the trained network public opinion view analysis model is verified to obtain a network public opinion view prediction model. Among them, the same cross-entropy loss function as described above can be selected to measure the training effect. Among them, after each fine-tuning and training of the base model, the test data set can be used to verify the trained base model.
[0213] Optionally, the apparatus for constructing a network public opinion view analysis model further includes:
[0214] A seventh module 270, configured to input the basic information and several comment information of the current public opinion development stage of the to-be-predicted topic obtained into the network public opinion view prediction model, so as to output the network public opinion view and its intensity level of the current public opinion development stage of the topic.
[0215] In this alternative embodiment, through the seventh module 270 of the device, real-time multi-source network information of the current public opinion development stage of the relevant topic can also be collected from the network, the basic information and several comment information of the current public opinion development stage of the topic are extracted therefrom, and then input into the deployed network public opinion view prediction model, and the network public opinion view and its intensity level of the current public opinion development stage of the topic can be output.
[0216] Optionally, the apparatus for constructing a network public opinion view analysis model further includes:
[0217] An eighth module 280, configured to input the possible key progress information into the network public opinion view prediction model, so as to output the predicted network public opinion view and its intensity level of the next public opinion development stage of the topic after the occurrence of the possible key progress.
[0218] In this alternative embodiment, through the eighth module 280 of the device, the subsequent possible key progress information of the topic can also be input into the network public opinion view prediction model, and the network public opinion view and its intensity level of the next public opinion development stage of the topic after the occurrence of the possible key progress can be output.
[0219] Optionally, the apparatus for constructing a network public opinion view analysis model further includes:
[0220] A ninth module 290, configured to perform data structuring processing on the output of the network public opinion view prediction model, so as to save and / or visually display the output after data structuring.
[0221] In this optional embodiment, in order to facilitate the subsequent use of the output of the network public opinion view prediction model, through the ninth module 290 of the device, the output of the network public opinion view prediction model can be subjected to data structuring processing for storage, improving data storage efficiency, and / or visually displaying the output to enhance data readability. It can also facilitate the users of the output to take targeted measures based on the output.
[0222] In each of the above-described embodiments and / or optional embodiments of the device, the parts not mentioned in the method steps executed by each module are the same as those in the foregoing relevant method embodiments and / or optional embodiments, and will not be elaborated herein.
[0223] According to another aspect of the present application, there is also provided a computer-readable medium storing computer-readable instructions that can be executed by a processor to implement the foregoing method embodiments.
[0224] It should be noted that in the method embodiments and / or optional embodiments of the present application, the order of execution of each step may not be strictly limited. As long as the method embodiments and / or optional embodiments can solve the defects existing in the prior art, achieve the invention purpose of the present application, and obtain beneficial effects. The method embodiments and / or optional embodiments in the present application can be implemented in software and / or a combination of software and hardware. The software programs involved in the present application can be executed by a processor to implement the steps or functions of the foregoing embodiments. Similarly, the software programs (including related data structures) of the present application can be stored in a computer-readable recording medium.
[0225] In addition, a part or all of the present application can be applied as a computer program product. For example, computer program instructions, when executed by a computer, can call or provide the methods and / or technical solutions according to the present application through the operations of the computer. The program instructions for calling the methods of the present application may be stored in a fixed or removable recording medium, and / or transmitted through a data stream in a broadcast or other signal-bearing medium, and / or stored in the working memory of a computer device running according to the program instructions.
[0226] According to still another aspect of the present application, there is also provided a device for constructing a network public opinion view analysis model, the device including: a memory storing computer program instructions and one or more processors for executing the program instructions, wherein when the computer program instructions are executed by the processor, the device is triggered to run the methods and / or technical solutions of the foregoing embodiments.
[0227] For those skilled in the art, it is obvious that the present invention is not limited to the details of the above-mentioned exemplary embodiments, and the present invention can be implemented in other specific forms without departing from the spirit or basic characteristics of the present invention. Therefore, from any point of view, the embodiments should be regarded as exemplary and non-limiting. The scope of the present invention is defined by the appended claims rather than the above description. Therefore, all changes falling within the meaning and scope of the equivalent elements of the claims are intended to be embraced within the present invention. Any reference signs in the claims should not be construed as limiting the claims involved. In addition, it is obvious that the word "comprising" does not exclude other units or steps, and the singular does not exclude the plural. The multiple units or devices stated in the apparatus claims can also be implemented by one unit or device through software and / or hardware. The words such as "first" and "second" are used to denote names and do not denote any particular order.
Claims
1. A method for constructing an online public opinion analysis model, characterized in that: The method comprises: Obtain multi-source network information on different topics; For a public opinion development stage of a topic, extract basic information of the public opinion development stage of the topic and several comment information from the multi-source network information, and mark one or more network public opinion viewpoints and the proportion of each network public opinion viewpoint according to the several comment information, and form a first sample data with the network public opinion viewpoints and their proportions, the basic information and the several comment information, traverse each public opinion development stage of each topic, and use the obtained several first sample data as the first data set; Based on the first data set and the first preset prompt template, a pre-trained language model is trained, and the verified pre-trained language model is determined as an online public opinion analysis model, wherein the online public opinion analysis model outputs an online public opinion analysis result, which at least includes one or more online public opinion opinions corresponding to the input and their proportions, and a set of comment information included in each online public opinion opinion.
2. The method according to claim 1, characterized in that The verification of the trained pre-trained language model includes: Verification of viewpoint correspondence and consistency of clustering results.
3. The method according to claim 2, characterized in that The verification of the correspondence of the viewpoints includes: Respectively converting each annotated online public opinion opinion in the first sample data for verification and each online public opinion opinion output by the trained pre-trained language model into a sentence vector, calculating the similarity between the two in pairs, determining the annotated online public opinion opinion and the online public opinion opinion output by the model that correspond to the two with the highest similarity as a pair of matching opinions, and counting the proportion of the number of matching opinions whose similarity meets the first preset threshold; Traverse all the first sample data used for verification, count the proportion of matching opinions whose similarity meets the first preset threshold and the proportion of samples that meet the second preset threshold, and determine whether the opinion correspondence verification is passed based on the statistical results.
4. The method according to claim 2, characterized in that: The clustering result consistency verification includes: Based on all the first sample data for verification, determine the comment information set corresponding to each marked network public opinion point of view, and perform clustering processing on the comment information corresponding to the network public opinion point of view output by the trained pre-trained language model corresponding to all the first sample data for verification, to obtain a plurality of clusters corresponding to the network public opinion point of view output by the model, wherein each cluster corresponds to the comment information set corresponding to one network public opinion point of view output by the trained pre-trained language model; Calculate the similarity between a network public opinion viewpoint output by the model corresponding to each cluster and each annotated network public opinion viewpoint to determine the annotated network public opinion viewpoint corresponding to each cluster; According to the comment information sets corresponding to each cluster and the corresponding annotated online public opinion opinions, a confusion matrix is constructed to determine the consistency index of the clustering results to determine whether the clustering result consistency verification has passed.
5. The method according to claim 1, characterized in that: The method further comprises: Basic information on each stage of public opinion development for each topic, with key progress information marked; Inputting basic information of a public opinion development stage of a topic and several commentary information into the network public opinion viewpoint analysis model, obtaining a network public opinion viewpoint analysis result corresponding to the public opinion development stage of the topic, and forming a second sample data with the key progress information, the network public opinion viewpoint analysis result, the basic information of the public opinion development stage of the topic and several commentary information, traversing each public opinion development stage of each topic, and using the obtained several second sample data as the second data set; Based on the second data set and the second preset prompt template, the network public opinion analysis model is trained, and the verified trained network public opinion analysis model is determined as a network public opinion prediction model, wherein the network public opinion prediction model outputs a network public opinion prediction result, which at least includes one or more network public opinion opinions and their intensity levels corresponding to the input, and when possible progress information is input, the network public opinion prediction result also includes the predicted network public opinion opinions and their intensity levels at the next public opinion development stage after the possible key progress occurs.
6. The method according to claim 5, characterized in that The verification of the trained network public opinion analysis model includes: For a second sample data for verification, determining the strength level of each marked online public opinion opinion according to the proportion of each marked online public opinion opinion in the second sample data; Inputting the second sample data into the trained network public opinion analysis model to obtain corresponding network public opinion prediction results, wherein the network public opinion prediction results at least include one or more predicted network public opinion opinions and their intensity levels; Each annotated online public opinion viewpoint and each predicted online public opinion viewpoint are converted into sentence vectors respectively, and the similarity between the two is calculated in pairs, and the annotated online public opinion viewpoint and the predicted online public opinion viewpoint corresponding to the two with the highest similarity are determined as a pair of matching viewpoints; Evaluating the strength level of each pair of matching viewpoints to obtain an evaluation result corresponding to the second sample data; Each second sample data for verification is traversed, and according to the evaluation results of all the second sample data for verification summarized, it is determined whether the trained network public opinion analysis model has passed the verification.
7. The method according to claim 6, characterized in that The step of evaluating the strength level of each pair of matching viewpoints to obtain an evaluation result corresponding to the second sample data includes: According to the intensity level of each pair of marked online public opinion opinions and predicted online public opinion opinions, the mean absolute error and Pearson correlation coefficient of the intensity levels of all online public opinion opinions and all predicted online public opinion opinions are calculated; An evaluation result corresponding to the second sample data is determined according to the mean absolute error and the Pearson correlation coefficient.
8. The method according to claim 5, characterized in that The step of determining the pre-trained language model that has passed the verification training as the network public opinion analysis model includes: Verify multiple pre-trained language models after training. If the verification passes, obtain several online public opinion analysis models; The step of inputting basic information of a public opinion development stage of a topic and a plurality of commentary information into the network public opinion analysis model includes: Input basic information of a public opinion development stage of a topic and several commentary information into any one of the network public opinion analysis models.
9. The method according to claim 8, characterized in that The step of inputting basic information of a public opinion development stage of a topic and several commentary information into the network public opinion viewpoint analysis model to obtain the network public opinion viewpoint analysis result corresponding to the public opinion development stage of the topic, and combining the key progress information, the network public opinion viewpoint analysis result, the basic information of the public opinion development stage of the topic and several commentary information into a second sample data includes: Inputting basic information of a public opinion development stage of a topic and several comment information into each network public opinion viewpoint analysis model respectively, obtaining several network public opinion viewpoint analysis results corresponding to the public opinion development stage of the topic, and determining the final network public opinion viewpoint analysis result corresponding to the public opinion development stage of the topic based on the several network public opinion viewpoint analysis results; The key progress information, the final online public opinion analysis results, the basic information of the topic and several commentary information at the public opinion development stage are combined into a second sample data.
10. The method according to claim 9, characterized in that Determining the final online public opinion analysis result corresponding to the public opinion development stage of the topic based on the plurality of online public opinion analysis results includes: The plurality of network public opinion analysis results are processed using a voting mechanism to determine a final network public opinion analysis result corresponding to the public opinion development stage of the topic.
11. The method according to claim 5, characterized in that The method further comprises: The basic information of the current public opinion development stage of the subject to be predicted and some comment information are input into the network public opinion prediction model to output the network public opinion and its intensity level of the current public opinion development stage of the subject.
12. The method according to claim 11, characterized in that The method further comprises: The possible key development information is input into the network public opinion prediction model to output the predicted network public opinion and its intensity level for the next public opinion development stage of the topic after the possible key development occurs.
13. The method according to claim 11 or 12, characterized in that: The method further comprises: The output of the network public opinion prediction model is processed into data structure to save and / or visualize the data structured output.
14. A device for constructing an online public opinion analysis model, characterized in that: The device comprises: The first module is used to obtain multi-source network information on different topics; The second module is used to extract basic information and a number of comment information of a public opinion development stage of a topic from the multi-source network information, and mark one or more network public opinion viewpoints and the proportion of each network public opinion viewpoint according to the several comment information, and form a first sample data with the network public opinion viewpoints and their proportions, the basic information and the several comment information, traverse each public opinion development stage of each topic, and use the obtained several first sample data as the first data set; The third module is used to train a pre-trained language model based on the first data set and the first preset prompt template, and determine the verified pre-trained language model as an online public opinion analysis model, wherein the online public opinion analysis model outputs an online public opinion analysis result, which at least includes one or more online public opinion opinions corresponding to the input and their proportions, and a set of comment information included in each online public opinion opinion.
15. The device according to claim 14, characterized in that The device also includes: The fourth module is used to mark key progress information for each stage of public opinion development for each topic; The fifth module is used to input the basic information of a public opinion development stage of a topic and several comment information into the network public opinion viewpoint analysis model, obtain the network public opinion viewpoint analysis result corresponding to the public opinion development stage of the topic, and form a second sample data with the key progress information, the network public opinion viewpoint analysis result, the basic information of the public opinion development stage of the topic and several comment information, traverse each public opinion development stage of each topic, and use the obtained several second sample data as the second data set; The sixth module is used to train the network public opinion analysis model based on the second data set and the second preset prompt template, and determine the verified trained network public opinion analysis model as the network public opinion prediction model, wherein the network public opinion prediction model outputs a network public opinion prediction result, which at least includes one or more network public opinion opinions and their intensity levels corresponding to the input. When possible progress information is input, the network public opinion prediction result also includes the predicted network public opinion opinions and their intensity levels at the next public opinion development stage after the possible key progress occurs.
16. The device according to claim 15, characterized in that The device also includes: The seventh module is used to input the basic information of the current public opinion development stage of the subject to be predicted and some comment information into the network public opinion prediction model to output the network public opinion and its intensity level of the current public opinion development stage of the subject.
17. The device according to claim 16, characterized in that The device also includes: The eighth module is used to input the possible key development information into the network public opinion prediction model to output the predicted network public opinion and its intensity level at the next public opinion development stage of the topic after the possible key development occurs.
18. The device according to claim 16 or 17, characterized in that The device also includes: The ninth module is used to process the output of the network public opinion prediction model into data structure so as to save and / or visually display the output after data structure.
19. A computer readable medium, characterized in that Computer readable instructions are stored thereon, and the computer readable instructions are executed by a processor to implement the method according to any one of claims 1 to 13.
20. A device for constructing an online public opinion analysis model, characterized in that: The device comprises: one or more processors; and A memory storing computer readable instructions which, when executed, cause the processor to perform the operations of the method of any one of claims 1 to 13.