An opinion analysis method, system, computer device and storage medium
By processing internet data through word segmentation and vectorization and training classification models, the problem of low efficiency in internet data analysis has been solved, enabling efficient public opinion analysis and keyword extraction, and reducing the cost of manual annotation.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-10-19
- Publication Date
- 2026-03-31
AI Technical Summary
How to efficiently analyze internet data, especially public opinion analysis, and reduce the manpower and time costs of manual data annotation.
By acquiring the public opinion data to be analyzed, preprocessing it to obtain word segmentation vectors, using the labeled partial word segmentation vectors to train a public opinion classification model, outputting classification results, obtaining keywords corresponding to each public opinion type, and analyzing them according to preset rules.
It greatly reduces the manpower and time costs of manual data annotation, improves the efficiency of public opinion analysis, and can accurately obtain public opinion types and keywords, and analyze the relationship between public opinion and sales over time.
Smart Images

Figure CN115563282B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of network data analysis, and in particular to an opinion analysis method and system, a computer device and a storage medium. BACKGROUND
[0002] With the development of the Internet, people often experience life through different network platforms, analyze, evaluate and use certain brands or products, and so on. More and more enterprises obtain user evaluations, demands and the like of the business, products and brands of the enterprises through the Internet. However, due to the complexity and diversity of Internet data, how to efficiently analyze the Internet data becomes a problem to be solved. SUMMARY
[0003] Based on the above problems, the present application provides an opinion analysis method, system, computer device and storage medium, which can improve the efficiency of opinion analysis.
[0004] The present application discloses the following technical solutions:
[0005] The present application provides an opinion analysis method, comprising:
[0006] Obtaining opinion data to be analyzed;
[0007] Preprocessing the opinion data to be analyzed to obtain a word segmentation vector;
[0008] Classifying the word segmentation vector using an opinion classification model to output a classification result, the classification result including the opinion type of each word segmentation vector; the opinion classification model is obtained by training a to-be-trained opinion classification model using a part of the word segmentation vector labeled; the part of the word segmentation vector labeled is obtained by labeling a label representing the opinion type based on the vector similarity of the part of the word segmentation vector;
[0009] Obtaining a keyword corresponding to each opinion type according to the classification result;
[0010] Analyzing the keyword according to a preset rule to obtain an analysis result.
[0011] In one possible implementation manner,
[0012] The training method of the opinion classification model comprises:
[0013] Inputting the word segmentation vector into an LDA topic model to obtain an LDA topic vector, the LDA topic vector including a topic cluster classification to which each word segmentation vector belongs and a distribution probability vector of each dimension topic cluster;
[0014] obtaining a first vector manually labeled, the manual labeling being a label representing a public opinion type, and the first vector being a first preset number of vectors obtained from each dimension topic cluster;
[0015] According to the distribution probability vector of each dimension topic cluster of each segmented vector, a second vector with a similarity greater than a first preset threshold to each first vector is obtained, and the second vector is labeled with the same label as the corresponding first vector;
[0016] According to the distribution probability vector of each dimension topic cluster of each segmented vector, a third vector with a similarity greater than a second preset threshold to each second vector is obtained, and the third vector is labeled with the same label as the corresponding second vector; wherein the second preset threshold is greater than the first preset threshold;
[0017] The first vector, the labeled second vector, and the labeled third vector are used to train a public opinion classification model.
[0018] In one possible implementation, the preprocessing of the to-be-analyzed public opinion data to obtain a segmented vector includes:
[0019] The to-be-analyzed public opinion data is segmented according to a stop word library to obtain a first segmented result;
[0020] The frequency of each word in the segmented result is counted, and words with a frequency higher than a first threshold or lower than a second threshold are added to the stop word library;
[0021] The to-be-analyzed public opinion data is segmented again according to the latest stop word library to obtain a second segmented result;
[0022] The second segmented result is converted into a segmented vector.
[0023] In one possible implementation, the analysis of the key word according to a preset rule to obtain an analysis result includes:
[0024] The key word is analyzed based on the sales corresponding to the time sequence to obtain an analysis result.
[0025] In one possible implementation, the obtaining of the key word corresponding to each public opinion type according to the classification result includes:
[0026] According to the public opinion type of the segmented vector and the key word information contained in the segmented vector, key words grouped by each public opinion type are obtained;
[0027] A preset number of key words with the highest frequency in each public opinion type group are obtained.
[0028] In a possible implementation, the public opinion type includes positive public opinion and negative public opinion.
[0029] The second aspect of the application provides a public opinion analysis system, comprising:
[0030] a public opinion obtaining unit configured to obtain public opinion data to be analyzed;
[0031] a word segmentation unit configured to pre-process the public opinion data to be analyzed to obtain a word segmentation vector;
[0032] a classification unit configured to classify the word segmentation vector using a public opinion classification model to output a classification result, the classification result including a public opinion type of each word segmentation vector; the public opinion classification model is obtained by training a public opinion classification model to be trained using a part of the word segmentation vector labeled with a label representing the public opinion type; and the part of the word segmentation vector is labeled with the label representing the public opinion type based on a vector similarity;
[0033] a keyword obtaining unit configured to obtain keywords corresponding to each public opinion type according to the classification result;
[0034] an analysis unit configured to analyze the keywords according to a preset rule to obtain an analysis result.
[0035] In a possible implementation, the classification unit includes a training unit of the public opinion classification model.
[0036] The training unit of the public opinion classification model includes:
[0037] a topic clustering unit configured to input the word segmentation vector into an LDA topic model to obtain an LDA topic vector, the LDA topic vector including a multi-dimensional topic cluster and a word distribution probability of each dimension topic cluster;
[0038] a first labeling unit configured to obtain a first vector labeled by a human being; the human labeling is a label representing a public opinion type; and the first vector is a first preset number of vectors obtained from each dimension cluster;
[0039] a second labeling unit configured to obtain a second preset number of second vectors having a similarity greater than a first preset threshold with each first vector, and label the second vectors with the same label as the corresponding first vector;
[0040] a third labeling unit configured to obtain a third preset number of third vectors having a similarity greater than a second preset threshold with each second vector, and label the third vectors with the same label as the corresponding second vector; and the second preset threshold is greater than the first preset threshold.
[0041] The training subunit is configured to train the opinion classification model to be trained by using the first labeled vector, the second labeled vector, and the third labeled vector.
[0042] The fourth aspect of the present application provides a computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, and when the processor executes the computer program, the opinion analysis method in any one of the first aspects of the embodiments of the present application is implemented.
[0043] The fifth aspect of the present application provides a computer readable storage medium, wherein instructions are stored in the computer readable storage medium, and when the instructions are executed on a terminal device, the terminal device executes the opinion analysis method in any one of the first aspects of the present application.
[0044] Compared with the prior art, the present application has the following beneficial effects:
[0045] The opinion analysis method provided by the present application comprises: obtaining opinion data to be analyzed; preprocessing the opinion data to be analyzed to obtain a word segmentation vector; classifying the word segmentation vector using an opinion classification model to output a classification result, wherein the classification result comprises an opinion type of each word segmentation vector; the opinion classification model is obtained by training an opinion classification model to be trained using a part of labeled word segmentation vectors; the part of labeled word segmentation vectors are obtained by labeling a part of word segmentation vectors with labels representing opinion types based on vector similarity; obtaining keywords corresponding to each opinion type according to the classification result; and analyzing the keywords according to a preset rule to obtain an analysis result. The opinion classification model trained by using the part of word segmentation vectors corresponding to the labeled opinion data is used to classify opinions and extract keywords of each opinion type for opinion analysis, which greatly reduces the labor cost and time cost of manual labeling data and improves the opinion analysis efficiency. BRIEF DESCRIPTION OF DRAWINGS
[0046] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the drawings needed in the embodiments or the prior art description will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor.
[0047] Figure 1 A schematic diagram of a scene example provided by the embodiment of the present application;
[0048] Figure 2 A flowchart of an opinion analysis method provided by the embodiment of the present application;
[0049] Figure 3A structure diagram of an opinion analysis system provided by an embodiment of the present application is provided.
[0050] Figure 4 A structure diagram of a computer device provided by an embodiment of the present application is provided. DETAILED DESCRIPTION
[0051] In order to make the above objectives, characteristics and advantages of the present application more obvious and easy to understand, the following will further specifically describe the embodiments of the present application with reference to the drawings and specific embodiments.
[0052] As described above, with the development of the Internet, people often experience life through different network platforms, analyze, evaluate and experience the use of certain brands or products, and more and more enterprises obtain the evaluation, demand and the like of users on the business, products and brands of the enterprises through the Internet. However, due to the complexity and diversity of Internet data, how to efficiently analyze the Internet data becomes a problem to be solved.
[0053] Therefore, the present application provides an opinion analysis method, system, computer device and storage medium. In order to facilitate understanding of the target detection method provided by the embodiments of the present application, the following will be described with reference to the scene example shown in the figure. Among them, Figure 1 A schematic diagram of a scene example provided by an embodiment of the present application is shown. The method can be applied to the terminal device 101. Figure 1
[0054] In actual application, the terminal device 101 obtains opinion data to be analyzed; pre-processes the opinion data to be analyzed to obtain a word segmentation vector; classifies the word segmentation vector using an opinion classification model to output a classification result, the classification result including the opinion type of each word segmentation vector; the opinion classification model is obtained by training a to-be-trained opinion classification model using a part of word segmentation vectors with labels; the part of word segmentation vectors with labels are obtained by labeling the part of word segmentation vectors with labels based on vector similarity to represent the opinion type; according to the classification result, obtain keywords corresponding to each opinion type; according to a preset rule, analyze the keywords to obtain an analysis result. Through the opinion classification and extraction of keywords of each opinion type by using the classification model trained without a large amount of manual labeling of corpus, the human cost and time cost of manual labeling of data are greatly reduced, and the opinion analysis efficiency is improved.
[0055] Those skilled in the art can understand that, Figure 1 The framework diagram shown is only one example in which the embodiments of the present application can be implemented. The scope of application of the embodiments of the present application is not limited by any aspect of the framework.
[0056] Based on the above description, the public opinion analysis method provided by the embodiments of the present invention will be described in detail below with reference to the accompanying drawings.
[0057] See Figure 2 This figure is a flowchart of a public opinion analysis method provided by an embodiment of the present invention. Figure 2 As shown, the methods for public opinion analysis include S210-270:
[0058] S210. Obtain the public opinion data to be analyzed.
[0059] This invention can obtain public opinion data through web crawling.
[0060] S220. Preprocess the public opinion data to be analyzed to obtain word segmentation vectors.
[0061] In some embodiments, S220 includes:
[0062] S221. Perform word segmentation on the public opinion data to be analyzed based on the stop word library to obtain the first word segmentation result;
[0063] S222. Calculate the word frequency of each word in the word segmentation results, and add words with word frequencies that are higher than the first threshold or lower than the second threshold to the stop word library;
[0064] S223. The public opinion data to be analyzed is segmented again according to the latest stop word library to obtain the second segmentation result;
[0065] S224. Convert the second word segmentation result into a word segmentation vector.
[0066] In one example, one piece of public opinion data corresponds to one word segmentation vector. Vectorization techniques are used to transform public opinion corpora into numerical representations.
[0067] In one example, a word segmentation model (using the jieba word segmentation tool) is used to segment each piece of public opinion. The frequency of each word in all segmented results is calculated, and words with excessively high or low frequencies are added to a stop word list. After updating the stop word list, the public opinion is segmented again to obtain the final segmentation results. During the segmentation stage, it's advisable to consider segmenting by part of speech, filtering out auxiliary words, function words, and adverbs, and focusing attention on adjectives, verbs, and nouns to make the segmentation results more targeted.
[0068] S230. Label some word segmentation vectors based on vector similarity to represent public opinion types, and obtain labeled partial word segmentation vectors.
[0069] S240. Use the labeled partial word segmentation vectors to train the public opinion classification model to be trained.
[0070] In some embodiments, S240 includes:
[0071] S241. Input the word segmentation vector into the LDA (Latent Dirichlet Allocation) topic model to obtain the LDA topic vector. The LDA topic vector includes the topic cluster classification to which each word segmentation vector belongs and the distribution probability vector of each dimension of the topic cluster.
[0072] In one example, the dimensions of the LDA topic vector can be set according to requirements, for example, to an 8-dimensional topic cluster.
[0073] S242. Obtain the first vector that has been manually labeled; the manual labeling refers to the labeling of the public opinion type; the first vector is a first preset number of vectors obtained from each dimension cluster.
[0074] S243. Based on the distribution probability vector of each dimension of the topic cluster of each word segmentation vector, obtain a second preset number of second vectors whose similarity to each first vector is greater than a first preset threshold, and label the second vectors with the same label as the corresponding first vectors.
[0075] S244. Based on the distribution probability vector of each dimension of the topic cluster of each word segmentation vector, obtain a third preset number of third vectors whose similarity to each second vector is greater than a second preset threshold, and label the third vectors with the same label as the corresponding second vectors; wherein, the second preset threshold is greater than the first preset threshold.
[0076] S245. Use the labeled first vector, labeled second vector, and labeled third vector to train the public opinion classification model to be trained.
[0077] In this embodiment, a small number of public opinion records are first manually labeled, and then the most similar public opinion records are labeled using algorithms based on LDA topic vectors. This can improve labeling efficiency, reduce the human and time costs of manually labeling data, and thus improve the efficiency of model training.
[0078] In one example, the operator manually selects 10 positive and 10 negative sentiment vectors from each of the 8 topic clusters, for a total of 160 vectors. The selected sentiment vectors must be differentiated (e.g., price, performance, car model). After manually labeling these 160 records, the operator calculates the 10 closest sentiment records based on the LDA probability distribution of each record (vector similarity can be set to 90% or higher as a threshold), resulting in a total of 1600 algorithmically labeled corpora. Then, based on vector similarity, the operator calculates the 10 closest sentiment records to these 1600 records (vector similarity can be set to 95% or higher as a threshold).
[0079] In one example, the labeled corpus (i.e., the labeled first vector, labeled second vector, and labeled third vector) is converted into TF-IDF vectors, and these TF-IDF vectors are then input into the public opinion classification model to be trained. TF-IDF vectors facilitate subsequent keyword extraction based on word frequency.
[0080] In one example, the labeled first vector, labeled second vector, and labeled third vector are directly input into the public opinion classification model to be trained.
[0081] S250. Use the trained public opinion classification model to classify all word segmentation vectors and output the classification results, which include the public opinion type of each word segmentation vector.
[0082] In some embodiments, the public opinion type includes positive public opinion and negative public opinion.
[0083] S260. Obtain the keywords corresponding to each type of public opinion based on the classification results.
[0084] In some embodiments, S260 includes:
[0085] S261. Based on the public opinion type of the word segmentation vector and the keyword information contained in the word segmentation vector, obtain the keywords for each public opinion type group.
[0086] In one example, if the word segmentation vectors of public opinion data are in the form of LDA topic vectors, containing all keywords and their weights under each topic cluster of the public opinion data, after classifying the LDA topic vectors of all public opinion data using a public opinion classification model, all keywords for each public opinion type group can be obtained. Statistical analysis of all keywords for each public opinion type group yields the word frequency results.
[0087] In one example, if the word segmentation vectors of public opinion data are in TFIDF vector form, containing the keywords of the public opinion data and their word frequencies, then by classifying the TFIDF vectors of all public opinion data using a public opinion classification model, we can obtain the keywords and their word frequencies for each public opinion type group.
[0088] S262. Obtain the preset number of keywords with the highest word frequency in each public opinion type group.
[0089] In one example, keywords could be reasons that influence product sales.
[0090] S270. Analyze the keywords according to preset rules to obtain analysis results.
[0091] In some embodiments, S270 includes:
[0092] The keywords were analyzed based on the sales figures corresponding to the time series, and the analysis results were obtained.
[0093] This embodiment can analyze the specific situation of positive and negative product reviews, the trend of product reputation over time, and the reasons for the decline and rise of reputation by analyzing the relationship between public opinion keywords and changes in sales volume over time.
[0094] The public opinion analysis method provided in this invention involves: acquiring public opinion data to be analyzed; obtaining word segmentation vectors based on the public opinion data; inputting vectorized corpus data into a trained public opinion classification model and outputting classification results; the classification results including tags representing positive and negative public opinion; extracting a preset number of keywords with the highest word frequency from the classification results; and obtaining analysis results based on preset rules and the keywords. This invention, through classification model and keyword analysis, achieves public opinion analysis while significantly reducing the labor and time costs of manual data annotation, thus improving efficiency.
[0095] See Figure 3 This figure is a structural diagram of a public opinion analysis system provided in an embodiment of the present invention. Figure 3 As shown, the public opinion analysis system includes:
[0096] The public opinion acquisition unit 310 is used to acquire public opinion data to be analyzed.
[0097] The word segmentation unit 320 is used to preprocess the public opinion data to be analyzed to obtain word segmentation vectors;
[0098] Classification unit 330 is used to classify word segmentation vectors using a public opinion classification model and output classification results, including the public opinion type of each word segmentation vector; the public opinion classification model is obtained by training a public opinion classification model to be trained using labeled partial word segmentation vectors; the labeled partial word segmentation vectors are obtained by labeling partial word segmentation vectors with tags representing public opinion types based on vector similarity;
[0099] Keyword acquisition unit 340 is used to acquire keywords corresponding to each type of public opinion based on the classification results;
[0100] The analysis unit 350 is used to analyze the keywords according to preset rules and obtain analysis results.
[0101] In some embodiments, the classification unit 330 includes: a training unit for the public opinion classification model, comprising:
[0102] A topic clustering unit is used to input the word segmentation vector into the LDA topic model to obtain an LDA topic vector, wherein the LDA topic vector includes multi-dimensional topic clusters and the word segmentation distribution probability of each topic cluster.
[0103] The first annotation unit is used to obtain a manually annotated first vector; the manual annotation is a label representing the type of public opinion; the first vector is a first preset number of vectors obtained from each dimension of topic cluster;
[0104] The second annotation unit is used to obtain a second preset number of second vectors whose similarity to each first vector is greater than a first preset threshold, and to annotate the second vectors with the same label as the corresponding first vectors;
[0105] The third annotation unit is used to obtain a third preset number of third vectors whose similarity to each second vector is greater than a second preset threshold, and to annotate the third vectors with the same label as the corresponding second vectors; wherein, the second preset threshold is greater than the first preset threshold;
[0106] The training subunit is used to train the public opinion classification model to be trained using the labeled first vector, labeled second vector, and labeled third vector.
[0107] In some embodiments, the word segmentation unit 320 includes:
[0108] The first sub-segmentation unit is used to segment the public opinion data to be analyzed according to the stop word library to obtain the first segmentation result;
[0109] The stop word update unit is used to count the word frequency of each word in the word segmentation result and add words whose word frequency is higher than the first threshold and lower than the second threshold to the stop word library.
[0110] The second sub-segmentation unit is used to perform word segmentation on the public opinion data to be analyzed again based on the latest stop word library to obtain the second word segmentation result;
[0111] The vectorization unit is used to convert the second word segmentation result into word segmentation vectors.
[0112] In some embodiments, the analysis unit 350 is specifically used for:
[0113] The keywords were analyzed based on the sales figures corresponding to the time series, and the analysis results were obtained.
[0114] In some embodiments, the keyword acquisition unit 340 is specifically used for:
[0115] Based on the public opinion type of the word segmentation vector and the keyword information contained in the word segmentation vector, obtain the keywords for each public opinion type group; obtain the preset number of keywords with the highest word frequency in each public opinion type group.
[0116] In some embodiments, the public opinion type includes positive public opinion and negative public opinion.
[0117] This invention provides a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the public opinion analysis method described in this invention.
[0118] In practical applications, the computer-readable storage medium can be any combination of one or more computer-readable media. A computer-readable medium can be a computer-readable signal medium or a computer-readable storage medium. For example, a computer-readable storage medium can be, but is not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of computer-readable storage media (a non-exhaustive list) include: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this embodiment, the computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.
[0119] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, capable of sending, propagating, or transmitting programs for use by or in connection with an instruction execution system, apparatus, or device.
[0120] Program code contained on a computer-readable medium may be transmitted using any suitable medium, including but not limited to wireless, wire, optical fiber, RF, etc., or any suitable combination thereof.
[0121] Computer program code for performing the operations of this invention can be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, and C++, as well as conventional procedural programming languages such as "C" or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0122] like Figure 4 The diagram shows a structural schematic of a computer device provided in an embodiment of the present invention. Figure 4 The computer device 12 shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments of the present invention.
[0123] like Figure 4 As shown, the computer device 12 is represented in the form of a general-purpose computing device. The components of the computer device 12 may include, but are not limited to: one or more processors or processing units 16, system memory 28, and a bus 18 connecting different system components (including system memory 28 and processing unit 16).
[0124] Bus 18 represents one or more of several bus architectures, including a memory bus or memory controller, a peripheral bus, a graphics acceleration port, a processor, or a local bus using any of the various bus architectures. For example, these architectures include, but are not limited to, the Industry Standard Architecture (ISA) bus, the Micro Channel Architecture (MAC) bus, the Enhanced ISA bus, the Video Electronics Standards Association (VESA) local bus, and the Peripheral Component Interconnect (PCI) bus.
[0125] Computer device 12 typically includes a variety of computer system readable media. These media can be any available media that can be accessed by computer device 12, including volatile and non-volatile media, removable and non-removable media.
[0126] System memory 28 may include computer system readable media in the form of volatile memory, such as random access memory (RAM) 30 and / or cache memory 32. Computer device 12 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, storage system 34 may be used to read and write non-removable, non-volatile magnetic media (…). Figure 4 Not shown; usually referred to as a "hard drive"). Although Figure 4 Not shown, a disk drive for reading and writing to a removable non-volatile disk (e.g., a "floppy disk") and an optical disk drive for reading and writing to a removable non-volatile optical disk (e.g., a CD-ROM, DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to bus 18 via one or more data media interfaces. Memory 28 may include at least one program product having a set (e.g., at least one) of program modules configured to perform the functions of the embodiments of the present invention.
[0127] A program / utility 40 having a set (at least one) of program modules 42 may be stored, for example, in memory 28. Such program modules 42 include, but are not limited to, an operating system, one or more application programs, other program modules, and program data. Each or some combination of these examples may include an implementation of a network environment. Program modules 42 typically perform the functions and / or methods described in the embodiments of the present invention.
[0128] Computer device 12 can also communicate with one or more external devices 14 (e.g., keyboard, pointing device, display 24, etc.), and with one or more devices that enable a user to interact with the computer device 12, and / or with any device that enables the computer device 12 to communicate with one or more other computing devices (e.g., network card, modem, etc.). This communication can be performed through input / output (I / O) interface 22. Furthermore, computer device 12 can also communicate with one or more networks (e.g., local area network (LAN), wide area network (WAN), and / or public networks, such as the Internet) through network adapter 20. Figure 4 As shown, network adapter 20 communicates with other modules of computer device 12 via bus 18. It should be understood that, although... Figure 4 As not shown, it can be used in conjunction with computer device 12 with other hardware and / or software modules, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0129] The processor unit 16 executes various functional applications and data processing by running programs stored in the system memory 28, such as implementing the public opinion analysis method provided in the embodiments of the present invention.
[0130] It should be noted that the term "comprising" and its variations as used herein are open-ended, meaning "including but not limited to". The term "based on" means "at least partially based on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". Definitions of other terms will be given in the following description.
[0131] It should be noted that the concepts of "first" and "second" mentioned in this invention are only used to distinguish different devices, modules or units, and are not used to limit the order of functions performed by these devices, modules or units or their interdependencies.
[0132] It should be noted that although the subject matter has been described using language specific to structural features and / or methodological logic, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. Rather, the specific features and actions described above are merely illustrative examples of implementing the claims.
[0133] While several specific implementation details are included in the foregoing discussion, these should not be construed as limiting the scope of the invention. Certain features described in the context of individual embodiments may also be implemented in combination in a single embodiment. Conversely, various features described in the context of a single embodiment may also be implemented individually or in any suitable sub-combination in multiple embodiments.
[0134] The above description is merely a preferred embodiment of the present invention and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of disclosure in this invention is not limited to technical solutions formed by specific combinations of the above-described technical features, but should also cover other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the above-disclosed concept. For example, technical solutions formed by substituting the above features with (but not limited to) technical features with similar functions disclosed in this invention.
Claims
1. A public opinion analysis method, characterized in that, The method comprises the following steps: obtaining public opinion data to be analyzed; preprocessing the public opinion data to be analyzed to obtain a word segmentation vector; classifying the word segmentation vector using a public opinion classification model to output a classification result, wherein the classification result comprises the type of public opinion of each word segmentation vector; the public opinion classification model is obtained by training a public opinion classification model to be trained using a part of the word segmentation vectors with labels; the labels of the part of the word segmentation vectors are obtained by labeling the part of the word segmentation vectors based on vector similarity; obtaining keywords corresponding to each type of public opinion according to the classification result; analyzing the keywords according to a preset rule to obtain an analysis result; the training method of the public opinion classification model comprises the following steps: inputting the word segmentation vector into an LDA topic model to obtain an LDA topic vector, wherein the LDA topic vector comprises a topic cluster classification to which each word segmentation vector belongs and a distribution probability vector of each dimension topic cluster; obtaining a first vector labeled by a human being; the label is a label representing the type of public opinion; the first vector is a first preset number of vectors obtained from each dimension topic cluster; obtaining a second vector with a similarity greater than a first preset threshold to each first vector according to the distribution probability vector of each dimension topic cluster of each word segmentation vector, and labeling the second vector with the same label as the corresponding first vector; obtaining a third vector with a similarity greater than a second preset threshold to each second vector according to the distribution probability vector of each dimension topic cluster of each word segmentation vector, and labeling the third vector with the same label as the corresponding second vector; wherein the second preset threshold is greater than the first preset threshold; training the public opinion classification model to be trained using the first vector, the second vector and the third vector.
2. The method of claim 1, wherein, The preprocessing of the public opinion data to be analyzed to obtain a word segmentation vector comprises the following steps: performing word segmentation processing on the public opinion data to be analyzed according to a stop word library to obtain a first word segmentation result; counting the word frequency of each word in the word segmentation result, and adding words with a word frequency higher than a first threshold or lower than a second threshold to the stop word library; performing word segmentation processing on the public opinion data to be analyzed again according to the latest stop word library to obtain a second word segmentation result; converting the second word segmentation result into a word segmentation vector.
3. The method of claim 1, wherein, The analysis of the keywords according to a preset rule to obtain an analysis result comprises the following steps: analyzing the keywords based on the time series corresponding to the sales to obtain an analysis result.
4. The method of claim 1, wherein, The obtaining of keywords corresponding to each type of public opinion according to the classification result comprises the following steps: obtaining keywords grouped according to the type of public opinion and the keyword information contained in the word segmentation vector; obtaining a preset number of keywords with the highest word frequency in each group of keywords of each type of public opinion.
5. The method according to any one of claims 1 to 4, characterized in that, The type of public opinion comprises positive public opinion and negative public opinion.
6. An opinion analysis system characterized by comprising: The method comprises the following steps: an opinion obtaining unit configured to obtain public opinion data to be analyzed; a word segmentation unit configured to preprocess the public opinion data to be analyzed to obtain a word segmentation vector; The classification unit is configured to classify the segmented word vectors using an opinion classification model, and output a classification result, wherein the classification result comprises an opinion type of each segmented word vector; the opinion classification model is obtained by training a to-be-trained opinion classification model using a part of the segmented word vectors that are labeled; and the part of the segmented word vectors that are labeled are obtained by labeling a label representing an opinion type based on a vector similarity. The keyword obtaining unit is configured to obtain a keyword corresponding to each opinion type according to the classification result. The analysis unit is configured to analyze the keyword according to a preset rule, and obtain an analysis result. The classification unit comprises an opinion classification model training unit. The opinion classification model training unit comprises: The theme clustering unit is configured to input the segmented word vectors into an LDA theme model, and obtain an LDA theme vector, wherein the LDA theme vector comprises a theme cluster classification to which the segmented word vectors belong and a distribution probability vector of each dimension theme cluster. The first labeling unit is configured to obtain a first vector that is labeled by a human being; the human labeling is a label representing an opinion type; and the first vector is a first preset number of vectors obtained from each dimension theme cluster. The second labeling unit is configured to obtain a second preset number of second vectors that have a similarity greater than a first preset threshold with each first vector according to the distribution probability vector of each dimension theme cluster of each segmented word vector, and label the second vectors with the same label as the corresponding first vectors. The third labeling unit is configured to obtain a third preset number of third vectors that have a similarity greater than a second preset threshold with each second vector according to the distribution probability vector of each dimension theme cluster of each segmented word vector, and label the third vectors with the same label as the corresponding second vectors; and the second preset threshold is greater than the first preset threshold. The training subunit is configured to train the to-be-trained opinion classification model using the first vector that is labeled, the second vector that is labeled, and the third vector that is labeled.
7. A computer device, comprising: The computer readable storage medium stores instructions, and when the instructions run on the terminal device, the terminal device executes the opinion analysis method according to any one of claims 1-5. The computer readable storage medium stores instructions, and when the instructions run on the terminal device, the terminal device executes the opinion analysis method according to any one of claims 1-5.
8. A computer-readable storage medium, characterized in that,
Citation Information
Patent Citations
Topic-based public opinion emotion evolution method
CN111143549A
Classification model generation method and device, storage medium and electronic equipment
CN113378895A