Policy strength analysis method, device, computer equipment and storage medium
Through emotional vocabulary analysis, we solve the problem of policy intensity analysis in the policy field, realize the numerical evaluation of policy intensity, and provide accurate analysis of policy intensity.
Patent Information
- Application Number
- CN201811431271.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2018-11-26
- Publication Date
- 2024-09-17
- Estimated Expiration
- 2038-11-26
AI Technical Summary
Existing sentiment analysis technology cannot meet the needs of the policy field and cannot effectively analyze policy intensity.
By obtaining the preset emotional lexicon of each policy type, the policy type of the policy data to be processed is determined, and the policy intensity is calculated based on the number of occurrences of the emotional words in the emotional lexicon to achieve a numerical evaluation of the policy intensity.
It realizes policy strength analysis based on sentiment analysis in the policy field and provides accurate and reliable numerical evaluation of policy strength.
Smart Images

Figure CN109635287B
Abstract
Description
Technical Field
[0001] The present application relates to the field of big data technology, and in particular to a method, apparatus, computer equipment and storage medium for analyzing policy strength. Background Art
[0002] With the development of big data technology, sentiment analysis technology has emerged. Sentiment analysis refers to the process of analyzing, processing, summarizing and reasoning subjective texts with emotional colors, and classifying texts into two or more types of praise or derogatory based on the meaning and emotional information expressed in the text.
[0003] Sentiment analysis technology can be applied to multiple scenarios, but in the policy field, the currently commonly used sentiment analysis technology cannot meet the needs. Summary of the invention
[0004] Based on this, it is necessary to provide a method, device, computer equipment and storage medium that can realize policy strength analysis based on sentiment analysis in the policy field in response to the above technical problems.
[0005] A method for analyzing policy strength, the method comprising:
[0006] Obtain the preset sentiment word library for each policy type;
[0007] Obtaining policy data to be processed, and determining a target policy type corresponding to a policy type of the policy data to be processed;
[0008] Determine the sentiment word library of the target policy type according to the preset sentiment word library of each policy type;
[0009] The score of the policy data to be processed is determined according to the sentiment word library of the target policy type, and the policy strength is determined according to the score of the policy data to be processed.
[0010] In one embodiment, before obtaining the preset sentiment word library of each policy type, it includes:
[0011] Obtain a historical policy data set, a preset policy dimension, and a seed word of the preset policy dimension;
[0012] According to the seed words of the policy dimension, the historical policy data set is traversed to determine the sentiment word set of each policy dimension;
[0013] According to the preset scoring criteria, the score of the sentiment word of each policy dimension in the sentiment word set of each policy dimension is determined;
[0014] Based on the sentiment word set of each policy dimension, a sentiment word library of the policy type corresponding to each policy dimension is generated.
[0015] In one embodiment, based on the seed words of the policy dimension, the historical policy data set is traversed to determine the sentiment word set of each policy dimension, including:
[0016] Get the words in the historical policy data set and generate word vectors corresponding to the words;
[0017] Determine a first category of word sets whose word vector distances from the seed words of the policy dimension are within a preset distance threshold range;
[0018] According to the seed words and the first category of word sets of the policy dimension, the historical policy data set is traversed to determine the sentiment word set of each policy dimension;
[0019] Among them, according to the seed words and the first category of word sets of the policy dimension, the historical policy data set is traversed to determine the sentiment word sets of each policy dimension, including:
[0020] Split the historical policy data in the historical policy data set into complete sentences;
[0021] According to the seed words of the policy dimension and the first-category words in the first-category word set, the split complete sentences are traversed to determine the target sentence;
[0022] Counting the number of occurrences of each word in the target sentence, and determining the words whose number of occurrences is greater than a preset number threshold as the second category of words;
[0023] According to the second category of words, determining a second category of word set;
[0024] Based on the first category word set and the second category word set, the sentiment word set of each policy dimension is determined.
[0025] In one embodiment, according to a preset scoring standard, determining the score of each policy dimension sentiment word in the sentiment word set of each policy dimension includes:
[0026] Determine the word vector distance between the sentiment word of each policy dimension in the sentiment word set of each policy dimension and the seed word of the corresponding policy dimension;
[0027] According to the word vector distance and the preset scoring criteria, the score of the sentiment word of each policy dimension in the sentiment word set of each policy dimension is determined.
[0028] In one embodiment, generating a sentiment word library of a policy type corresponding to each policy dimension according to the sentiment word set of each policy dimension includes:
[0029] According to the preset policy type identifier carried by each policy dimension, determine the policy type corresponding to each policy dimension;
[0030] Generate a sentiment word library of policy types corresponding to each policy dimension;
[0031] The sentiment word set of each policy dimension is stored in the sentiment word library of the policy type corresponding to each policy dimension.
[0032] In one embodiment, obtaining the policy data to be processed and determining the target policy type corresponding to the policy type of the policy data to be processed includes:
[0033] Obtaining policy data to be processed and extracting features of the policy data to be processed;
[0034] According to the characteristics of the policy data to be processed, a preset characteristic database is matched to determine the policy type of the policy data to be processed;
[0035] According to the policy type of the policy data to be processed, a preset policy type database is matched to determine the target policy type corresponding to the policy type of the policy data to be processed.
[0036] In one embodiment, the score of the policy data to be processed is determined according to the sentiment word library of the target policy type, and the policy strength is determined according to the score of the policy data to be processed, including:
[0037] According to the policy dimension sentiment words in the sentiment word library of the target policy type, traverse the policy data to be processed;
[0038] Count the number of times the policy dimension sentiment words in the sentiment word library appear in the policy data to be processed;
[0039] According to the number of occurrences, the score of the policy data to be processed is determined;
[0040] Determine the policy strength based on the score of the policy data to be processed.
[0041] A device for analyzing policy strength, comprising:
[0042] The first acquisition module is used to acquire a preset sentiment word library of each policy type;
[0043] A second acquisition module is used to acquire the policy data to be processed and determine the target policy type corresponding to the policy type of the policy data to be processed;
[0044] The first processing module is used to determine the sentiment word library of the target policy type according to the preset sentiment word library of each policy type;
[0045] The second processing module is used to determine the score of the policy data to be processed according to the sentiment word library of the target policy type, and determine the policy strength according to the score of the policy data to be processed.
[0046] A computer device comprises a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:
[0047] Obtain the preset sentiment word library for each policy type;
[0048] Obtaining policy data to be processed, and determining a target policy type corresponding to a policy type of the policy data to be processed;
[0049] Determine the sentiment word library of the target policy type according to the preset sentiment word library of each policy type;
[0050] The score of the policy data to be processed is determined according to the sentiment word library of the target policy type, and the policy strength is determined according to the score of the policy data to be processed.
[0051] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements the following steps:
[0052] Obtain the preset sentiment word library for each policy type;
[0053] Obtaining policy data to be processed, and determining a target policy type corresponding to a policy type of the policy data to be processed;
[0054] Determine the sentiment word library of the target policy type according to the preset sentiment word library of each policy type;
[0055] The score of the policy data to be processed is determined according to the sentiment word library of the target policy type, and the policy strength is determined according to the score of the policy data to be processed.
[0056] The above-mentioned policy strength analysis method, device, computer equipment and storage medium obtain preset sentiment word libraries of each policy type, obtain the policy data to be processed, determine the target policy type corresponding to the policy type of the policy data to be processed, determine the sentiment word library of the target policy type, determine the score of the policy data to be processed according to the sentiment word library of the target policy type, determine the policy strength according to the score of the policy data to be processed, in the policy field, determine the score of the policy to be processed through the sentiment word library, determine the policy strength according to the score of the policy to be processed, realize numerical evaluation of policy strength through the score, and realize policy strength analysis based on sentiment analysis. BRIEF DESCRIPTION OF THE DRAWINGS
[0057] Figure 1 An application scenario diagram of a method for analyzing policy strength in an embodiment;
[0058] Figure 2 A flowchart of a method for analyzing policy strength in one embodiment;
[0059] Figure 3 In one embodiment Figure 2 Schematic diagram of the process of the steps before step S202;
[0060] Figure 4 In one embodiment Figure 3 Schematic diagram of the sub-process of step S304;
[0061] Figure 5 In one embodiment Figure 4 Schematic diagram of the sub-process of step S406;
[0062] Figure 6 In one embodiment Figure 3 Schematic diagram of the sub-process of step S306;
[0063] Figure 7 In one embodiment Figure 3 Schematic diagram of the sub-process of step S308;
[0064] Figure 8 In one embodiment Figure 2 Schematic diagram of the sub-process of step S204;
[0065] Fig. 9 In one embodiment Figure 2 Schematic diagram of the sub-process of step S208;
[0066] Fig.10 A structural block diagram of a device for analyzing policy strength in one embodiment;
[0067] Fig.11 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0068] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0069] The policy strength analysis method provided in this application can be applied to Figure 1In the application environment shown. Among them, the terminal 102 communicates with the server 104 through the network. The server 104 obtains the preset sentiment word library of each policy type, obtains the policy data to be processed, determines the target policy type corresponding to the policy type of the policy data to be processed, determines the sentiment word library of the target policy type according to the preset sentiment word library of each policy type, determines the score of the policy data to be processed according to the sentiment word library of the target policy type, determines the policy strength according to the score of the policy data to be processed, and pushes the score of the policy data to be processed and the policy strength to the terminal 102. Among them, the terminal 102 can be but not limited to various personal computers, laptops, smart phones, tablet computers and portable wearable devices, and the server 104 can be implemented by an independent server or a server cluster composed of multiple servers.
[0070] In one embodiment, Figure 2 As shown in the figure, a method of policy intensity analysis is provided, which can be applied to Figure 1 The server in the example is used to illustrate the following steps:
[0071] S202: Obtain a preset sentiment word library for each policy type.
[0072] The sentiment word library of each policy type refers to the set of sentiment word sets of each policy dimension corresponding to each policy type. Each policy type and each policy dimension can be set accordingly as needed. The sentiment word set of each policy dimension includes multiple policy dimension sentiment words whose scores have been determined according to predetermined scoring criteria.
[0073] S204: Acquire the policy data to be processed, and determine the target policy type corresponding to the policy type of the policy data to be processed.
[0074] The server obtains the policy data to be processed, determines the policy type of the policy data to be processed, matches a preset policy type database according to the policy type of the policy data to be processed, and determines a target policy type corresponding to the policy type of the policy data to be processed.
[0075] S206: Determine the sentiment word library of the target policy type according to the preset sentiment word libraries of each policy type.
[0076] According to the target policy type, the preset policy types are traversed to find the policy type corresponding to the target policy type, and then the sentiment word library of the target policy type is determined.
[0077] S208: Determine the score of the policy data to be processed according to the sentiment word library of the target policy type, and determine the policy strength according to the score of the policy data to be processed.
[0078] The server determines the target policy type's sentiment word library according to the corresponding target policy type, traverses the policy data to be processed according to the policy dimension sentiment words in the sentiment word library of the target policy type, determines the score of the policy data to be processed according to the number of times the policy dimension sentiment words in the sentiment word library appear in the policy data to be processed, and determines the policy strength according to the score of the policy data to be processed. Among them, determining the score of the policy data to be processed according to the number of times the policy dimension sentiment words appear includes: determining the score of the policy data to be processed according to the score of the policy dimension sentiment words, the number of times they appear, and a preset number of times weight algorithm. When the number of times the policy dimension sentiment words appear is greater, according to the preset number of times weight algorithm, the corresponding score will also be higher, and the preset number of times weight algorithm can be set as needed.
[0079] The above-mentioned method for analyzing policy strength obtains a preset sentiment word library of each policy type, obtains the policy data to be processed, determines the target policy type corresponding to the policy type of the policy data to be processed, determines the sentiment word library of the target policy type, determines the score of the policy data to be processed according to the sentiment word library of the target policy type, determines the policy strength according to the score of the policy data to be processed, determines the score of the policy to be processed in the policy field through the sentiment word library, determines the policy strength according to the score of the policy to be processed, realizes the numerical evaluation of the policy strength through the score, and realizes the policy strength analysis based on sentiment analysis.
[0080] In one embodiment, if Figure 3 As shown, before S202, including:
[0081] S302: Acquire a historical policy data set, a preset policy dimension, and a seed word of the preset policy dimension.
[0082] The historical policy data set refers to the set of publicly available policy data collected. The preset policy dimension refers to the policy direction. Different policy types will have different policy directions. The seed words of the policy dimension refer to the words that can explain the policy direction and the intensity of the policy. For example, when the policy type is fiscal policy, if the policy dimension is interest rate policy, the corresponding seed words of the policy dimension can be rise or fall. If the policy dimension is monetary policy, the corresponding seed words of the policy dimension can be stable, loose and tight.
[0083] S304: According to the seed words of the policy dimension, the historical policy data set is traversed to determine the sentiment word set of each policy dimension.
[0084] The sentiment word set of each policy dimension includes the policy dimension sentiment words, which refer to the words corresponding to the seed words of the policy dimension that can reflect the policy direction and policy strength. The server obtains the words in the historical policy data set and generates the word vectors corresponding to the words. According to the seed words of the policy dimension, the historical policy data set is traversed. According to the word vector distance between each word in the historical policy data set and the seed words of the policy dimension and the number of times they appear together in the same sentence, the policy dimension sentiment words of each policy dimension are determined, and then the sentiment word set of each policy dimension is determined according to the policy dimension sentiment words of each policy dimension. For example, when the seed word of the policy dimension is robust, the words that co-appear with robust in the policy data may be neutral, reasonable, balanced, and basic.
[0085] S306: Determine the score of each policy dimension sentiment word in the sentiment word set of each policy dimension according to a preset scoring standard.
[0086] The server first determines the word vector distance between the sentiment word of each policy dimension and the seed word of the corresponding policy dimension in the sentiment word set of each policy dimension, and determines the score of the sentiment word of each policy dimension according to the word vector distance and the preset scoring standard. Among them, the preset scoring standard can be set as needed.
[0087] S308: Generate a sentiment word library of a policy type corresponding to each policy dimension based on the sentiment word set of each policy dimension.
[0088] Each policy dimension carries a preset policy type identifier. The server can determine the policy type corresponding to each policy dimension based on the preset policy type identifier carried by each policy dimension, generate a sentiment word library corresponding to each policy dimension, and store the sentiment word set of each policy dimension in the sentiment word library of the policy type corresponding to each policy dimension. Among them, the preset policy type identifier carried by each policy dimension is determined based on the policy type in the preset policy type database. Each policy dimension has a corresponding policy type. The policy type to which the policy dimension belongs can be determined based on the preset policy type identifier. For example, monetary policy and interest rate policy carry the preset policy type identifier of fiscal policy.
[0089] The solution of the present application is described below through an embodiment.
[0090] The server obtains the preset sentiment word library of each policy type, obtains the policy data to be processed, determines that the target policy type corresponding to the policy type of the policy data to be processed is fiscal policy, obtains the sentiment word library of fiscal policy according to the preset sentiment word library of each policy type, determines the score of the policy data to be processed according to the sentiment word library of fiscal policy, and determines the policy strength of fiscal policy according to the score of the policy data to be processed. The fiscal policy may be a tight fiscal policy or a loose fiscal policy. Among them, the sentiment word library of each policy type can be generated by the following steps: obtaining a historical fiscal policy data set, the preset policy dimension is monetary policy, the seed word of monetary policy is "sound", according to the seed word "sound" of the policy dimension, traversing the historical policy data set, determining the sentiment word set of monetary policy, the sentiment word set of monetary policy includes "neutral", "reasonable", "balanced" and "basic" and other words that often appear with the word "sound" in the historical fiscal policy data set, according to the preset scoring standard, determining the score of the sentiment word of each policy dimension, and generating the sentiment word library of fiscal policy corresponding to the monetary policy according to the sentiment word set of monetary policy.
[0091] In one embodiment, if Figure 4 As shown, S304 includes:
[0092] S402: Obtain words in the historical policy data set and generate word vectors corresponding to the words;
[0093] S404: Determine a first category of word sets whose word vector distances from the seed words of the policy dimension are within a preset distance threshold range;
[0094] S406: According to the seed words and the first category word set of the policy dimension, the historical policy data set is traversed to determine the sentiment word set of each policy dimension.
[0095] The server obtains words in the historical policy data set and generates word vectors corresponding to the words. According to the word vectors of the seed words in the policy dimension and the word vectors of the words in the historical policy data set, the server determines the first category of word sets in the words in the historical policy data set whose distance from the word vectors of the seed words in the policy dimension is within a preset distance threshold range. According to the seed words in the policy dimension and the first category of word sets, the server traverses the historical policy data set to determine the sentiment word sets of each policy dimension. Among them, the preset distance threshold range can be set as needed, and the sentiment word sets of each policy dimension include the seed words in the policy dimension and the first category of word sets.
[0096] The above embodiment realizes the acquisition of the first category of word sets based on the word vectors of the seed words of the policy dimension and the word vectors of each word in the historical policy data set, and then traverses the historical policy data set based on the first category of word sets and the seed words of the policy dimension to realize the acquisition of sentiment words of each policy dimension.
[0097] In one embodiment, if Figure 5 As shown, S406 includes:
[0098] S502: splitting the historical policy data in the historical policy data set into complete statements;
[0099] S504: According to the seed words of the policy dimension and the first-category words in the first-category word set, traverse the split complete sentences to determine the target sentence;
[0100] S506: Counting the number of occurrences of each word in the target sentence, and determining the words whose number of occurrences is greater than a preset number threshold as the second category of words;
[0101] S508: Determine a second category word set according to the second category words;
[0102] S510: Determine the sentiment word set of each policy dimension according to the first category word set and the second category word set.
[0103] The server splits the historical policy data in the historical policy data set into complete sentences, traverses the split complete sentences according to the seed words of the policy dimension and the first category words in the first category word set, determines the target sentence, the target sentence contains the seed words of the policy dimension and / or the first category words, counts the number of occurrences of each word in the target sentence, determines the words whose number of occurrences in the target sentence is greater than the preset number threshold as the second category words, determines the second category word set according to the second category words, obtains the adjectives in the first category word set and the adjectives in the second category word set, and determines the sentiment word set of each policy dimension according to the adjectives in the first category word set and the adjectives in the second category word set. Among them, the preset number threshold can be set as needed, and the sentiment word set of each policy dimension includes the adjectives of the second category words. For example, when the seed word of the policy dimension is robust, the adjectives that appear in the target sentence together with the word robust can be neutral, reasonable, balanced, and basic.
[0104] In the above embodiment, based on the seed words of the policy dimension and the first category of words in the first category of words, the complete sentences after splitting are traversed to determine the words whose co-occurrence times with the seed words of the policy dimension and the first category of sentences in the first category of words is greater than a preset number threshold, as the second category of words, and based on the second category of words, the second category of words is determined, and then based on the first category of words and the second category of words, the sentiment word set of each policy dimension is acquired.
[0105] In one embodiment, if Figure 6 As shown, S306 includes:
[0106] S602: Determine the word vector distance between each policy dimension sentiment word in the sentiment word set of each policy dimension and the corresponding policy dimension seed word;
[0107] S604: Determine the score of each policy dimension sentiment word in the sentiment word set of each policy dimension according to the word vector distance and a preset scoring standard.
[0108] The server determines the word vector distance between each policy dimension sentiment word and the corresponding policy dimension seed word in the sentiment word set of each policy dimension, and determines the score of each policy dimension sentiment word in the sentiment word set of each policy dimension according to the word vector distance and the preset scoring standard. Among them, the preset scoring standard can be set as needed. For example, the score range of each policy dimension sentiment word can be set to 0-10 points, and the score of the policy dimension seed word corresponding to the policy dimension sentiment word is 10 points. The word vector distance between each policy dimension sentiment word and the corresponding policy dimension seed word is determined, and the smaller the word vector distance, the higher the score of the policy dimension sentiment word. Further, the word vector distance can be set to eleven different levels, corresponding to scores of 0-10 points. After determining the scores of each policy dimension sentiment word, the scores of each policy dimension sentiment word can be marked on the policy dimension sentiment word to facilitate subsequent score statistics.
[0109] The above embodiment determines the score of each policy dimension sentiment word in the sentiment word set of each policy dimension based on the word vector distance between the sentiment word of each policy dimension and the seed word of the corresponding policy dimension in the sentiment word set of each policy dimension and the preset scoring criteria, thereby realizing the reasonable formulation of the score of each policy dimension sentiment word in the sentiment word set of each policy dimension.
[0110] In one embodiment, if Figure 7 As shown, S308 includes:
[0111] S702: Determine the policy type corresponding to each policy dimension according to the preset policy type identifier carried by each policy dimension;
[0112] S704: Generate a sentiment word library of policy types corresponding to each policy dimension;
[0113] S706: Storing the sentiment word set of each policy dimension into a sentiment word library of the policy type corresponding to each policy dimension.
[0114] The server obtains the preset policy type identifier carried by each policy dimension, determines the policy type corresponding to each policy dimension according to the preset policy type identifier carried by each policy dimension, generates a sentiment word library of the policy type corresponding to each policy dimension, and stores the sentiment word set of each policy dimension in the sentiment word library of the policy type corresponding to each policy dimension. Among them, the sentiment word sets of multiple policy dimensions may belong to the sentiment word library of the same policy type.
[0115] In the above embodiment, based on the sentiment word set of each policy dimension, a sentiment word library of the policy type corresponding to each policy dimension is generated, thereby achieving the acquisition of the sentiment word library of each policy type.
[0116] In one embodiment, if Figure 8 As shown, S204 includes:
[0117] S802: Obtaining policy data to be processed and extracting features of the policy data to be processed;
[0118] S804: matching the characteristics of the policy data to be processed with a preset characteristic database to determine the policy type of the policy data to be processed;
[0119] S806: According to the policy type of the policy data to be processed, a preset policy type database is matched to determine a target policy type corresponding to the policy type of the policy data to be processed.
[0120] The target policy type refers to the policy type corresponding to the policy type of the policy data to be processed, which includes a sentiment word library. The server obtains the policy data to be processed, extracts the features of the policy data to be processed, matches the preset feature database according to the features of the policy data to be processed, determines the policy type of the policy data to be processed, matches the preset policy type database according to the policy type of the policy data to be processed, and determines the target policy type corresponding to the policy type of the policy data to be processed. The features of the policy data to be processed can be the project name that appears most frequently in the policy data to be processed and the technical field corresponding to the policy data to be processed. The policy type of the policy data to be processed can be determined based on the project name, technical field and preset feature database.
[0121] In the above embodiment, the policy data to be processed is acquired, the features of the policy data to be processed are extracted, a preset feature database is matched according to the features of the policy data to be processed, the policy type of the policy data to be processed is determined, and a preset policy type database is matched according to the policy type of the policy data to be processed to determine the target policy type corresponding to the policy type of the policy data to be processed, thereby achieving the acquisition of the target policy type.
[0122] In one embodiment, if Fig. 9 As shown, S208 includes:
[0123] S902: traversing the policy data to be processed according to the policy dimension sentiment words in the sentiment word library of the target policy type;
[0124] S904: Counting the number of times that the policy dimension sentiment words in the sentiment word library appear in the policy data to be processed;
[0125] S906: Determine the score of the policy data to be processed according to the number of occurrences;
[0126] S908: Determine the policy strength based on the score of the policy data to be processed.
[0127] The server traverses the policy data to be processed according to the policy dimension sentiment words in the sentiment word library of the target policy type, counts the number of times the policy dimension sentiment words in the sentiment word library appear in the policy data to be processed, determines the score of the policy data to be processed according to the number of times the policy dimension sentiment words appear, and determines the policy strength according to the score of the policy data to be processed. Among them, determining the score of the policy data to be processed according to the number of times the policy dimension sentiment words appear includes: determining the score of the policy data to be processed according to the score of the policy dimension sentiment words, the number of times they appear, and a preset number of times weight algorithm. When the number of times the policy dimension sentiment words appear is greater, according to the preset number of times weight algorithm, the corresponding score will also be higher, and the preset number of times weight algorithm can be set as needed. For example, the frequency weight algorithm can be: the number of occurrences of the policy dimension sentiment words is in correspondence with the frequency coefficient, the coefficient of the first occurrence is 1, the coefficient of the second occurrence is 0.9, the number of times the third occurrence is 0.8, and so on. The score weight of the policy dimension sentiment words is calculated by the number of occurrences of the policy dimension sentiment words and the frequency coefficient, and then the score of the policy dimension sentiment words in the policy data to be processed is determined according to the score and the score weight of the policy dimension sentiment words, and the score of the policy dimension sentiment words in the policy data to be processed is determined by calculating the score of each policy dimension sentiment word in the policy data to be processed, and the score of the policy data to be processed is determined according to the score of the policy data to be processed. The policy strength is determined according to the score of the policy data to be processed. The higher the score, the greater the policy strength.
[0128] In the above embodiment, according to the policy dimension sentiment words in the sentiment word library of the target policy type, the policy data to be processed are traversed, and the number of times the policy dimension sentiment words in the sentiment word library appear in the policy data to be processed is counted. According to the number of appearances, the score of the policy data to be processed is determined, and according to the score of the policy data to be processed, the policy strength is determined, and a numerical evaluation of the policy strength is achieved through the score, thereby realizing policy strength analysis based on sentiment analysis.
[0129] It should be understood that although Figure 2-9 The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, Figure 2-9 At least part of the steps may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least part of the sub-steps or stages of other steps.
[0130] In one embodiment, Fig.10 As shown, a device for analyzing policy strength is provided, including: a first acquisition module 102, a second acquisition module 104, a first processing module 106 and a second processing module 108, wherein:
[0131] The first acquisition module 102 is used to acquire a preset sentiment word library of each policy type;
[0132] The second acquisition module 104 is used to acquire the policy data to be processed and determine the target policy type corresponding to the policy type of the policy data to be processed;
[0133] The first processing module 106 is used to determine the sentiment word library of the target policy type according to the preset sentiment word library of each policy type;
[0134] The second processing module 108 is used to determine the score of the policy data to be processed according to the sentiment word library of the target policy type, and determine the policy strength according to the score of the policy data to be processed.
[0135] The above-mentioned device for analyzing policy strength obtains a preset sentiment word library of each policy type, obtains the policy data to be processed, determines the target policy type corresponding to the policy type of the policy data to be processed, determines the sentiment word library of the target policy type, determines the score of the policy data to be processed according to the sentiment word library of the target policy type, determines the policy strength according to the score of the policy data to be processed, and in the policy field, determines the score of the policy to be processed through the sentiment word library, determines the policy strength according to the score of the policy to be processed, realizes the numerical evaluation of the policy strength through the score, and realizes the policy strength analysis based on sentiment analysis.
[0136] In one of the embodiments, the device for analyzing policy strength also includes a vocabulary generation module, which is used to obtain a historical policy data set, a preset policy dimension, and a seed word of the preset policy dimension, traverse the historical policy data set according to the seed word of the policy dimension, determine the sentiment word set of each policy dimension, determine the score of the sentiment word of each policy dimension in the sentiment word set of each policy dimension according to a preset scoring standard, and generate a sentiment vocabulary of the policy type corresponding to each policy dimension according to the sentiment word set of each policy dimension.
[0137] In one of the embodiments, the vocabulary generation module is also used to obtain words in the historical policy data set, and generate word vectors corresponding to the words, determine a first category of word sets whose distance from the word vectors of the seed words of the policy dimension is within a preset distance threshold range, and traverse the historical policy data set based on the seed words of the policy dimension and the first category of word sets to determine the sentiment word sets of each policy dimension.
[0138] In one of the embodiments, the vocabulary generation module is also used to split the historical policy data in the historical policy data set into complete sentences, traverse the split complete sentences according to the seed words of the policy dimension and the first category words in the first category word set, determine the target sentence, count the number of occurrences of each word in the target sentence, determine the words whose number of occurrences is greater than a preset number threshold as the second category words, determine the second category word set according to the second category words, and determine the sentiment word set of each policy dimension according to the first category word set and the second category word set.
[0139] In one of the embodiments, the vocabulary generation module is also used to determine the word vector distance between the sentiment words of each policy dimension in the sentiment word set of each policy dimension and the seed words of the corresponding policy dimension, and determine the score of the sentiment words of each policy dimension in the sentiment word set of each policy dimension based on the word vector distance and a preset scoring standard.
[0140] In one of the embodiments, the vocabulary generation module is also used to determine the policy type corresponding to each policy dimension based on the preset policy type identifier carried by each policy dimension, generate a sentiment vocabulary of the policy type corresponding to each policy dimension, and store the sentiment word set of each policy dimension into the sentiment vocabulary of the policy type corresponding to each policy dimension.
[0141] In one of the embodiments, the second acquisition module is also used to acquire the policy data to be processed, extract the features of the policy data to be processed, match a preset feature database according to the features of the policy data to be processed, determine the policy type of the policy data to be processed, match a preset policy type database according to the policy type of the policy data to be processed, and determine the target policy type corresponding to the policy type of the policy data to be processed.
[0142] In one of the embodiments, the second processing module is also used to traverse the policy data to be processed based on the policy dimension sentiment words in the sentiment vocabulary of the target policy type, count the number of times the policy dimension sentiment words in the sentiment vocabulary appear in the policy data to be processed, determine the score of the policy data to be processed based on the number of appearances, and determine the policy strength based on the score of the policy data to be processed.
[0143] For the specific definition of the device for analyzing the policy strength, please refer to the definition of the method for analyzing the policy strength above, which will not be repeated here. Each module in the above-mentioned device for analyzing the policy strength can be implemented in whole or in part by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.
[0144] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Fig.11 As shown. The computer device includes a processor, a memory, a network interface and a database connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and computer program in the non-volatile storage medium. The database of the computer device is used to store historical policy data, sentiment vocabulary, feature data and policy type data. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a method for analyzing policy strength is implemented.
[0145] Those skilled in the art will understand that Fig.11The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0146] In one embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:
[0147] Obtain the preset sentiment word library for each policy type;
[0148] Obtaining policy data to be processed, and determining a target policy type corresponding to a policy type of the policy data to be processed;
[0149] Determine the sentiment word library of the target policy type according to the preset sentiment word library of each policy type;
[0150] The score of the policy data to be processed is determined according to the sentiment word library of the target policy type, and the policy strength is determined according to the score of the policy data to be processed.
[0151] The computer equipment for analyzing the policy strength mentioned above obtains the preset sentiment word library of each policy type, obtains the policy data to be processed, determines the target policy type corresponding to the policy type of the policy data to be processed, determines the sentiment word library of the target policy type, determines the score of the policy data to be processed according to the sentiment word library of the target policy type, determines the policy strength according to the score of the policy data to be processed, determines the score of the policy to be processed in the policy field through the sentiment word library, determines the policy strength according to the score of the policy to be processed, realizes the numerical evaluation of the policy strength through the score, and realizes the policy strength analysis based on sentiment analysis.
[0152] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0153] Obtain a historical policy data set, a preset policy dimension, and a seed word of the preset policy dimension;
[0154] According to the seed words of the policy dimension, the historical policy data set is traversed to determine the sentiment word set of each policy dimension;
[0155] According to the preset scoring criteria, the score of the sentiment word of each policy dimension in the sentiment word set of each policy dimension is determined;
[0156] Based on the sentiment word set of each policy dimension, a sentiment word library of the policy type corresponding to each policy dimension is generated.
[0157] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0158] Get the words in the historical policy data set and generate word vectors corresponding to the words;
[0159] Determine a first category of word sets whose word vector distances from the seed words of the policy dimension are within a preset distance threshold range;
[0160] According to the seed words and the first category word set of the policy dimension, the historical policy data set is traversed to determine the sentiment word set of each policy dimension.
[0161] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0162] Split the historical policy data in the historical policy data set into complete sentences;
[0163] According to the seed words of the policy dimension and the first-category words in the first-category word set, the split complete sentences are traversed to determine the target sentence;
[0164] Counting the number of occurrences of each word in the target sentence, and determining the words whose number of occurrences is greater than a preset number threshold as the second category of words;
[0165] According to the second category of words, determining a second category of word set;
[0166] Based on the first category word set and the second category word set, the sentiment word set of each policy dimension is determined.
[0167] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0168] Determine the word vector distance between the sentiment word of each policy dimension in the sentiment word set of each policy dimension and the seed word of the corresponding policy dimension;
[0169] According to the word vector distance and the preset scoring criteria, the score of the sentiment word of each policy dimension in the sentiment word set of each policy dimension is determined.
[0170] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0171] According to the preset policy type identifier carried by each policy dimension, determine the policy type corresponding to each policy dimension;
[0172] Generate a sentiment word library of policy types corresponding to each policy dimension;
[0173] The sentiment word set of each policy dimension is stored in the sentiment word library of the policy type corresponding to each policy dimension.
[0174] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0175] Obtaining policy data to be processed and extracting features of the policy data to be processed;
[0176] According to the characteristics of the policy data to be processed, a preset characteristic database is matched to determine the policy type of the policy data to be processed;
[0177] According to the policy type of the policy data to be processed, a preset policy type database is matched to determine the target policy type corresponding to the policy type of the policy data to be processed.
[0178] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0179] According to the policy dimension sentiment words in the sentiment word library of the target policy type, traverse the policy data to be processed;
[0180] Count the number of times the policy dimension sentiment words in the sentiment word library appear in the policy data to be processed;
[0181] According to the number of occurrences, the score of the policy data to be processed is determined;
[0182] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:
[0183] Obtain the preset sentiment word library for each policy type;
[0184] Obtaining policy data to be processed, and determining a target policy type corresponding to a policy type of the policy data to be processed;
[0185] Determine the sentiment word library of the target policy type according to the preset sentiment word library of each policy type;
[0186] The score of the policy data to be processed is determined according to the sentiment word library of the target policy type, and the policy strength is determined according to the score of the policy data to be processed.
[0187] The storage medium for the above-mentioned policy strength analysis obtains the preset sentiment word library of each policy type, obtains the policy data to be processed, determines the target policy type corresponding to the policy type of the policy data to be processed, determines the sentiment word library of the target policy type, determines the score of the policy data to be processed according to the sentiment word library of the target policy type, determines the policy strength according to the score of the policy data to be processed, and in the policy field, determines the score of the policy to be processed through the sentiment word library, determines the policy strength according to the score of the policy to be processed, realizes the numerical evaluation of the policy strength through the score, and realizes the policy strength analysis based on sentiment analysis.
[0188] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0189] Obtain a historical policy data set, a preset policy dimension, and a seed word of the preset policy dimension;
[0190] According to the seed words of the policy dimension, the historical policy data set is traversed to determine the sentiment word set of each policy dimension;
[0191] According to the preset scoring criteria, the score of the sentiment word of each policy dimension in the sentiment word set of each policy dimension is determined;
[0192] Based on the sentiment word set of each policy dimension, a sentiment word library of the policy type corresponding to each policy dimension is generated.
[0193] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0194] Get the words in the historical policy data set and generate word vectors corresponding to the words;
[0195] Determine a first category of word sets whose word vector distances from the seed words of the policy dimension are within a preset distance threshold range;
[0196] According to the seed words and the first category word set of the policy dimension, the historical policy data set is traversed to determine the sentiment word set of each policy dimension.
[0197] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0198] Split the historical policy data in the historical policy data set into complete sentences;
[0199] According to the seed words of the policy dimension and the first-category words in the first-category word set, the split complete sentences are traversed to determine the target sentence;
[0200] Counting the number of occurrences of each word in the target sentence, and determining the words whose number of occurrences is greater than a preset number threshold as the second category of words;
[0201] According to the second category of words, determining a second category of word set;
[0202] Based on the first category word set and the second category word set, the sentiment word set of each policy dimension is determined.
[0203] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0204] Determine the word vector distance between the sentiment word of each policy dimension in the sentiment word set of each policy dimension and the seed word of the corresponding policy dimension;
[0205] According to the word vector distance and the preset scoring criteria, the score of the sentiment word of each policy dimension in the sentiment word set of each policy dimension is determined.
[0206] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0207] According to the preset policy type identifier carried by each policy dimension, determine the policy type corresponding to each policy dimension;
[0208] Generate a sentiment word library of policy types corresponding to each policy dimension;
[0209] The sentiment word set of each policy dimension is stored in the sentiment word library of the policy type corresponding to each policy dimension.
[0210] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0211] Obtaining policy data to be processed and extracting features of the policy data to be processed;
[0212] According to the characteristics of the policy data to be processed, a preset characteristic database is matched to determine the policy type of the policy data to be processed;
[0213] According to the policy type of the policy data to be processed, a preset policy type database is matched to determine the target policy type corresponding to the policy type of the policy data to be processed.
[0214] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0215] According to the policy dimension sentiment words in the sentiment word library of the target policy type, traverse the policy data to be processed;
[0216] Count the number of times the policy dimension sentiment words in the sentiment word library appear in the policy data to be processed;
[0217] According to the number of occurrences, the score of the policy data to be processed is determined;
[0218] Determine the policy strength based on the score of the policy data to be processed.
[0219] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
[0220] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0221] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.
Claims
1. A method for analyzing policy strength, the method comprising: Obtaining a historical policy data set, a preset policy dimension, and a seed word of the preset policy dimension; the seed word refers to a word that can explain the policy direction and policy strength; Obtaining words in the historical policy data set and generating word vectors corresponding to the words; Determine a first set of words whose word vector distances from the seed words of the policy dimension are within a preset distance threshold range; According to the seed words of the policy dimension and the first category of word sets, traverse the historical policy data set to determine the sentiment word sets of each policy dimension; The step of traversing the historical policy data set based on the seed words of the policy dimension and the first category of word sets to determine the sentiment word sets of each policy dimension includes: Splitting the historical policy data in the historical policy data set into complete sentences; According to the seed words of the policy dimension and the first category words in the first category word set, traverse the split complete sentences to determine the target sentence; Counting the number of occurrences of each word in the target sentence, and determining words whose number of occurrences is greater than a preset number threshold as second-category words; According to the second category of words, determining a second category of word set; Determine the sentiment word set of each policy dimension according to the first category word set and the second category word set; the sentiment word set of the policy dimension refers to a set of words corresponding to the seed words of the policy dimension that can reflect the policy direction and policy strength; Determine the word vector distance between each policy dimension sentiment word in the sentiment word set of each policy dimension and the corresponding policy dimension seed word; Determine the score of each policy dimension sentiment word in the sentiment word set of each policy dimension according to the word vector distance and a preset scoring standard; Generate a sentiment word library of a policy type corresponding to each policy dimension according to the sentiment word set of each policy dimension; Get the generated sentiment word library; Acquire policy data to be processed, and determine a target policy type corresponding to the policy type of the policy data to be processed; Determine the sentiment word library of the target policy type according to the preset sentiment word library of each policy type; The score of the policy data to be processed is determined according to the sentiment word library of the target policy type, and the policy strength is determined according to the score of the policy data to be processed.
2. The method according to claim 1, characterized in that: The generating of the sentiment word library of the policy type corresponding to each policy dimension according to the sentiment word set of each policy dimension comprises: Determining the policy type corresponding to each of the policy dimensions according to the preset policy type identifier carried by each of the policy dimensions; Generate a sentiment word library of policy types corresponding to each of the policy dimensions; The sentiment word sets of each of the policy dimensions are stored in a sentiment word library of the policy type corresponding to each of the policy dimensions.
3. The method according to claim 1, characterized in that The obtaining of the policy data to be processed and determining the target policy type corresponding to the policy type of the policy data to be processed comprises: Acquire the policy data to be processed, and extract the features of the policy data to be processed; According to the characteristics of the policy data to be processed, a preset characteristic database is matched to determine the policy type of the policy data to be processed; According to the policy type of the policy data to be processed, a preset policy type database is matched to determine a target policy type corresponding to the policy type of the policy data to be processed.
4. The method according to claim 1, characterized in that: Determining the score of the policy data to be processed according to the sentiment word library of the target policy type, and determining the policy strength according to the score of the policy data to be processed includes: Traversing the policy data to be processed according to the policy dimension sentiment words in the sentiment word library of the target policy type; Counting the number of times the policy dimension sentiment words in the sentiment word library appear in the policy data to be processed; Determining the score of the policy data to be processed according to the number of occurrences; The policy strength is determined based on the score of the policy data to be processed.
5. A device for analyzing policy strength, characterized in that: The device comprises: A vocabulary generation module is used to obtain a historical policy data set, a preset policy dimension, and a seed word of the preset policy dimension; the seed word refers to a word that can explain the policy direction and policy strength; obtain the words in the historical policy data set and generate a word vector corresponding to the word; determine a first-category word set whose word vector distance from the seed word of the policy dimension is within a preset distance threshold range; traverse the historical policy data set based on the seed word of the policy dimension and the first-category word set to determine the sentiment word set of each policy dimension; wherein, traversing the historical policy data set based on the seed word of the policy dimension and the first-category word set to determine the sentiment word set of each policy dimension includes: splitting the historical policy data in the historical policy data set into complete sentences; based on the seed word of the policy dimension and the first-category word set , traverse the complete sentence after splitting and determine the target sentence; count the number of occurrences of each word in the target sentence, and determine the words whose number of occurrences is greater than the preset number threshold as the second category of words; according to the second category of words, determine the second category of word sets; according to the first category of word sets and the second category of word sets, determine the sentiment word sets of each policy dimension; the sentiment word set of the policy dimension refers to the set of words corresponding to the seed words of the policy dimension that can reflect the policy direction and policy strength; determine the word vector distance between the sentiment words of each policy dimension in the sentiment word set of each policy dimension and the seed words of the corresponding policy dimension; according to the word vector distance and the preset scoring standard, determine the score of the sentiment words of each policy dimension in the sentiment word set of each policy dimension; according to the sentiment word set of each policy dimension, generate a sentiment word library of the policy type corresponding to each policy dimension; The first acquisition module is used to acquire a preset emotional vocabulary; A second acquisition module is used to acquire the policy data to be processed and determine a target policy type corresponding to the policy type of the policy data to be processed; A first processing module, used for determining the sentiment word library of the target policy type according to the preset sentiment word library of each policy type; The second processing module is used to determine the score of the policy data to be processed according to the sentiment word library of the target policy type, and determine the policy strength according to the score of the policy data to be processed.
6. The device according to claim 5, characterized in that The vocabulary generation module is specifically used for: Determining the policy type corresponding to each of the policy dimensions according to the preset policy type identifier carried by each of the policy dimensions; Generate a sentiment word library of policy types corresponding to each of the policy dimensions; The sentiment word sets of each of the policy dimensions are stored in a sentiment word library of the policy type corresponding to each of the policy dimensions.
7. The device according to claim 5, characterized in that The second acquisition module is specifically used for: Acquire the policy data to be processed, and extract the features of the policy data to be processed; According to the characteristics of the policy data to be processed, a preset characteristic database is matched to determine the policy type of the policy data to be processed; According to the policy type of the policy data to be processed, a preset policy type database is matched to determine a target policy type corresponding to the policy type of the policy data to be processed.
8. The device according to claim 5, characterized in that The second processing module is specifically used for: Traversing the policy data to be processed according to the policy dimension sentiment words in the sentiment word library of the target policy type; Counting the number of times the policy dimension sentiment words in the sentiment word library appear in the policy data to be processed; Determining the score of the policy data to be processed according to the number of occurrences; The policy strength is determined based on the score of the policy data to be processed.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 4 are implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 4 are implemented.
