Model training method and device, prediction method and device, medium and electronic equipment
By performing feature extraction and regression model training on the influencing factors of online public opinion, predictive expert scores are generated, and subjectivity and deviation problems of expert evaluation are solved, and a more scientific and accurate evaluation of the effectiveness of public opinion crisis treatment is achieved.
Patent Information
- Application Number
- CN202410811059.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-21
- Publication Date
- 2025-02-21
AI Technical Summary
In the prior art, when quantifying the influencing factors of online public opinion through expert evaluation, there is hesitation and uncertainty in the qualitative indicators, and different experts may have different standards, with subjectivity and deviation.
A model training method is proposed to obtain network data related to historical public opinion crisis, extract feature based on the influencing factors of the public opinion crisis treatment effect, obtain sequence data and actual expert scores, perform feature screening and regression model training, and generate predictive expert scores.
This method can avoid hesitation and uncertainty of qualitative indicators, reduce the subjectivity and deviation of expert evaluation, and provide a more scientific and accurate evaluation of the effectiveness of public opinion crisis handling.
Smart Images

Figure CN119493990A_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of Internet data processing and relates to a model training method, and in particular to a model training method, prediction method, device, medium and electronic equipment. Background Art
[0002] Internet opinion crisis refers to large-scale public attention and public opinion storms caused by certain emergencies or social problems. In today's society, if an Internet opinion crisis is not handled properly, it will have a serious impact on the reputation of individuals, organizations or companies. Therefore, effective strategies and methods for handling public opinion crises are crucial. In this context, scientifically and accurately measuring the effectiveness of Internet opinion crisis handling can help individuals, organizations or companies adjust strategies in a timely manner and improve the efficiency and effectiveness of public opinion crisis handling. At present, the influencing factors of Internet public opinion are generally quantified by expert evaluation. Qualitative indicators are hesitant and uncertain, and different experts may have different standards, which may be subjective and biased. Summary of the invention
[0003] The purpose of this application is to provide a model training method, prediction method, device, medium and electronic equipment to solve the problem of quantifying the influencing factors of online public opinion by expert evaluation. Qualitative indicators are characterized by hesitation and uncertainty, and different experts may have different standards, which may lead to subjectivity and bias.
[0004] In a first aspect, the present application provides a model training method, including: obtaining network data associated with a number of historical public opinion crises; performing feature extraction processing on the network data based on factors affecting the effectiveness of public opinion crisis handling, to obtain a number of sequence data associated with the historical public opinion crisis handling effects and actual expert scores associated with the sequence data; performing feature screening on the sequence data based on the actual expert scores to obtain a number of screened sequence data; training an initial regression model based on the screened sequence data and the actual expert scores to obtain a trained regression model, and the trained regression model can be used to obtain predicted expert scores associated with the screened sequence data.
[0005] In the model training method, feature extraction is performed on network data based on factors influencing the effectiveness of public opinion crisis management, so that qualitative indicators can avoid hesitation and uncertainty, and the trained regression model can be used to predict expert scores, thereby avoiding subjectivity and bias in expert evaluations.
[0006] In one embodiment of the present application, the sequence data and the actual expert scores constitute a first feature set, and a method for performing feature screening on the sequence data based on the actual expert scores to obtain a number of screened sequence data includes: dividing the first feature set sequence data into a first training set and a first test set; performing feature screening on the sequence data based on the first training set and the first test set to obtain the screened sequence data.
[0007] In one embodiment of the present application, a method for performing feature screening on the sequence data based on the first training set and the first test set to obtain the screened sequence data includes: S1, based on the sequence data and the actual expert scores, obtaining a test statistic for each feature of the sequence data; S2, based on the test statistic, obtaining a feature to be selected; S3, based on the first sequence data and the actual expert scores, obtaining a fitting model for the first sequence data and the actual expert scores, wherein the first sequence data is sequence data associated with the feature to be selected in the first training set; S4, fitting the second sequence data to the actual expert scores through the fitting model; The sequence data is processed to obtain the prediction accuracy, and the second sequence data is the sequence data associated with the feature to be selected in the first test set; S5, if the prediction accuracy meets the preset threshold, then based on the feature to be selected, the sequence data is feature screened to obtain the screened sequence data, and the features of the screened sequence data are composed of the feature to be selected. If the prediction accuracy does not meet the preset threshold, then based on the sequence data and the actual expert score, an updated test statistic of each feature of the sequence data is obtained, and the test statistic in S2 is returned to S2, and the test statistic in S2 is the updated test statistic.
[0008] In one embodiment of the present application, a method for processing the second sequence data through the fitting model to obtain a prediction accuracy includes: predicting the second sequence data through the fitting model to obtain a prediction expert score associated with the second sequence data; and obtaining the prediction accuracy based on the prediction expert score associated with the second sequence data and the actual expert score.
[0009] In one embodiment of the present application, the regression model is a linear regression model, the screened sequence data and the actual expert scores constitute a second feature set, and the initial regression model is trained based on the screened sequence data and each of the actual expert scores to obtain a trained regression model. The implementation method includes: dividing the second feature set into a second training set and a second test set; training the initial regression model based on the second training set to obtain a trained regression model; predicting the third sequence data based on the trained regression model to obtain the predicted expert score associated with the third sequence data, wherein the third sequence data is the screened sequence data in the second test set, and the error of the initial regression model during the training process is expressed as:
[0010]
[0011] Wherein, L represents the error, m represents the number of samples in the second training set, and y (i) represents the actual expert rating of the i-th sample, x i represents the feature vector of the i-th sample, w T represents the weight vector of the feature vector, and b represents the bias.
[0012] In one embodiment of the present application, a method for obtaining network data associated with a number of historical public opinion crises includes: based on preset time thresholds and combined keywords of a number of historical public opinion crisis events, performing multi-source and multi-modal collection of network data containing relevant words in the combined keywords to obtain initial network data associated with the historical public opinion crises; performing data cleaning on the initial network data associated with the historical public opinion crises to obtain cleaned initial network data, and the network data is the cleaned initial network data.
[0013] In a second aspect, the present application provides a prediction method, comprising: based on a preset time threshold and combined keywords of a current public opinion crisis event, performing multi-source and multi-modal collection of network data containing relevant words in the combined keywords to obtain initial network data associated with the current public opinion crisis; performing data cleaning on the initial network data associated with the current public opinion crisis to obtain cleaned initial network data; performing feature extraction processing on the cleaned initial network data based on influencing factors of the public opinion crisis handling effect to obtain a number of sequence data associated with the current public opinion crisis handling effect; processing each of the sequence data according to the trained regression model described in any one of the first aspects to obtain prediction expert scores associated with each of the sequence data; and obtaining an average prediction expert score of the sequence data based on the prediction expert score.
[0014] In a third aspect, the present application provides a model training device, comprising: a network data acquisition module, used to acquire network data associated with a number of historical public opinion crises; a data feature extraction module, used to perform feature extraction processing on the network data based on the influencing factors of the public opinion crisis handling effect, and acquire a number of sequence data associated with the historical public opinion crisis handling effect and actual expert scores associated with each of the sequence data; a data feature screening module, used to perform feature screening on the sequence data based on the actual expert scores to acquire a number of screened sequence data; a regression model training module, used to train an initial regression model based on the screened sequence data and the actual expert scores to acquire a trained regression model, and the trained regression model can be used to acquire predicted expert scores associated with the screened sequence data.
[0015] In a fourth aspect, the present application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the model training method described in any one of the first aspect and / or the prediction method described in the second aspect of the present application.
[0016] In a fifth aspect, the present application provides an electronic device, comprising: a memory storing a computer program; a processor communicating with the memory, and executing the model training method described in any one of the first aspect of the present application and / or the prediction method described in the second aspect when calling the computer program.
[0017] As described above, the model training method, prediction method, device, medium and electronic device described in the present application have the following beneficial effects:
[0018] In the model training method, feature extraction is performed on network data based on factors influencing the effectiveness of public opinion crisis management, so that qualitative indicators can avoid hesitation and uncertainty, and the trained regression model can be used to predict expert scores, thereby avoiding subjectivity and bias in expert evaluations. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] Figure 1 Shown is a schematic diagram of the hardware structure of the model training method described in an embodiment of the present application.
[0020] Figure 2 Shown is a flowchart of the model training method described in an embodiment of the present application.
[0021] Figure 3 Shown is a flowchart of an implementation method of the present application for performing feature screening on each of the sequence data based on the actual expert scores to obtain a number of screened sequence data.
[0022] Figure 4Shown is a flowchart of an implementation method of the present application for performing feature screening on the sequence data based on the first training set and the first test set to obtain the screened sequence data.
[0023] Figure 5 Shown is a flowchart of an implementation method of the present application embodiment for processing the second sequence data through the fitting model to obtain prediction accuracy.
[0024] Figure 6 Shown is a flowchart of an implementation method of the present application embodiment for training an initial regression model based on the screened sequence data and the actual expert scores to obtain a trained regression model.
[0025] Figure 7 Shown is a flow chart of a method for obtaining network data associated with several historical public opinion crises according to an embodiment of the present application.
[0026] Figure 8 Shown is a flow chart of the prediction method described in an embodiment of the present application.
[0027] Fig. 9 Shown is a schematic diagram of the structure of the model training device of an embodiment of the present application.
[0028] Component number description
[0029] 10 Electronic devices
[0030] 110 Memory
[0031] 120 processors
[0032] 130 Bus
[0033] 140 Access Device
[0034] 150 Database
[0035] 900 Model Training Device
[0036] 910 Network data acquisition module
[0037] 920 Data feature extraction module
[0038] 930 Data feature screening module
[0039] 940 Regression Model Training Module
[0040] Steps S11-S14
[0041] Steps S21-S22
[0042] Steps S1-S5
[0043] S31-S32 Steps
[0044] Steps S41-S43
[0045] Steps S51-S52
[0046] Steps S61-S65 DETAILED DESCRIPTION
[0047] The following describes the embodiments of the present application through specific examples, and those skilled in the art can easily understand other advantages and effects of the present application from the contents disclosed in this specification. The present application can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present application. It should be noted that the following embodiments and features in the embodiments can be combined with each other without conflict.
[0048] It should be noted that the illustrations provided in the following embodiments are only used to illustrate the basic concept of the present application in a schematic manner, and therefore the illustrations only show components related to the present application rather than being drawn according to the number, shape and size of components in actual implementation. In actual implementation, the type, quantity and proportion of each component may be changed arbitrarily, and the component layout may also be more complicated.
[0049] The technical solutions in the embodiments of the present application are described in detail below in conjunction with the drawings in the embodiments of the present application.
[0050] The model training method and / or prediction method provided in the embodiments of the present application can be run in a computing device. Figure 1 For example, Figure 1 The hardware structure block diagram of the computing device for running the model training method and / or the prediction method. The computing device 10 includes but is not limited to a memory 110 and a processor 120. The processor 120 is connected to the memory 110 via a bus 130, and the database 150 is used to store data.
[0051] The computing device 10 also includes an access device 140 that enables the computing device 10 to communicate via one or more networks 160. Examples of these networks include a public switched telephone network, a local area network, a wide area network, a personal area network, or a combination of communication networks such as the Internet. The access device 140 may include any type of network interface, wired or wireless, for example, one or more of a network interface card, such as an IEEE 802.11 wireless LAN wireless interface, a global microwave interconnection access interface, an Ethernet interface, a universal serial bus interface, a cellular network interface, a Bluetooth interface, a near field communication interface, and the like.
[0052] In the embodiment of the present application, the above components of the computing device 10 and Figure 1 Other components not shown in the figure may also be connected to each other, for example, via a bus. It should be understood that Figure 1 The computing device structure block diagram shown is only for the purpose of illustration, and is not intended to limit the scope of the present application. Those skilled in the art may add or replace other components as needed.
[0053] The computing device 10 may be any type of stationary or mobile computing device, including a mobile computer or mobile computing device (e.g., a tablet computer, a personal digital assistant, a laptop computer, a notebook computer, a netbook, etc.), a mobile phone (e.g., a smart phone), a wearable computing device (e.g., a smart watch, smart glasses, etc.), or other types of mobile devices, or a stationary computing device such as a desktop computer or PC. The computing device 10 may also be a mobile or stationary server.
[0054] like Figure 2 As shown, this embodiment provides a model training method, including:
[0055] S11, obtaining network data related to several historical public opinion crises.
[0056] Optionally, the historical public opinion crisis may refer to a historical network public opinion crisis event that is in the period of public opinion subsiding, and the network data may be data from a multi-platform and multi-modal network, for example, the network data may be from platforms such as Weibo, WeChat (public account), client, website, forum, video, electronic newspaper, etc., and may include multiple modalities such as text, pictures, video, short links, etc. The network data may be network data on 77 historical network public opinion crisis events that are in the period of public opinion subsiding.
[0057] S12, performing feature extraction processing on the network data based on the influencing factors of the public opinion crisis handling effect, and obtaining a number of sequence data associated with the historical public opinion crisis handling effect and actual expert scores associated with each of the sequence data.
[0058] Optionally, the network data is subjected to feature extraction processing based on the influencing factors of the effect of public opinion crisis handling, and a method for obtaining a number of sequence data associated with the historical public opinion crisis handling effect and actual expert scores associated with each of the sequence data includes: based on the influencing factors of the effect of public opinion crisis handling, the network data is subjected to feature extraction processing by methods such as text mining, sentiment analysis, and topic modeling to obtain the sequence data; and the actual expert scores associated with each of the sequence data are obtained. The sequence data may include the values of the quantitative features associated with the influencing factors in units of preset time, and the sequence data is data extracted from the features of the network data. For example, the sequence data may include the values of the quantitative features associated with the influencing factors in units of 24 hours. In this embodiment, there are 12 influencing factors in total, and the sequence data contains a total of 98 features.
[0059] Optionally, the actual expert rating can be a score of multiple experts based on their professional knowledge and experience, through statistical analysis of historical public opinion crisis data and public opinion opinions, with the preset time as the unit, on the historical public opinion crisis handling effect from four aspects: public opinion risk evolution, public opinion sentiment evolution, public opinion calming situation and handling timeliness, and then a comprehensive calculation of the scores of the handling effects of each historical public opinion crisis for several preset time periods. For example, if the preset time period is 24 hours, the scores of the handling effects of each historical public opinion crisis for several 24 hours are comprehensively calculated.
[0060] Optionally, the model training method further comprises: performing standardization processing on the sequence data to obtain standardized sequence data. The values in the standardized sequence data are all within the interval [0, 100]. The standardization process can be expressed as:
[0061]
[0062] Among them, y m It represents the data after the standardization of the mth original data of the xth feature in the sequence data, x m represents the mth original data of the xth feature, x j represents the jth original data of the xth feature, n represents the number of data samples in the sequence data, min{x j} is the minimum value of all the eigenvalues of the xth feature in the sequence data before standardization, max{x j} is the maximum value of all feature values before standardization of the x-th feature in the sample sequence data.
[0063] Optionally, the influencing factors may include: public opinion crisis category, public opinion crisis subject, public opinion crisis theme, dissemination volume and dissemination scope, information content and form, emotional tendency and direction, dissemination path, etc., as well as notification content and form, notification dissemination volume and dissemination scope, emotional tendency and direction of notification-related information, notification-related information dissemination path, processing timeliness, etc.
[0064] Optionally, taking the influencing factor of the amount and scope of dissemination as an example, its quantitative characteristics include the amount of original information in the entire network, the amount of forwarded information in the entire network, the amount of comment information in the entire network, the amount of media reports, the network communication heat index (refers to the extraction of relevant information about designated events, people, brands, regions, etc. on the basis of massive multimodal information on the Internet platform, and the extraction of relevant information, and the extraction of information is standardized. The index reflects the attention it receives on the Internet), the proportion of special regional information, and the proportion of information on the place where the incident occurred.
[0065] Optionally, taking the influencing factor of information content and form as an example, its quantitative characteristics include the average number of words in original information, the average number of words in forwarded information, the average number of words in comment information, the proportion of information including only short links, the proportion of information including only videos, the proportion of information including only pictures, the proportion of information including short links and videos, the proportion of information including short links and pictures, the proportion of information including videos and pictures, the proportion of information including short links, videos and pictures, and the proportion of information originating from video platforms.
[0066] Optionally, taking the influencing factor of information sentiment tendency and direction as an example, its quantitative characteristics include the amount of positive original information, the amount of positive forwarded information, the amount of positive comment information, the amount of negative original information, the amount of negative forwarded information, the amount of negative comment information, the amount of negative information directed to the country (including original, forwarded and commented), the amount of negative information directed to party and government agencies, and the amount of negative information directed to enterprises, universities and other organizations.
[0067] Optionally, taking the influencing factor of communication path as an example, its quantitative characteristics include the proportion of central-level media reports (central-level media reports / total network information volume), the proportion of provincial-level media reports, the proportion of prefecture-level media reports, the proportion of original information of personal certified users (personal certified users of official accounts, Toutiao accounts, Weibo and other platforms), the proportion of information forwarded by personal certified users, the proportion of commented information by personal certified users, the proportion of forwarded messages by personal certified users, the proportion of commented messages by personal certified users, and the proportion of likes by personal certified users.
[0068] Optionally, taking the influencing factor of public opinion crisis theme as an example, the network data of historical network public opinion crisis events are subject to theme classification through the existing theme clustering model, and its quantitative characteristics include the amount of information on social themes (involving social livelihood, moral ethics, public safety, etc.), the amount of information on corporate themes (involving corporate image, product quality, business behavior, etc.), and the amount of information on natural disaster themes (involving earthquakes, floods, droughts, etc.).
[0069] Optionally, the influencing factors of relevant handling measures include the content and form of the notification, the amount and scope of notification dissemination, the emotional tendency and direction of the notification-related information, the dissemination path of the notification-related information, and the processing timeliness. The data on notifications and responses are extracted from all the data on historical network public opinion crises by keywords, and the data on the characteristics of their content and form are calculated. Taking the processing timeliness as an example, its quantitative characteristics include the notification timeliness (the number of hours from the notification time to the original time of the public opinion crisis) and the notification dissemination time (the number of hours from the time of the current statistical unit to the notification time).
[0070] S13, performing feature screening on the sequence data based on the actual expert scores to obtain a number of screened sequence data.
[0071] Optionally, the features in the filtered sequence data consist of features that have a significant impact on the effect of handling public opinion crises.
[0072] Preferably, the screened sequence data contains 17 features, namely: the amount of social theme information and the amount of corporate theme information in the "opinion crisis theme" influencing factors; the amount of original information on the entire network, the amount of comment information on the entire network, the amount of media coverage, and the network communication heat index in the "dissemination amount and dissemination scope" influencing factors; the proportion of information that only includes videos, the proportion of information that only includes pictures, and the proportion of information from video platforms in the "information content and form" influencing factors; the amount of negative original information, the amount of negative comment information, and the amount of negative information directed to organizations such as enterprises and universities in the "emotional tendency and orientation" influencing factors; the notification timeliness in the "handling timeliness" influencing factors; the amount of negative original information, the amount of negative comment information, the amount of negative information directed to party and government agencies, and the amount of negative information directed to organizations such as enterprises and universities in the "emotional tendency and orientation of notification related information" influencing factors.
[0073] S14, training the initial regression model based on the screened sequence data and the actual expert scores to obtain a trained regression model, wherein the trained regression model can be used to obtain the predicted expert scores associated with the screened sequence data.
[0074] Optionally, the initial regression model may be an initial linear regression model, and the trained regression model may be a trained linear regression model.
[0075] This embodiment provides a model training method, including: obtaining network data associated with a number of historical public opinion crises; performing feature extraction processing on the network data based on factors affecting the effectiveness of public opinion crisis handling, to obtain a number of sequence data associated with the historical public opinion crisis handling effects and actual expert scores associated with the sequence data; performing feature screening on the sequence data based on the actual expert scores to obtain a number of screened sequence data; training an initial regression model based on the screened sequence data and the actual expert scores to obtain a trained regression model, wherein the trained regression model is used to obtain predicted expert scores associated with each of the screened sequence data.
[0076] According to the above description, in the model training method, by performing feature extraction processing on network data based on the influencing factors of the public opinion crisis handling effect, qualitative indicators can avoid hesitation and uncertainty characteristics, and the trained regression model can be used to predict expert scores, which can avoid the subjectivity and bias of expert evaluation.
[0077] like Figure 3 As shown, this embodiment provides a method for performing feature screening on each of the sequence data based on the actual expert score to obtain a plurality of screened sequence data, including:
[0078] S21, dividing the first feature set sequence data into a first training set and a first test set.
[0079] Optionally, the first training set consists of sequence data for training and actual expert scores, and the first test set consists of sequence data for testing and actual expert scores.
[0080] Optionally, the sequence data and the actual expert scores may constitute a first feature set, and the first feature set may be divided into the first training set and the first test set in a ratio of 7:3.
[0081] S22: Perform feature screening on the sequence data based on the first training set and the first test set to obtain the screened sequence data.
[0082] Optionally, the features in the filtered sequence data may consist of features in the sequence data that have a significant impact on the effect of handling public opinion crises.
[0083] like Figure 4 As shown, this embodiment provides a method for performing feature screening on the sequence data based on the first training set and the first test set to obtain the screened sequence data, including:
[0084] S1. Based on the sequence data and the actual expert scores, obtain a test statistic for each feature of the sequence data.
[0085] Optionally, the test statistic may be an F value of an F test.
[0086] Optionally,
[0087]
[0088] Where n represents the number of sequence data, x i Can be one of the features in the i-th sequence data, can be the average value of the feature in the sequence data, i The actual expert score associated with the i-th sequence data can be, can be the average value of the actual expert score associated with the sequence data, b can be expressed as the slope of the feature association, and c can be expressed as the intercept of the feature association. For example, there are two groups of sequence data, namely (1, 2, 3, 4, 5) and (2, 3, 4, 5, 6). The actual expert score associated with the first group of sequence data is 10, and the actual expert score associated with the second group of sequence data is 20. Then the final b is 10 and c=0. According to the above process, it can be known that b, i.e., the slope, and c, i.e., the intercept, of each feature association in the sequence data. According to b and c, we can get Further available:
[0089]
[0090] in, That is x i The associated prediction expert rating, According to the above Obtained, this embodiment will not be repeated.
[0091] According to the above process, the F value of each feature in the sequence data, that is, the test statistic, can be known, which will not be described in detail in this embodiment.
[0092] S2: Based on the test statistic, obtain the feature to be selected.
[0093] Optionally, the feature to be selected may refer to a feature with higher significance in the test statistic.
[0094] S3, based on the first sequence data and the actual expert scores, obtaining a fitting model of the first sequence data and the actual expert scores, wherein the first sequence data is sequence data associated with the feature to be selected in the first training set.
[0095] Optionally, the sequence data associated with the feature to be selected may refer to sequence data including the feature to be selected.
[0096] Optionally, the fitting model may refer to a model obtained after fitting the first sequence data and the actual expert scores, wherein the fitting process is not described in detail in this embodiment.
[0097] S4, processing the second sequence data by the fitting model to obtain a prediction accuracy, wherein the second sequence data is the sequence data associated with the feature to be selected in the first test set.
[0098] S5, if the prediction accuracy meets the preset threshold, then based on the features to be selected, feature screening is performed on the sequence data to obtain screened sequence data, and the features of the screened sequence data are composed of the features to be selected; if the prediction accuracy does not meet the preset threshold, then based on the sequence data and the actual expert scores, an updated test statistic of each feature of the sequence data is obtained, and the process returns to S2, where the test statistic in S2 is the updated test statistic.
[0099] Optionally, the preset threshold may be flexibly set according to actual conditions, for example, it may be 15%, and this embodiment does not explicitly limit this.
[0100] Optionally, the updated test statistic may be a test statistic after updating the significance level. When the test statistic is updated, the feature to be selected will also be updated accordingly.
[0101] By retaining the features that have a significant impact on the effectiveness of handling public opinion crisis events, on the one hand, redundant features are removed and the computational cost is reduced, and on the other hand, other features that may have a significant impact on the effectiveness of handling public opinion crises are avoided from being ignored.
[0102] like Figure 5 As shown, this embodiment provides a method for processing the second sequence data by using the fitting model to obtain the prediction accuracy, including:
[0103] S31, predicting the second sequence data by using the fitting model to obtain a prediction expert score of the second sequence data.
[0104] S32, obtaining the prediction accuracy based on the predicted expert score and the actual expert score associated with the second sequence data.
[0105] Optionally, the prediction accuracy rate may be expressed as (1-prediction error rate), and the prediction error rate may be expressed as (prediction expert score-actual expert score) / absolute value of actual expert score.
[0106] like Figure 6 As shown, this embodiment provides a method for training an initial regression model based on the screened sequence data and the actual expert scores to obtain a trained regression model, including:
[0107] S41, dividing the second feature set into a second training set and a second test set.
[0108] S42: Train the initial regression model based on the second training set to obtain a trained regression model.
[0109] S43, predicting the third sequence data based on the trained regression model to obtain the prediction expert score associated with the third sequence data, wherein the third sequence data is the screened sequence data in the second test set, and the error of the initial regression model during the training process is expressed as:
[0110]
[0111] Wherein, L represents the error, m represents the number of samples in the second training set, and y (i) represents the actual expert rating of the i-th sample, x i represents the feature vector of the i-th sample, w T represents the weight vector of the feature vector, and b represents the bias.
[0112] Optionally, the regression model is a linear regression model, and the trained regression model can be expressed as:
[0113]
[0114] in, and f(x) both represent the prediction expert score, n represents the number of features in the filtered sequence data, and x i represents the i-th feature, w i represents the weight of the i-th feature, and b represents the bias.
[0115] like Figure 7 As shown, this embodiment provides a method for obtaining network data associated with a number of historical public opinion crises, including:
[0116] S51, based on preset time thresholds and combined keywords of several historical public opinion crisis events, multi-source and multi-modal collection of network data containing relevant words in the combined keywords is performed to obtain initial network data associated with the historical public opinion crisis.
[0117] Optionally, the preset time threshold can be flexibly set according to the life cycle of public opinion crisis from the generation to the disappearance, which is not explicitly limited in this embodiment. The combined keywords can be flexibly set according to historical public opinion crisis events, which is not explicitly limited in this embodiment.
[0118] Optionally, the multi-source multi-modal acquisition may refer to the acquisition of multiple sources and multiple data modalities, such as multiple sources such as Weibo and WeChat, and multiple data modalities such as text and pictures.
[0119] Optionally, the initial network data is network data integrated after multi-source and multi-modal collection of network data containing relevant words in the combined keyword.
[0120] S52, performing data cleaning on the initial network data associated with the historical public opinion crisis to obtain cleaned initial network data, wherein the network data is the cleaned initial network data.
[0121] Optionally, data cleaning of the initial network data associated with the historical public opinion crisis may refer to removing junk data or invalid data that is not related to the historical network public opinion crisis event.
[0122] like Figure 8 As shown, this embodiment provides a prediction method, including:
[0123] S61, based on the preset time threshold and combined keywords of the current public opinion crisis event, multi-source and multi-modal collection of network data containing relevant words in the combined keywords is performed to obtain initial network data associated with the current public opinion crisis.
[0124] S62, performing data cleaning on the initial network data associated with the current public opinion crisis to obtain cleaned initial network data.
[0125] S63, performing feature extraction processing on the cleaned initial network data based on the influencing factors of the public opinion crisis handling effect, so as to obtain a number of sequence data associated with the current public opinion crisis handling effect.
[0126] S64, processing each of the sequence data according to the trained regression model to obtain a prediction expert score associated with each of the sequence data.
[0127] S65, based on the prediction expert score, obtaining an average prediction expert score associated with the sequence data.
[0128] Optionally, the average predicted expert score associated with the sequence data may refer to an average value of the predicted expert scores associated with the sequence data, and the average predicted expert score may be used as a measure of the current public opinion crisis event.
[0129] The protection scope of the model training method and / or prediction method described in the embodiments of the present application is not limited to the execution order of the steps listed in the embodiments. All solutions implemented by adding, reducing or replacing steps in the prior art based on the principles of the present application are included in the protection scope of the present application.
[0130] like Fig. 9 As shown, this embodiment provides a model training device 900, including:
[0131] The network data acquisition module 910 is used to acquire network data associated with a number of historical public opinion crises.
[0132] The data feature extraction module 920 is used to perform feature extraction processing on the network data based on the influencing factors of the public opinion crisis handling effect, and obtain a number of sequence data associated with the historical public opinion crisis handling effect and actual expert scores associated with each of the sequence data.
[0133] The data feature screening module 930 is used to perform feature screening on the sequence data based on the actual expert scores to obtain a number of screened sequence data.
[0134] The regression model training module 940 is used to train the initial regression model based on the screened sequence data and the actual expert scores to obtain a trained regression model, and the trained regression model can be used to obtain the predicted expert scores associated with the screened sequence data.
[0135] In the model training device 900 provided in this embodiment, the network data acquisition module 910 and Figure 2 The data feature extraction module 920 corresponds to step S11 of the model training method shown in FIG. Figure 2 The data feature screening module 930 corresponds to step S12 of the model training method shown in FIG. Figure 2 The model training method shown in step S13 corresponds to the regression model training module 940. Figure 2 This corresponds to step S14 of the model training method shown.
[0136] In the several embodiments provided in the present application, it should be understood that the disclosed device or method can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of modules / units is only a logical function division. There may be other division methods in actual implementation, such as multiple modules or units can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or modules or units, which can be electrical, mechanical or other forms.
[0137] The modules / units described as separate components may or may not be physically separated, and the components displayed as modules / units may or may not be physical modules, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules / units may be selected according to actual needs to achieve the purpose of the embodiments of the present application. For example, the functional modules / units in the various embodiments of the present application may be integrated into one processing module, or each module / unit may exist physically separately, or two or more modules / units may be integrated into one module / unit.
[0138] Those of ordinary skill in the art should further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0139] This embodiment provides an electronic device, the electronic device comprising a memory storing a computer program; a processor connected to the memory for communication, and executing the computer program when the computer program is called. Figure 2 The model training method shown and / or Figure 8 The prediction method shown.
[0140] The present application embodiment also provides a computer-readable storage medium. A person of ordinary skill in the art can understand that all or part of the steps in the method for implementing the above embodiment can be completed by a program to instruct the processor, and the program can be stored in a computer-readable storage medium, and the storage medium is a non-transitory medium, such as a random access memory, a read-only memory, a flash memory, a hard disk, a solid-state hard disk, a magnetic tape, a floppy disk, an optical disc, and any combination thereof. The above storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server or a data center that includes one or more available media integrated. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a digital video disc (DVD)), or a semiconductor medium (e.g., a solid-state hard disk (SSD)), etc.
[0141] The present application embodiment may also provide a computer program product, the computer program product including one or more computer instructions. When the computer instructions are loaded and executed on a computing device, the process or function described in the embodiment of the present application is generated in whole or in part. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be transmitted from a website site, computer or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer or data center.
[0142] When the computer program product is executed by a computer, the computer executes the method described in the above method embodiment. The computer program product may be a software installation package, and when the above method is required, the computer program product may be downloaded and executed on a computer.
[0143] The descriptions of the processes or structures corresponding to the above-mentioned figures have different emphases. For parts that are not described in detail in a certain process or structure, please refer to the relevant descriptions of other processes or structures.
[0144] The above embodiments are merely illustrative of the principles and effects of the present application and are not intended to limit the present application. Anyone familiar with the technology may modify or change the above embodiments without violating the spirit and scope of the present application. Therefore, all equivalent modifications or changes made by a person of ordinary skill in the art without departing from the spirit and technical ideas disclosed in the present application shall still be covered by the claims of the present application.
Claims
1. A model training method, characterized in that: include: Obtain network data related to several historical public opinion crises; Perform feature extraction processing on the network data based on the influencing factors of the public opinion crisis handling effect, and obtain a number of sequence data associated with the historical public opinion crisis handling effect and actual expert scores associated with each of the sequence data; Performing feature screening on the sequence data based on the actual expert scores to obtain a number of screened sequence data; Based on the screened sequence data and the actual expert scores, an initial regression model is trained to obtain a trained regression model, and the trained regression model can be used to obtain predicted expert scores associated with the screened sequence data.
2. The model training method according to claim 1, characterized in that: The sequence data and the actual expert scores constitute a first feature set, and a method for performing feature screening on the sequence data based on the actual expert scores to obtain a plurality of screened sequence data includes: Dividing the first feature set sequence data into a first training set and a first test set; Feature screening is performed on the sequence data based on the first training set and the first test set to obtain the screened sequence data.
3. The model training method according to claim 2, characterized in that: The method for implementing feature screening of the sequence data based on the first training set and the first test set to obtain the screened sequence data includes: S1, based on the sequence data and the actual expert scores, obtaining a test statistic for each feature of the sequence data; S2, obtaining features to be selected based on the test statistic; S3, based on first sequence data and the actual expert scores, obtaining a fitting model of the first sequence data and the actual expert scores, wherein the first sequence data is sequence data associated with the feature to be selected in the first training set; S4, processing the second sequence data by the fitting model to obtain a prediction accuracy, wherein the second sequence data is sequence data associated with the feature to be selected in the first test set; S5, if the prediction accuracy meets the preset threshold, then based on the features to be selected, feature screening is performed on the sequence data to obtain screened sequence data, and the features of the screened sequence data are composed of the features to be selected; if the prediction accuracy does not meet the preset threshold, then based on the sequence data and the actual expert scores, an updated test statistic of each feature of the sequence data is obtained, and the process returns to S2, where the test statistic in S2 is the updated test statistic.
4. The model training method according to claim 3, characterized in that: The method for processing the second sequence data by the fitting model to obtain the prediction accuracy includes: Predicting the second sequence data by using the fitting model to obtain a prediction expert score associated with the second sequence data; The prediction accuracy is obtained based on the predicted expert score and the actual expert score associated with the second sequence data.
5. The model training method according to claim 1, characterized in that: The regression model is a linear regression model, the screened sequence data and the actual expert scores constitute a second feature set, and the initial regression model is trained based on the screened sequence data and the actual expert scores to obtain a trained regression model. The implementation method includes: Dividing the second feature set into a second training set and a second test set; Training the initial regression model based on the second training set to obtain a trained regression model; The third sequence data is predicted based on the trained regression model to obtain the prediction expert score associated with the third sequence data, wherein the third sequence data is the screened sequence data in the second test set, and the error of the initial regression model during the training process is expressed as: Wherein, L represents the error, m represents the number of samples in the second training set, and y (i) represents the actual expert rating of the i-th sample, x i represents the feature vector of the i-th sample, w T represents the weight vector of the feature vector, and b represents the bias.
6. The model training method according to claim 1, characterized in that: The implementation method of obtaining network data related to several historical public opinion crises includes: Based on preset time thresholds and combined keywords of several historical public opinion crisis events, multi-source and multi-modal collection of network data containing relevant words in the combined keywords is performed to obtain initial network data associated with the historical public opinion crisis; The initial network data associated with the historical public opinion crisis is cleansed to obtain cleansed initial network data, and the network data is the cleansed initial network data.
7. A prediction method, characterized in that: include: Based on the preset time threshold and combined keywords of the current public opinion crisis event, multi-source and multi-modal collection of network data containing relevant words in the combined keywords is performed to obtain initial network data associated with the current public opinion crisis; Cleaning the initial network data associated with the current public opinion crisis to obtain cleaned initial network data; Based on the influencing factors of the public opinion crisis handling effect, feature extraction processing is performed on the cleaned initial network data to obtain a number of sequence data associated with the current public opinion crisis handling effect; Processing each of the sequence data according to the trained regression model according to any one of claims 1 to 6 to obtain a prediction expert score associated with each of the sequence data; Based on the prediction expert score, an average prediction expert score of the sequence data is obtained.
8. A model training device, characterized in that: include: A network data acquisition module, used to acquire network data related to several historical public opinion crises; A data feature extraction module, used to perform feature extraction processing on the network data based on the influencing factors of the public opinion crisis handling effect, and obtain a number of sequence data associated with the historical public opinion crisis handling effect and actual expert scores associated with each of the sequence data; A data feature screening module, used for performing feature screening on the sequence data based on the actual expert scores to obtain a number of screened sequence data; The regression model training module is used to train the initial regression model based on the screened sequence data and the actual expert scores to obtain a trained regression model, and the trained regression model can be used to obtain the predicted expert scores associated with the screened sequence data.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, it implements the model training method described in any one of claims 1 to 6 and / or the prediction method described in claim 7.
10. An electronic device, characterized in that: The electronic device comprises: A memory storing a computer program; A processor is communicatively connected to the memory, and executes the model training method described in any one of claims 1 to 7 and / or the prediction method described in claim 7 when calling the computer program.