A method, device and apparatus for determining public opinion category

Through the long-term and short-term memory model and external gate structure based on public opinion summary information, the public opinion classification model is directly trained, which solves the problem of pre-trained model dependence in public opinion analysis, and achieves efficient and accurate public opinion category recognition.

CN113515626BActive Publication Date: 2024-12-17INDUSTRIAL AND COMMERCIAL BANK OF CHINA
View PDF 8 Cites 0 Cited by

Patent Information

Application Number
CN202110544720.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-05-19
Publication Date
2024-12-17
Estimated Expiration
2041-05-19

AI Technical Summary

Technical Problem

In the prior art, public opinion analysis requires the use of the official pre-trained model combined with scene data for model training, resulting in inefficient recognition of public opinion information.

Method used

Using technology based on public opinion summary information and preset long and short-term memory models, strengthen the connection between input and output data through the external connection gate structure, directly train the public opinion classification model, avoid the use of official pre-trained model every time, and use TF-IDF value and exposure. Weight calculates text similarity to determine the category of public opinion.

Benefits of technology

It realizes efficient and accurate public opinion category determination, improves the efficiency of public opinion information identification, and reduces the dependence on pre-trained models.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113515626B_ABST
    Figure CN113515626B_ABST
Patent Text Reader

Abstract

The embodiments of this specification provide a method, device and equipment for determining the category of public opinion, which can be used in the field of big data technology. The method includes obtaining specified public opinion summary information; processing the specified public opinion summary information using a public opinion classification model to obtain the public opinion category corresponding to the specified public opinion summary information; wherein the public opinion classification model is obtained by training a preset long-short term memory model based on the public opinion summary information and the corresponding public opinion category; the neuron structure of the preset long-short term memory model includes an external connection gate, which is used to strengthen the connection between input data and output data. The embodiments of this specification can be used to efficiently and accurately determine the category of public opinion.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of big data technology, and in particular to a method, device and equipment for determining a category of public opinion. Background Art

[0002] With the continuous development of Internet applications, industries such as advertising, retail, and investment need to monitor public opinion in order to deal with the impact of public opinion information through public opinion analysis. At present, ordinary public opinion analysis services mainly crawl corresponding articles from some open platforms based on keywords provided by users. However, in general, there are many target articles crawled from open platforms, and those articles with relatively negative evaluations are often what users really want to understand and view. Therefore, how to accurately identify negative articles is becoming more and more important.

[0003] In the existing technology, the type of public opinion information is mainly identified by combining pre-trained models with the Attention mechanism. However, this method requires the use of official pre-trained models (such as BERT, ERNIE) and then combining them with scene data for model training, which reduces the efficiency of identifying public opinion information.

[0004] Therefore, the industry is in urgent need of a technical solution that can solve the above technical problems. Summary of the invention

[0005] The embodiments of this specification provide a method, device and equipment for determining the category of public opinion, which eliminates the need to use an official pre-trained model combined with scene data for model training every time, thereby efficiently and accurately determining the category of public opinion.

[0006] The method, device and apparatus for determining the category of public opinion provided in this specification are implemented in the following manner.

[0007] A method for determining a public opinion category comprises: obtaining designated public opinion summary information; processing the designated public opinion summary information using a public opinion classification model to obtain a public opinion category corresponding to the designated public opinion summary information; wherein the public opinion classification model is obtained by training a preset long-short-term memory model based on the public opinion summary information and the corresponding public opinion category; and the neuron structure of the preset long-short-term memory model comprises an external connection gate, and the external connection gate is used to strengthen the connection between input data and output data.

[0008] A training method for a public opinion classification model comprises: obtaining target public opinion summary information; wherein the target public opinion summary information is pre-assigned with an exposure weight; determining a feature word vector of the target public opinion summary information; wherein the feature word vector contains multiple feature words of the target public opinion summary information; calculating the TF-IDF value of each feature word in the feature word vector to obtain a target summary vector of the target public opinion summary information; determining the text similarity of the target public opinion summary information based on the exposure weight and the target summary vector of the target public opinion summary information; wherein the text similarity is used to characterize the public opinion category of the target public opinion summary information; using the target public opinion summary information and the corresponding text similarity to train a preset long-short-term memory model to obtain a public opinion classification model; wherein the neuron structure of the preset long-short-term memory model comprises an outer connection gate, and the outer connection gate is used to strengthen the connection between input data and output data.

[0009] A device for determining a public opinion category comprises: an acquisition module for acquiring specified public opinion summary information; an acquisition module for processing the specified public opinion summary information using a public opinion classification model to obtain the public opinion category corresponding to the specified public opinion summary information; wherein the public opinion classification model is obtained by training a preset long-short-term memory model based on the public opinion summary information and the corresponding public opinion category; the neuron structure of the preset long-short-term memory model comprises an external connection gate, and the external connection gate is used to strengthen the connection between input data and output data.

[0010] A training device for a public opinion classification model comprises: an acquisition module for acquiring target public opinion summary information; wherein the target public opinion summary information is pre-assigned with an exposure weight; a first determination module for determining a feature word vector of the target public opinion summary information; wherein the feature word vector contains multiple feature words of the target public opinion summary information; a calculation module for calculating the TF-IDF value of each feature word in the feature word vector to obtain a target summary vector of the target public opinion summary information; a second determination module for determining the text similarity of the target public opinion summary information based on the exposure weight of the target public opinion summary information and the target summary vector; wherein the text similarity is used to characterize the public opinion category of the target public opinion summary information; a training module for training a preset long short-term memory model using the target public opinion summary information and the corresponding text similarity to obtain a public opinion classification model; wherein the neuron structure of the preset long short-term memory model includes an outer connection gate, and the outer connection gate is used to strengthen the connection between input data and output data.

[0011] A device for determining a public opinion category includes at least one processor and a memory storing computer executable instructions, wherein when the processor executes the instructions, the steps of any method embodiment in the embodiments of this specification are implemented.

[0012] A computer-readable storage medium stores computer instructions, which, when executed, implement the steps of any method embodiment in the embodiments of this specification.

[0013] This specification provides a method, device and equipment for determining the category of public opinion. In some embodiments, specified public opinion summary information can be obtained, and the specified public opinion summary information can be processed using a public opinion classification model to obtain the public opinion category corresponding to the specified public opinion summary information. Since the public opinion classification model is obtained by training a preset long-short term memory model based on the public opinion summary information and the corresponding public opinion category, and the neuron structure of the preset long-short term memory model includes an external connection gate, in this way, not only is it not necessary to use the official pre-trained model and then combine it with scene data for model training every time, but also by adding an external connection gate for interactive calculation, the important information output by the previous neuron can be strengthened again before the input information is passed to the next neuron each time, so that the public opinion category can be determined efficiently and accurately. BRIEF DESCRIPTION OF THE DRAWINGS

[0014] The drawings described herein are used to provide a further understanding of this specification, constitute a part of this specification, and do not constitute a limitation of this specification. In the drawings:

[0015] Figure 1 It is a flowchart of an embodiment of a method for determining a public opinion category provided in this specification;

[0016] Figure 2 It is a flowchart of an embodiment of a training method for a public opinion classification model provided in this specification;

[0017] Figure 3 It is a schematic diagram of the module structure of an embodiment of a device for determining a public opinion category provided in this specification;

[0018] Figure 4 It is a schematic diagram of the module structure of an embodiment of a training device for a public opinion classification model provided in this specification;

[0019] Figure 5 This is a hardware structure block diagram of an embodiment of a server for determining public opinion categories provided in this specification. DETAILED DESCRIPTION

[0020] In order to enable those skilled in the art to better understand the technical solutions in this specification, the technical solutions in the embodiments of this specification will be clearly and completely described below in conjunction with the drawings in the embodiments of this specification. Obviously, the described embodiments are only part of the embodiments in this specification, not all of the embodiments. Based on one or more embodiments in this specification, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the embodiments of this specification.

[0021] The following is an example of a specific application scenario to illustrate the implementation plan of this specification. Specifically, Figure 1 The flowchart of an embodiment of a method for determining a public opinion category provided in this specification is shown. Although this specification provides method operation steps or device structures as shown in the following embodiments or drawings, the method or device may include more or fewer operation steps or module units after partial combination based on routine or no creative labor.

[0022] An implementation scheme provided in this specification can be applied to a client, a server, etc. The client can include a terminal device, such as a smart phone, a tablet computer, etc. The server can include a single computer device, or a server cluster composed of multiple servers, or a server structure of a distributed system, etc.

[0023] It should be noted that the following embodiment description does not limit the technical solutions in other application scenarios that can be extended based on this specification. Figure 1 As shown, in an embodiment of a method for determining a public opinion category provided in this specification, the method may include the following steps.

[0024] S0: Get the specified public opinion summary information.

[0025] The designated public opinion summary information may be any public opinion summary information that needs to determine the public opinion category.

[0026] In some embodiments, before obtaining the specified public opinion summary information, public opinion information may be obtained first. The public opinion information may be currently generated or historically recorded public opinion information, which may be determined based on actual conditions and is not limited in this specification.

[0027] In some implementation scenarios, public opinion information may be information about a company, an individual, etc. The specific information may be determined according to actual conditions, and the embodiments of this specification do not limit this.

[0028] In some implementation scenarios, the way to obtain public opinion information may include: pulling from a preset database, or obtaining through Internet search, etc. Of course, the above is only an exemplary description, and the way to obtain public opinion information is not limited to the above examples. For example, crawler technology can also be used to collect public opinion information in multiple channels such as Wind, Bloomberg, and the company's internal system under certain conditions. Technical personnel in the relevant field may make other changes under the inspiration of the technical essence of this application, but as long as the functions and effects achieved are the same or similar to those of this application, they should be covered within the scope of protection of this application.

[0029] In some implementation scenarios, after obtaining the public opinion information, it can be stored in a database or corresponding storage.

[0030] In some embodiments, after obtaining the public opinion information, a summary of the obtained public opinion information may be extracted to obtain public opinion summary information.

[0031] In some implementation scenarios, a preset extraction model can be used to extract a summary of public opinion information. Among them, the preset extraction model can be obtained by training a neural network using each sentence in the public opinion information and the importance of each sentence. Of course, the above is only an exemplary description, and the method of extracting the summary of public opinion information is not limited to the above example. Technical personnel in the relevant field may make other changes under the inspiration of the technical essence of this application, but as long as the functions and effects achieved are the same or similar to those of this application, they should be covered within the scope of protection of this application.

[0032] S2: Using a public opinion classification model to process the designated public opinion summary information, obtain the public opinion category corresponding to the designated public opinion summary information; wherein the public opinion classification model is obtained by training a preset long-short-term memory model based on the public opinion summary information and the corresponding public opinion category; the neuron structure of the preset long-short-term memory model includes an external connection gate, and the external connection gate is used to strengthen the connection between input data and output data.

[0033] In the embodiment of this specification, after obtaining the specified public opinion summary information, the specified public opinion summary information can be input into the public opinion classification model to obtain the public opinion category corresponding to the specified public opinion summary information. Among them, the public opinion category can include positive public opinion category (positive public opinion sentiment), negative public opinion category (negative public opinion sentiment), neutral public opinion category, and of course the public opinion category can also include other categories, which can be determined according to actual conditions, and this embodiment of this specification does not limit this.

[0034] In the embodiments of this specification, before using the public opinion classification model to process the specified public opinion summary information, the public opinion summary information and the corresponding public opinion category can be used to train a preset long-short term memory model to obtain the public opinion classification model.

[0035] like Figure 2As shown, Figure 2 It is a flow chart of an embodiment of a training method for a public opinion classification model provided in this specification. In this embodiment, the method may include the following steps.

[0036] S20: Obtain target public opinion summary information; wherein the target public opinion summary information is pre-assigned with an exposure weight.

[0037] In some embodiments, before obtaining the target public opinion summary information, the following may be included: obtaining multiple pieces of public opinion information; extracting the summary of each piece of public opinion information to obtain multiple pieces of public opinion summary information; deleting the public opinion summary information whose similarity meets the preset condition among the multiple pieces of public opinion summary information to obtain the target public opinion summary information. The preset condition may be set according to the actual scenario, for example, it may be greater than 85%, greater than 90%, etc., and this specification embodiment does not limit this.

[0038] In some implementation scenarios, the above-mentioned multiple pieces of public opinion information can be currently generated or historically recorded public opinion information, which can be determined according to actual conditions, and this specification embodiment does not limit this. It should be noted that the relevant processing of public opinion information can refer to the method described in the above embodiment, and no further description is given.

[0039] In some implementation scenarios, after obtaining multiple pieces of public opinion information, a summary of each piece of public opinion information can be extracted to obtain multiple pieces of public opinion summary information.

[0040] In some implementation scenarios, in order to improve the accuracy of subsequent training models, after obtaining multiple pieces of public opinion summary information, the similarity between the public opinion summary information can be calculated, and then the public opinion summary information with higher similarity can be eliminated, and the remaining public opinion summary information can be saved in the target database. The target database can be a MySQL database, an Oracle database, etc.

[0041] In some implementation scenarios, the target public opinion summary information may be any piece of public opinion summary information in the target database.

[0042] In some implementation scenarios, after removing public opinion summary information with a high degree of similarity and saving the remaining public opinion summary information into the target database, an exposure weight can be randomly assigned to each public opinion summary information in the target database. The exposure weight can be used to characterize the importance of the public opinion summary information, and the exposure weight of the public opinion summary information can be a value greater than 0.

[0043] S22: Determine a feature word vector of the target public opinion summary information; wherein the feature word vector includes a plurality of feature words of the target public opinion summary information.

[0044] In the embodiments of this specification, after obtaining the target public opinion summary information, the feature word vector of the target public opinion summary information can be determined.

[0045] Since the target public opinion summary information may contain some redundant information (such as a large number of "de" characters, non-text information characters, etc.), in some implementation scenarios, the redundant information in each target public opinion summary information can be removed, and then feature words can be extracted from it to obtain the feature word vector of the target public opinion summary information. Among them, the feature word vector can contain multiple feature words of the target public opinion summary information. Feature words can be keywords extracted from the target public opinion summary information that can be used to characterize the target public opinion summary information, such as: default, overdue, etc.

[0046] In some implementation scenarios, data cleaning can be performed on the target public opinion summary information to remove the redundant information in the public opinion summary information. In this way, the effectiveness of the target public opinion summary information can be ensured, providing a guarantee for improving the accuracy of the subsequent training model.

[0047] In some implementation scenarios, in order to efficiently and accurately extract the corresponding feature words from the target public opinion summary information, a feature word recognition model pre-trained using a deep learning network can be used to extract at least one feature word included in the target public opinion summary information. Among them, the input of the feature word recognition model can be the classification label of the public opinion summary information and the text of this public opinion summary information, and the output can be at least one feature word included in this public opinion summary information. Among them, the sensitive keywords (feature words) involved in different fields may be different.

[0048] Since the sensitive keywords involved in different fields may vary, therefore, in the embodiments of this specification, the deep learning network is pre-trained using the classification label of the public opinion summary information and the text of the public opinion summary information to obtain a feature word recognition model, and then the feature word recognition model obtained by training is used to extract the feature words included in the target public opinion summary information, which can make the determined feature word vector of the target public opinion summary information more accurate.

[0049] S24: Calculate the TF-IDF values of each feature word in the feature word vector to obtain the target summary vector of the target public opinion summary information.

[0050] In the embodiments of this specification, after determining the feature word vector of the target public opinion summary information, the TF-IDF values of each feature word in the feature word vector can be calculated to obtain the target summary vector of the target public opinion summary information.

[0051] In some embodiments, the calculation of the TF-IDF value of each feature word in the feature word vector to obtain the target summary vector of the target public opinion summary information may include: counting the number of times the target feature word in the feature word vector appears in the target public opinion summary information; determining the number of times the feature word that appears most frequently in the target public opinion summary information; calculating the word frequency of the target feature word based on the number of times the target feature word appears in the target public opinion summary information and the number of times the feature word that appears most frequently in the target public opinion summary information; obtaining the total number of public opinion summary information recorded in the target database; determining the number of public opinion summary information containing the target feature word in the target database; calculating the inverse document frequency of the target feature word based on the total number of public opinion summary information recorded in the target database and the number of public opinion summary information containing the target feature word in the target database; taking the product of the word frequency and the inverse document frequency of the target feature word as the TF-IDF value of the target feature word; and obtaining the target summary vector of the target public opinion summary information based on the TF-IDF value of each feature word in the feature word vector. Among them, TF-IDF (Term Frequency–Inverse Document Frequency) is a commonly used weighting technology for information retrieval and data mining. TF stands for term frequency and IDF stands for inverse document frequency. TF-IDF is a statistical method used to evaluate the importance of a word to a document set or a document in a corpus. The importance of a word increases in direct proportion to the number of times it appears in a document, but at the same time it decreases in inverse proportion to the frequency of its appearance in the corpus.

[0052] In some implementation scenarios, the word frequency and the inverse document frequency can be calculated respectively, and then the TF-IDF value of each feature word in the feature word vector can be calculated based on the word frequency and the inverse document frequency. Among them, the TF-IDF value of the feature word can represent the importance of the feature word in the target public opinion information.

[0053] In some implementation scenarios, the frequency of the target feature word can be calculated according to the following formula:

[0054]

[0055] Among them, TF i is the frequency of the target feature word, n i is the number of times the target feature word appears in the target public opinion summary information, n j is the number of occurrences of the feature word that appears most frequently in the target public opinion summary information. The target feature word can be any feature word in the feature word vector.

[0056] In some implementation scenarios, the inverse document frequency of the target feature word can be calculated according to the following formula:

[0057]

[0058] Among them, IDF i is the inverse document frequency of the target feature word; N is the total number of public opinion summary information recorded in the target database, M i is the number of public opinion summary information containing the target feature word in the target database. The target database may be a database for recording public opinion summary information.

[0059] In some implementation scenarios, after obtaining the term frequency and inverse document frequency of the target feature word, the product of the term frequency and the inverse document frequency of the target feature word can be used as the TF-IDF value of the target feature word. Similarly, the TF-IDF value of each feature word in the feature word vector can be obtained in a similar manner.

[0060] In some implementation scenarios, after obtaining the TF-IDF value of each feature word in the feature word vector, the TF-IDF value of each feature word can be arranged in order to form a vector, and the vector is used as the target summary vector of the target public opinion summary information. Similarly, the summary vector of each public opinion summary information in the target database can be obtained in a similar manner.

[0061] S26: Determine the text similarity of the target public opinion summary information based on the exposure weight of the target public opinion summary information and the target summary vector; wherein the text similarity is used to characterize the public opinion category of the target public opinion summary information.

[0062] In the embodiment of this specification, after obtaining the target summary vector of the target public opinion summary information, the text similarity of the target public opinion summary information can be determined based on the exposure weight and the target summary vector of the target public opinion summary information. Among them, the text similarity can be used to characterize the public opinion category of the target public opinion summary information. The public opinion category can include positive public opinion category (positive public opinion sentiment), negative public opinion category (negative public opinion sentiment), neutral public opinion category, and of course the public opinion category can also include others, which can be determined according to the actual situation, and the embodiment of this specification does not limit this.

[0063] Since the more popular or important the public opinion information is, the greater the probability of it appearing on multiple platforms and channels, in order to accurately determine the public opinion category of the target public opinion summary information and meet the requirements for analyzing the importance and risk of public opinion, the text similarity of the target public opinion summary information can be further determined based on the exposure weight and target summary vector of the target public opinion summary information.

[0064] In some embodiments, determining the text similarity of the target public opinion summary information based on the exposure weight and the target summary vector of the target public opinion summary information may include: obtaining the summary vector of the remaining public opinion summary information in the target database; calculating the text similarity between the target public opinion summary information and the remaining public opinion summary information in the target database based on the exposure weight, the target summary vector and the summary vector of the remaining public opinion summary information in the target database, and obtaining a text similarity set; and selecting the text similarity with the largest value in the text similarity set as the text similarity of the target public opinion summary information.

[0065] In some implementation scenarios, the target database includes multiple pieces of public opinion summary information. In this way, the text similarity between the target public opinion summary information and each of the remaining public opinion summary information can be calculated, and then the maximum value can be selected as the text similarity of the target public opinion summary information. For example, the target database includes public opinion summary information 1, public opinion summary information 2, and public opinion summary information 3. When determining the text similarity of public opinion summary information 1, public opinion summary information 1 can be used as the target public opinion summary information, and then the text similarities between public opinion summary information 1 and public opinion summary information 2 and public opinion summary information 3 are calculated, respectively, and recorded as similarities a12 and a13, and finally a12 and a13 are compared, and the maximum value of a12 and a13 is used as the text similarity of public opinion summary information 1; similarly, when determining the text similarity of public opinion summary information 2, public opinion summary information 2 can be used as the target public opinion summary information, and then the text similarities between public opinion summary information 1 and public opinion summary information 2 and public opinion summary information 3 are calculated, respectively. The text similarities between public opinion summary information 2 and public opinion summary information 1 and public opinion summary information 3 are recorded as similarities a21 and a23 respectively. Finally, a21 and a23 are compared, and the maximum value of a21 and a23 is taken as the text similarity of public opinion summary information 2. When determining the text similarity of public opinion summary information 3, public opinion summary information 3 can be used as the target public opinion summary information, and then the text similarities between public opinion summary information 3 and public opinion summary information 1 and public opinion summary information 2 are calculated respectively, which are recorded as similarities a31 and a32 respectively. Finally, a31 and a32 are compared, and the maximum value of a31 and a32 is taken as the text similarity of public opinion summary information 2.

[0066] In some implementation scenarios, after obtaining the text similarity of each piece of public opinion summary information, the public opinion category of the target summary information can be further determined based on the text similarity.

[0067] In some implementation scenarios, the text similarity between the target public opinion summary information and the remaining public opinion summary information in the target database can be calculated according to the following formula:

[0068]

[0069] Among them, cos(θ w) represents text similarity, w represents the exposure weight of the target public opinion summary information, tanh(w) represents the normalization of the exposure weight of the target public opinion summary information, x represents the target summary vector of the target public opinion summary information, y represents the summary vector of any remaining public opinion summary information in the target database, and the vector dimensions of x and y are the same.

[0070] Of course, the text similarity between the target public opinion summary information and the remaining public opinion summary information in the target database can also be calculated by other means. Technical personnel in the relevant field may make other changes inspired by the technical essence of this application, but as long as the functions and effects achieved are the same or similar to those of this application, they should be covered within the scope of protection of this application.

[0071] S28: Using the target public opinion summary information and the corresponding text similarity to train a preset long-short-term memory model to obtain a public opinion classification model; wherein the neuron structure of the preset long-short-term memory model includes an external connection gate, and the external connection gate is used to strengthen the connection between input data and output data.

[0072] In the embodiments of this specification, after determining the text similarity of the target public opinion summary information, the target public opinion summary information and the corresponding text similarity can be used to train a preset long short-term memory model to obtain a public opinion classification model.

[0073] In some embodiments, the neuron structure of the preset long short-term memory model is determined by adding an external connection gate on the basis of the first neuron structure. Among them, the first neuron structure is the neuron structure in the long short-term memory model. The external connection gate can be used to strengthen the connection between input data and output data. The long short-term memory model (LSTM, Long Short-Term Memory) is a time recurrent neural network, which is specially designed to solve the long-term dependency problem existing in general RNN (recurrent neural network). On the basis of RNN, LSTM adds memory units to each neural unit in the hidden layer, so that the memory information on the time series can be controlled. Each time LSTM passes between the units in the hidden layer, it passes through several controllable gates (forget gate, input gate, output gate), which can control the memory and forgetting degree of previous information and current information, so that the LSTM network has a long-term memory function.

[0074] In some embodiments, the outer gate function in the neuron structure of the preset long short-term memory model may be:

[0075]

[0076] Among them, w i represents the exposure weight of the i-th target public opinion summary information, i∈(0...N), N represents the number of target public opinion summary information, x iRepresents the input information of the current neuron, Q i represents the number of interaction rounds, x i-1 Represents the input information of the previous neuron, h t-1 Represents the output information of the previous neuron, and sigmoid represents the activation function. Sigmoid is a common S-shaped function in biology, also known as the S-shaped growth curve. In information science, due to its monotonic and inverse monotonic properties, the sigmoid function is often used as an activation function of a neural network to map variables between 0 and 1.

[0077] In the embodiments of this specification, interactive calculations are performed through the external gate function, so that the input and the previous output information can be more strongly associated, and important information can be strengthened, thereby improving the accuracy of the training model.

[0078] In the embodiments of this specification, based on the original logic of LSTM, by adding external connection gates, not only the information memory between neural units is strengthened, but also the original information is reinforced again through the enhanced memory of input and output information. In this way, the more important information is reinforced once more when it is output, so that it can still be better remembered in a longer text.

[0079] In some embodiments, after the preset long short-term memory model is trained using the target public opinion summary information and the corresponding text similarity to obtain a public opinion classification model, the public opinion classification model can be saved. In this way, when the public opinion category needs to be determined later, the public opinion classification model can be directly called, thereby improving classification efficiency.

[0080] In some embodiments, when it is necessary to determine the public opinion category, a public opinion classification model can be obtained, and the specified public opinion summary information can be input into the public opinion classification model to obtain the text similarity corresponding to the specified public opinion summary information, wherein the text similarity can represent the public opinion category of the specified public opinion summary information.

[0081] In some implementation scenarios, after the public opinion classification model is used to determine the public opinion category, the public opinion category can be stored. Furthermore, the classification result can be sent to the user in a timely manner via mobile phone text messages or other means.

[0082] In the embodiments of the present specification, by allocating exposure weights to each piece of public opinion summary information, and determining the text similarity of the public opinion summary information based on the exposure weights and summary vectors of the public opinion summary information, it is possible to increase the importance of high-frequency articles by assigning weights to such articles; before training the model, the importance of the data layer is judged in advance, which can improve the accuracy of subsequent model training; by adding an external connection gate on the basis of LSTM, not only can the connection between input and output data be strengthened, so that the memory between the upper and lower information transmissions is strengthened, but also the model's prediction of the classification and importance of public opinion information can be effectively improved.

[0083] Of course, the above is only an exemplary description, and the embodiments of this specification are not limited to the above examples. Technical personnel in the relevant field may make other changes based on the technical essence of this application. However, as long as the functions and effects achieved are the same or similar to those of this application, they should be included in the scope of protection of this application.

[0084] From the above description, it can be seen that the embodiment of the present application can obtain the specified public opinion summary information, use the public opinion classification model to process the specified public opinion summary information, and obtain the public opinion category corresponding to the specified public opinion summary information. Since the public opinion classification model is obtained by training the preset long-short term memory model based on the public opinion summary information and the corresponding public opinion category, and the neuron structure of the preset long-short term memory model includes an external connection gate, in this way, not only is it not necessary to use the official pre-trained model and then combine it with the scene data for model training every time, but also by adding an external connection gate for interactive calculation, the important information output by the previous neuron can be strengthened again before the input information is passed to the next neuron each time, so that the public opinion category can be determined efficiently and accurately.

[0085] In this specification, each embodiment of the above method is described in a progressive manner, and the same or similar parts between the embodiments can be referenced to each other, and each embodiment focuses on the differences from other embodiments. For relevant parts, refer to the partial description of the method embodiment.

[0086] Based on the above-mentioned method for determining the category of public opinion, one or more embodiments of this specification also provide a device for determining the category of public opinion. The device may include a system (including a distributed system), software (application), module, component, server, client, etc. that uses the method described in the embodiment of this specification and is combined with the necessary implementation hardware. Based on the same innovative concept, the device in one or more embodiments provided in the embodiment of this specification is as described in the following embodiments. Since the implementation scheme of the device to solve the problem is similar to the method, the implementation of the specific device in the embodiment of this specification can refer to the implementation of the aforementioned method, and the repetitions will not be repeated. As used below, the term "unit" or "module" can be a combination of software and / or hardware that implements a predetermined function. Although the device described in the following embodiments is preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceived.

[0087] Specifically, Figure 3 is a schematic diagram of a module structure of an embodiment of a device for determining a public opinion category provided in this specification, such as Figure 3 As shown, a device for determining a public opinion category provided in this specification may include: an acquisition module 120 and an obtaining module 122 .

[0088] The acquisition module 120 can be used to obtain specified public opinion summary information;

[0089] The acquisition module 122 can be used to process the specified public opinion summary information using the public opinion classification model to obtain the public opinion category corresponding to the specified public opinion summary information; wherein the public opinion classification model is obtained by training a preset long-short-term memory model based on the public opinion summary information and the corresponding public opinion category; the neuron structure of the preset long-short-term memory model includes an external connection gate, and the external connection gate is used to strengthen the connection between input data and output data.

[0090] It should be noted that the above-mentioned device may also include other implementation modes according to the description of the method embodiment. The specific implementation mode may refer to the description of the relevant method embodiment, which will not be described one by one here.

[0091] like Figure 4 As shown, Figure 4 This is a schematic diagram of the module structure of an embodiment of a training device for a public opinion classification model provided in this specification. The device may include: an acquisition module 210, a first determination module 212, a calculation module 214, a second determination module 216, and a training module 218.

[0092] The acquisition module 210 may be used to acquire target public opinion summary information; wherein the target public opinion summary information is pre-assigned with an exposure weight;

[0093] The first determination module 212 may be used to determine a feature word vector of the target public opinion summary information; wherein the feature word vector includes multiple feature words of the target public opinion summary information;

[0094] The calculation module 214 may be used to calculate the TF-IDF value of each feature word in the feature word vector to obtain a target summary vector of the target public opinion summary information;

[0095] The second determination module 216 may be used to determine the text similarity of the target public opinion summary information based on the exposure weight of the target public opinion summary information and the target summary vector; wherein the text similarity is used to characterize the public opinion category of the target public opinion summary information;

[0096] The training module 218 can be used to train the preset long-short-term memory model using the target public opinion summary information and the corresponding text similarity to obtain a public opinion classification model; wherein the neuron structure of the preset long-short-term memory model includes an external connection gate, which is used to strengthen the connection between input data and output data.

[0097] It should be noted that the above-mentioned device may also include other implementation modes according to the description of the method embodiment. The specific implementation mode may refer to the description of the relevant method embodiment, which will not be described one by one here.

[0098] The present specification also provides an embodiment of a device for determining a public opinion category, comprising a processor and a memory for storing processor executable instructions, wherein the instructions, when executed by the processor, implement the following steps: obtaining specified public opinion summary information; processing the specified public opinion summary information using a public opinion classification model to obtain a public opinion category corresponding to the specified public opinion summary information; wherein the public opinion classification model is obtained by training a preset long-short-term memory model based on the public opinion summary information and the corresponding public opinion category; the neuron structure of the preset long-short-term memory model includes an external connection gate, and the external connection gate is used to strengthen the connection between input data and output data.

[0099] It should be noted that the above-mentioned device may also include other implementations according to the description of the method or device embodiment. The specific implementation methods can refer to the description of the relevant method embodiments, which will not be described one by one here.

[0100] The method embodiments provided in this specification can be executed in a mobile terminal, a computer terminal, a server or a similar computing device. Taking running on a server as an example, Figure 5 1 is a hardware structure block diagram of an embodiment of a server for determining the category of public opinion provided in this specification. The server may be the apparatus for determining the category of public opinion or the device for determining the category of public opinion in the above-mentioned embodiment. Figure 5As shown, the server 10 may include one or more (only one is shown in the figure) processors 100 (the processor 100 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA), a memory 200 for storing data, and a transmission module 300 for communication functions. It can be understood by those skilled in the art that Figure 5 The structure shown is only for illustration and does not limit the structure of the above electronic device. Figure 5 More or fewer components shown in the figure may also include other processing hardware, such as a database or multi-level cache, GPU, or other hardware with Figure 5 Different configurations are shown.

[0101] The memory 200 can be used to store software programs and modules of application software, such as program instructions / modules corresponding to the method for determining the category of public opinion in the embodiment of this specification. The processor 100 executes various functional applications and data processing by running the software programs and modules stored in the memory 200. The memory 200 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 200 may further include a memory remotely arranged relative to the processor 100, and these remote memories may be connected to the computer terminal via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0102] The transmission module 300 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of a computer terminal. In one example, the transmission module 300 includes a network adapter (Network Interface Controller, NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission module 300 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.

[0103] The above is a description of a specific embodiment of the specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0104] The methods or devices described in the above embodiments provided in this specification can implement business logic through computer programs and record them on storage media, and the storage media can be read and executed by computers to achieve the effects of the solutions described in the embodiments of this specification. The storage medium may include a physical device for storing information, which is usually to digitize the information and then store it in a medium using electrical, magnetic or optical methods. The storage medium may include: devices that use electrical energy to store information, such as various types of memories, such as RAM, ROM, etc.; devices that use magnetic energy to store information, such as hard disks, floppy disks, magnetic tapes, magnetic core memories, bubble memories, and U disks; devices that use optical methods to store information, such as CDs or DVDs. Of course, there are other types of readable storage media, such as quantum memories, graphene memories, and so on.

[0105] The above-mentioned method or device embodiment for determining the category of public opinion provided in this specification can be implemented by a processor in a computer executing corresponding program instructions, such as using the C++ language of the Windows operating system to implement it on a PC, on a Linux system, or other methods such as using Android or iOS system programming languages ​​to implement it on a smart terminal, as well as based on the processing logic of a quantum computer.

[0106] It should be noted that the devices, equipment, and systems described in the specification may also include other implementation methods according to the description of the relevant method embodiments. The specific implementation methods can refer to the description of the corresponding method embodiments, which will not be described one by one here.

[0107] Each embodiment in this application is described in a progressive manner, and the same or similar parts between the embodiments can be referenced to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the hardware + program embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0108] For the convenience of description, the above devices are described in various modules according to their functions. Of course, when implementing one or more of the present specification, the functions of some modules can be implemented in the same or more software and / or hardware, and the modules that implement the same function can also be implemented by a combination of multiple sub-modules or sub-units.

[0109] The present invention is described with reference to the flowcharts and / or block diagrams of the methods, devices, equipment, and systems according to the embodiments of the present invention. It should be understood that it can be implemented by computer program instructions, and these computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device produce a device for implementing the specified function. These computer program instructions can also be stored in a computer-readable memory that can guide the computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device, and the instruction device is implemented in the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0110] Those skilled in the art will appreciate that one or more embodiments of the present specification may be provided as a method, system or computer program product. Therefore, one or more embodiments of the present specification may be provided in the form of a complete hardware embodiment, a complete software embodiment or an embodiment combining software and hardware.

[0111] The above is only an example of one or more embodiments of this specification and is not intended to limit one or more embodiments of this specification. For those skilled in the art, one or more embodiments of this specification may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of this application should be included in the scope of the claims.

Claims

1. A method for determining a public opinion category, characterized in that: include: Get the specified public opinion summary information; The designated public opinion summary information is processed by using a public opinion classification model to obtain a public opinion category corresponding to the designated public opinion summary information; wherein the public opinion classification model is obtained by training a preset long-short term memory model based on the public opinion summary information and the corresponding public opinion category; the neuron structure of the preset long-short term memory model includes an external connection gate, and the external connection gate is used to strengthen the connection between input data and output data; The public opinion classification model is trained in the following way: Obtaining target public opinion summary information; wherein the target public opinion summary information is pre-assigned with an exposure weight; Determine a feature word vector of the target public opinion summary information; wherein the feature word vector includes multiple feature words of the target public opinion summary information; Calculate the TF-IDF value of each feature word in the feature word vector to obtain the target summary vector of the target public opinion summary information; Based on the exposure weight of the target public opinion summary information and the target summary vector, determining the text similarity of the target public opinion summary information; wherein the text similarity is used to characterize the public opinion category of the target public opinion summary information; The preset long-short-term memory model is trained using the target public opinion summary information and the corresponding text similarity to obtain a public opinion classification model; wherein the neuron structure of the preset long-short-term memory model includes an external connection gate, which is used to strengthen the connection between input data and output data.

2. A method for training a public opinion classification model, characterized in that: include: Obtaining target public opinion summary information; wherein the target public opinion summary information is pre-assigned with an exposure weight; Determine a feature word vector of the target public opinion summary information; wherein the feature word vector includes multiple feature words of the target public opinion summary information; Calculate the TF-IDF value of each feature word in the feature word vector to obtain the target summary vector of the target public opinion summary information; Based on the exposure weight of the target public opinion summary information and the target summary vector, determining the text similarity of the target public opinion summary information; wherein the text similarity is used to characterize the public opinion category of the target public opinion summary information; The preset long-short-term memory model is trained using the target public opinion summary information and the corresponding text similarity to obtain a public opinion classification model; wherein the neuron structure of the preset long-short-term memory model includes an external connection gate, which is used to strengthen the connection between input data and output data.

3. The method according to claim 2, characterized in that Before obtaining the target public opinion summary information, the following steps are included: Obtain multiple pieces of public opinion information; Extract the summary of each piece of public opinion information to obtain multiple pieces of public opinion summary information; The public opinion summary information whose similarity meets a preset condition is deleted from the multiple pieces of public opinion summary information to obtain target public opinion summary information.

4. The method according to claim 2, characterized in that: The step of calculating the TF-IDF value of each feature word in the feature word vector to obtain a target summary vector of the target public opinion summary information includes: Counting the number of times a target feature word in the feature word vector appears in the target public opinion summary information; Determine the number of occurrences of the feature word that appears most frequently in the target public opinion summary information; Calculate the word frequency of the target feature word according to the number of times the target feature word appears in the target public opinion summary information and the number of times the feature word that appears most frequently in the target public opinion summary information; Get the total number of public opinion summary information recorded in the target database; Determine the amount of public opinion summary information containing the target characteristic word in the target database; Calculating the inverse document frequency of the target feature word according to the total amount of public opinion summary information recorded in the target database and the amount of public opinion summary information containing the target feature word in the target database; The product of the word frequency and the inverse document frequency of the target feature word is taken as the TF-IDF value of the target feature word; Based on the TF-IDF value of each feature word in the feature word vector, a target summary vector of the target public opinion summary information is obtained.

5. The method according to claim 4, characterized in that The determining the text similarity of the target public opinion summary information based on the exposure weight of the target public opinion summary information and the target summary vector includes: Obtain summary vectors of remaining public opinion summary information in the target database; Based on the exposure weight of the target public opinion summary information, the target summary vector, and the summary vectors of the remaining public opinion summary information in the target database, respectively calculating the text similarity between the target public opinion summary information and the remaining public opinion summary information in the target database to obtain a text similarity set; The text similarity with the largest value in the text similarity set is selected as the text similarity of the target public opinion summary information.

6. The method according to claim 5, characterized in that The text similarity between the target public opinion summary information and the remaining public opinion summary information in the target database is calculated according to the following formula: Among them, cos(θ w ) represents text similarity, w represents the exposure weight of the target public opinion summary information, tanh(w) represents the normalization of the exposure weight of the target public opinion summary information, x represents the target summary vector of the target public opinion summary information, y represents the summary vector of any remaining public opinion summary information in the target database, and the vector dimensions of x and y are the same.

7. The method according to claim 2, characterized in that The external gate function in the neuron structure of the preset long short-term memory model is: Among them, w i represents the exposure weight of the i-th target public opinion summary information, i∈(0...N), N represents the number of target public opinion summary information, x i Represents the input information of the current neuron, Q i represents the number of interaction rounds, x i-1 Represents the input information of the previous neuron, h t-1 Represents the output information of the previous neuron, and sigmoid represents the activation function.

8. A device for determining the category of public opinion, characterized in that: include: The acquisition module is used to obtain the specified public opinion summary information; An acquisition module is used to process the specified public opinion summary information using a public opinion classification model to obtain the public opinion category corresponding to the specified public opinion summary information; wherein the public opinion classification model is obtained by training a preset long-short term memory model based on the public opinion summary information and the corresponding public opinion category; the neuron structure of the preset long-short term memory model includes an external connection gate, and the external connection gate is used to strengthen the connection between input data and output data; The public opinion classification model is trained in the following way: Obtaining target public opinion summary information; wherein the target public opinion summary information is pre-assigned with an exposure weight; Determine a feature word vector of the target public opinion summary information; wherein the feature word vector includes multiple feature words of the target public opinion summary information; Calculate the TF-IDF value of each feature word in the feature word vector to obtain the target summary vector of the target public opinion summary information; Based on the exposure weight of the target public opinion summary information and the target summary vector, determining the text similarity of the target public opinion summary information; wherein the text similarity is used to characterize the public opinion category of the target public opinion summary information; The preset long-short-term memory model is trained using the target public opinion summary information and the corresponding text similarity to obtain a public opinion classification model; wherein the neuron structure of the preset long-short-term memory model includes an external connection gate, which is used to strengthen the connection between input data and output data.

9. A training device for a public opinion classification model, characterized in that: include: An acquisition module, used to acquire target public opinion summary information; wherein the target public opinion summary information is pre-assigned with an exposure weight; A first determination module is used to determine a feature word vector of the target public opinion summary information; wherein the feature word vector includes multiple feature words of the target public opinion summary information; A calculation module, used to calculate the TF-IDF value of each feature word in the feature word vector to obtain a target summary vector of the target public opinion summary information; A second determination module is used to determine the text similarity of the target public opinion summary information based on the exposure weight of the target public opinion summary information and the target summary vector; wherein the text similarity is used to characterize the public opinion category of the target public opinion summary information; A training module is used to train a preset long-short-term memory model using the target public opinion summary information and the corresponding text similarity to obtain a public opinion classification model; wherein the neuron structure of the preset long-short-term memory model includes an external connection gate, and the external connection gate is used to strengthen the connection between input data and output data.

10. A device for determining a category of public opinion, characterized in that: The method comprises at least one processor and a memory storing computer executable instructions, wherein the processor implements the steps of the method according to any one of claims 1 to 7 when executing the instructions.

11. A computer-readable storage medium, characterized in that: Computer instructions are stored thereon, and when the instructions are executed, the steps of the method described in any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • Network public opinion analysis method and system

    CN110232109A

  • Financial event discovery method based on big data

    CN110750622A

  • Public opinion monitoring method and device based on big data, computer equipment and medium

    CN111538931A

  • Online public opinion multi-modal emotion recognition method and system based on facial expressions and text information

    CN111694959A

  • Public opinion positive and negative classification method

    CN111831824A