Topic modeling and sentiment analysis method and system based on deep learning

Topic modeling and sentiment analysis methods combined with deep learning and vector optimization solve the problems of dimensionality reduction and noise data processing, and improve the accuracy of AI applications in the medical field and the accuracy of sentiment analysis.

CN118394944BActive Publication Date: 2024-09-10DAYA QIANYUAN (HANGZHOU) TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410850369.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-06-28
Publication Date
2024-09-10
Estimated Expiration
2044-06-28

AI Technical Summary

Technical Problem

Existing technologies have problems such as loss of key features during dimensionality reduction, misjudgment of noisy data, maximum coding limitations, and difficulty in extracting complex emotional tendencies in topic modeling and sentiment analysis, which especially affect the accuracy and promotion of AI in applications in the medical field. .

Method used

The topic modeling method based on deep learning is used, combined with vector optimization and topic consistency screening, to perform dynamic dimensionality reduction and noise data optimization, and improve the accuracy of sentiment analysis through paragraph segmentation and timing analysis.

Benefits of technology

It effectively improves the quality of topic modeling and the accuracy of sentiment analysis, ensures the correct processing of noise data and comprehensive prediction of the sentiment tendency of long texts, and is suitable for complex data analysis in the medical field.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118394944B
    Figure CN118394944B
Patent Text Reader

Abstract

The present invention relates to the technical field of natural language processing, and proposes a topic modeling and sentiment analysis method and system based on deep learning, comprising the following steps: obtaining an unlabeled text data set to be analyzed and performing preprocessing; embedding text based on the feature fusion method of deep learning for the preprocessed data, dynamically determining the dimension reduction dimension to reduce the dimension of the embedded text, clustering the reduced-dimensional data to obtain topics; screening out noise data distributed adjacent to the topic, calculating the consistency of the topic data and the adjacent noise, and re-dividing the noise data for each topic to optimize the topic; analyzing the overall sentiment tendency of the topic after dividing the data to be analyzed, and obtaining the sentiment analysis result. The present invention realizes deep and multi-dimensional analysis of modeling topics and sentiment analysis, solves the problems of dimensionality reduction and long text, improves the fine-grainedness of sentiment classification, and can improve the accuracy of sentiment classification of text data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field related to natural language processing, and specifically, to a topic modeling and sentiment analysis method and system based on deep learning. Background Art

[0002] The statements in this section merely provide background information related to the present invention and do not necessarily constitute prior art.

[0003] With the development of big data, it is of great significance to collect data and model relevant opinions based on the open environment of the Internet. For example, the medical field has a high degree of specialization and sensitive ethical issues. Doctors and patients may have different opinions and recognition on the application of AI in the medical field. How to accurately obtain the true attitudes of doctors and patients is crucial, which will directly affect the application and promotion of AI in the medical field.

[0004] Methods for obtaining relevant opinions based on big data analysis include topic modeling and sentiment analysis. Topic modeling is an unsupervised tool. Traditional models such as linear discriminant algorithm (LDA) and non-negative matrix factorization (NMF) describe documents as bag-of-words words and model each document into a potential topic. Structural topic modeling (STM) combines topic modeling with implicit structures in text to discover topic structures by extracting structured information from text data. Sentiment analysis is a challenging research topic in natural language processing (NLP); the data types of sentiment analysis tasks are divided into two categories: document-level sentiment analysis, which involves the sentiment of a specific document, usually expressing approval or disapproval; sentence-level sentiment analysis focuses on predicting and classifying the sentiment polarity of sentences, usually into positive, neutral, and negative emotions.

[0005] However, there are the following deficiencies in the prior art:

[0006] The primary task of the topic modeling model is to embed the text into vector features. Commonly used text embedding methods, such as sentence embedding using models such as BERT, only focus on the semantic representation of the entire text, which can easily lose the detailed features of the text. In terms of vector dimensionality reduction of high-dimensional features, the traditional static dimensionality reduction method uses pre-set hyperparameters to select the dimensionality reduction dimension. The lack of clear guiding principles for parameter selection makes it difficult to obtain the optimal dimensionality reduction dimension, resulting in the loss of key features during dimensionality reduction. In response to the shortcomings of static dimensionality reduction, some dimensionality reduction methods use dynamic dimensionality reduction methods based on K-means, but the randomized centroid and outlier processing methods of K-means will affect the clustering generation effect. Although the BERT-based neural topic modeling model BERTopic performs better than LDA in topic modeling, BERTopic is prone to misjudging noise data when clustering topics.

[0007] In terms of sentiment analysis, most sentiment analysis models such as BERT use truncation to select the maximum text content that can be processed due to the maximum encoding limitation. The discarded text may contain important features, which makes it impossible to comprehensively predict the sentiment tendency of long texts. In addition, due to the complexity of long text content, most sentiment prediction models cannot extract different degrees of sentiment tendencies in the text. On the other hand, in the grading research of smart medical evaluation data, most similar studies are just simple positive and negative sentiment grading. Summary of the invention

[0008] In order to solve the above problems, the present invention proposes a topic modeling and sentiment analysis method and system based on deep learning. The topic modeling stage integrates deep learning, vector optimization, and topic consistency screening. The sentiment analysis stage performs paragraph segmentation, variable labeling and time series analysis. The modeling topics and sentiment analysis are analyzed in depth and in multiple dimensions, which can improve the accuracy of sentiment classification of text data.

[0009] In order to achieve the above object, the present invention adopts the following technical solution:

[0010] The first aspect of the present invention provides a topic modeling and sentiment analysis method based on deep learning, comprising the following steps:

[0011] Obtain the unlabeled text dataset to be analyzed and perform preprocessing;

[0012] For the preprocessed data, text embedding is performed based on the feature fusion method of deep learning, and the dimension reduction dimension is dynamically determined to reduce the dimension of the embedded text. The data after dimension reduction is clustered to obtain the theme;

[0013] Filter out the noise data that is distributed adjacent to the topic, calculate the consistency between the topic data and the adjacent noise, and re-divide the noise data for each topic to perform topic optimization;

[0014] After dividing the data to be analyzed into topics, the variables are defined in turn, paragraph segmentation is performed based on knowledge graph embedding, variables are labeled, and time series analysis is designed to extract the temporal changes of the topics and the continuity of the development characteristics of the topics, and the overall emotional tendency of the topics is analyzed to obtain the sentiment analysis results.

[0015] The second aspect of the present invention provides a topic modeling and sentiment analysis system based on deep learning, comprising:

[0016] A data preprocessing module is configured to obtain an unlabeled text data set to be analyzed and perform preprocessing;

[0017] The neural topic modeling module is configured to perform text embedding based on the feature fusion method of deep learning for the preprocessed data, dynamically determine the dimension reduction dimension to reduce the dimension of the embedded text, and cluster the reduced-dimensional data to obtain topics;

[0018] The neural topic modeling module is also configured to filter out noise data distributed adjacent to the topic, calculate the consistency of the topic data and the adjacent noise, and re-divide the noise data for each topic to perform topic optimization;

[0019] The topic sentiment analysis module is also configured to define variables, segment paragraphs based on knowledge graph embedding, label variables, and design time series analysis to extract the temporal changes of topics and the continuity of topic development characteristics after dividing the data to be analyzed, analyze the overall sentiment tendency of the topic, and obtain the sentiment analysis results.

[0020] The third aspect of the present invention provides an electronic device, comprising a memory and a processor, and computer instructions stored in the memory and running on the processor. When the computer instructions are executed by the processor, the steps of the deep learning-based topic modeling and sentiment analysis method in the above-mentioned first aspect are completed.

[0021] A fourth aspect of the present invention provides a computer-readable storage medium for storing computer instructions. When the computer instructions are executed by a processor, the steps in the deep learning-based topic modeling and sentiment analysis method of the first aspect are completed.

[0022] Compared with the prior art, the present invention has the following beneficial effects:

[0023] The feature fusion method based on deep learning and the vector dimension optimizer of the present invention effectively ensure the quality of the extracted topics, and the topic consistency screening can effectively re-divide the noise data. The paragraph segmentation in sentiment analysis can effectively divide long texts into short texts according to the content, and the pre-trained fine-tuning model based on BERT can effectively annotate custom variables, shorten the training time and improve the accuracy of sentiment prediction.

[0024] The advantages of the present invention and additional advantages will be described in detail in the following specific embodiments. BRIEF DESCRIPTION OF THE DRAWINGS

[0025] The accompanying drawings constituting a part of the present invention are used to provide a further understanding of the present invention. The exemplary embodiments of the present invention and their description are used to explain the present invention but do not constitute a limitation of the present invention.

[0026] Figure 1 is a flowchart of a topic modeling and sentiment analysis method based on deep learning according to Embodiment 1 of the present invention;

[0027] Figure 2 is a data processing flow chart of the neural topic modeling module of embodiment 2 of the present invention;

[0028] Figure 3It is a data processing flow chart of the subject sentiment analysis module of Example 2 of the present invention. DETAILED DESCRIPTION

[0029] The present invention will be further described below in conjunction with the accompanying drawings and embodiments.

[0030] It should be noted that the following detailed descriptions are exemplary and are intended to provide further explanation of the present invention. Unless otherwise specified, all technical and scientific terms used herein have the same meanings as those commonly understood by those skilled in the art to which the present invention belongs.

[0031] It should be noted that the terms used herein are only for describing specific embodiments and are not intended to limit exemplary embodiments according to the present invention. As used herein, unless the context clearly indicates otherwise, the singular form is also intended to include the plural form. In addition, it should be understood that when the terms "comprising" and / or "including" are used in this specification, it indicates the presence of features, steps, operations, devices, components and / or combinations thereof. It should be noted that, in the absence of conflict, the various embodiments of the present invention and the features in the embodiments can be combined with each other. The embodiments will be described in detail below in conjunction with the accompanying drawings.

[0032] Technical term explanation:

[0033] BERT (Bidirectional Encoder Representations from Transformers) is a pre-trained language representation model developed by the Google AI Language team.

[0034] K-means is a K clustering algorithm that aims to divide a data set into K clusters, where each cluster consists of similar data points. The algorithm uses an iterative optimization method to minimize the distance between each data point in each cluster and its centroid.

[0035] Word2Vec is a technology proposed by Google to convert text into numerical vectors for natural language processing (NLP) tasks. Its main purpose is to embed words into a low-dimensional vector space so that semantically similar words are closer in the space.

[0036] Example 1

[0037] In the technical solutions disclosed in one or more embodiments, Figures 1 to 3 As shown, a topic modeling and sentiment analysis method based on deep learning includes:

[0038] Step 1: Obtain the unlabeled text dataset to be analyzed and perform preprocessing;

[0039] Step 2, topic modeling: Text embedding is performed on the preprocessed data based on the feature fusion method of deep learning, the dimension reduction dimension is dynamically determined to reduce the dimension of the embedded text, and the data after dimension reduction is clustered to obtain the topic;

[0040] Step 3: Filter out the noise data that is distributed adjacent to the topic, calculate the consistency between the topic data and the adjacent noise, and re-divide the noise data for each topic to perform topic optimization;

[0041] Step 4: After dividing the data to be analyzed into topics, define variables, segment paragraphs based on knowledge graph embedding, annotate variables, and design time series analysis to extract the temporal changes of topics and the continuity of topic development characteristics, analyze the overall emotional tendency of the topic, and obtain the emotional analysis results;

[0042] In this embodiment, neural topic modeling uses a feature fusion method based on deep learning and dynamic dimensionality reduction optimization to effectively ensure the quality of the extracted topics, and topic consistency screening can effectively re-divide noise data. Paragraph segmentation in sentiment analysis can effectively divide long texts into short texts according to the content, realize the annotation of custom variables, combine themes and sentiments for analysis, and conduct in-depth multi-dimensional analysis, which can greatly improve the accuracy of sentiment prediction.

[0043] In step 1, the corresponding data set is obtained according to the purpose of sentiment analysis. Articles and comments from multiple online forums can be crawled and summarized into a text data set to be evaluated;

[0044] Optionally, preprocessing includes cleaning noise data, word segmentation, and time series segmentation;

[0045] Among them, time series partitioning is to divide the data set according to the time stage. For example, for medical data, time series partitioning is to divide the data into multiple data sets according to the time stage of AI development in the medical field;

[0046] Specifically, for smart medical evaluation data Can be divided into three data sets ,in ; For the first n Item text data;

[0047] Taking smart medical evaluation as an example, a Python-based data crawler program can be used to collect articles and comments on the application of AI in the medical field from multiple medical website forums, and the data can be compiled into smart medical evaluation data. .

[0048] Collected smart medical evaluation data The text can include the title, author, content, keywords, posting time, collection time, etc., and the data related to AI in medical applications can be cleaned by filtering keywords. Due to the complexity of Chinese, data with the same keywords have different expressions, and data with the same keywords but irrelevant content need to be removed. At the same time, duplicate data are deleted according to the alphabetical order to obtain smart medical evaluation data. The data is divided into two time points: the rise of the Internet in 2018 and the rise of models such as ChatGPT in 2022. Divided into three time series data sets ;

[0049] In step 2, the neural topic modeling stage, the data is themed using neural topic modeling based on BERTopic, which includes the following steps:

[0050] Step 21, in the text embedding stage, the preprocessed text data is sentence-embedded and word-embedded, and the embedded vectors are concatenated to obtain a high-dimensional vector representation of the text data;

[0051] Step 22: Dynamically determine the dimension reduction dimension and reduce the dimension of the embedded text;

[0052] Step 23: Use the hierarchical density clustering algorithm (HDBSCAN) to cluster the reduced-dimensional data to obtain themes =[ ];

[0053] Step 21 is the text embedding stage, and the following is the specific implementation process.

[0054] Optionally, you can use pre-trained Sentence Transformers (a Python library for sentence embedding) to embed sentences and obtain the overall feature vector of the text; use Word2Vec word vector embedding to obtain the detailed feature vector of the text, and fuse the two feature vectors to obtain a high-dimensional vector representation;

[0055] Specifically, for the acquired smart medical evaluation data , perform the embedding operation of fusion text and word, the process is as follows:

[0056] Step S211: The dataset uses Sentence Transformers to embed sentences to obtain high-dimensional sentence features. ;

[0057] Step S212: The dataset is embedded with Word2Vec to obtain high-dimensional word features. ;

[0058] Step S213: Fusion features and Features Get high-dimensional feature vector ;

[0059] In the solution of step 21 above, in order to solve the problem that features are easily lost when documents are embedded, this embodiment uses a combination of sentence embedding and word embedding to enrich feature extraction.

[0060] The purpose of the text embedding task is to convert text data into vector form; the goal of text embedding is to encode the semantic information in natural language into points in a continuous vector space, so that similar texts are close to each other in the vector space.

[0061] The text embedding task uses a fusion of sentence embedding Sentence Transformers and word embedding Word2Vec. The sentence embedding uses the pre-trained model paraphrase-multilingual-MiniLM-L12-v2 in the Sentence Transformers library. This model is based on the BERT architecture and uses the encoder layer to embed text. Encoding; The Encoder layer consists of multiple multi-head self-attention mechanisms and feedforward neural networks;

[0062] Multi-head self-attention mechanism , which is used to capture the relationship between different positions in the input sequence, so that the model can assign different attention weights to different parts of the input sequence. The process is as follows:

[0063] Text Mapping to vector , the vector Respectively with the three coefficient matrices , , Calculate and get Represent query, key, and value vectors respectively;

[0064] To calculate the attention, the formula is defined as follows:

[0065] (1)

[0066] in, is the feature dimension.

[0067] Feedforward neural networks are used to perform nonlinear transformations on features after each attention layer, which helps the model better capture complex nonlinear relationships and patterns. Encoding data into high-dimensional features , the formula is defined as follows:

[0068] (2)

[0069] in, Represent the weights and biases of the two fully connected layers respectively. After multiple Encoder layers, the data Encoding into high-dimensional features .

[0070] Word embedding uses the Word2Vec word embedding model, which maps the space where the text is located to a new space through embedding, so that semantically similar words are close to each other in the space. Specifically, the continuous bag of words model (CBOW) prediction model is used, which includes three layers: input layer, hidden layer and output layer; Input through the input layer, through the hidden layer matrix Calculate and output features , and then perform weighted averaging to obtain the fusion feature , the formula is defined as follows:

[0071] (3)

[0072] in, They represent different feature proportions respectively;

[0073] In step 22, the dimension reduction dimension is dynamically determined to reduce the dimension of the embedded text, including the following steps:

[0074] Step 221: embed the high-dimensional vector of the text Mapping to low-dimensional vectors of different dimensions ;

[0075] Step 222: Density-based clustering algorithm (DBSCAN) calculates different low-dimensional vectors and the original data x Theme tags The distribution distance of ;

[0076] Step 223: According to the optimal dimension, the uniform manifold approximation and projection algorithm is used to reduce the dimension of the embedded text to obtain a low-dimensional feature. ;

[0077] Specifically, the dynamic determination of the dimension reduction dimension is achieved through a constructed vector dimension optimizer, which includes a density clustering generator and an optimal dimension calculator;

[0078] Density clustering generator, used to map high-dimensional vectors to lower-dimensional vectors of different dimensions;

[0079] The best dimension calculator is used to calculate the distribution distance between different low-dimensional vectors and original data using the density-based clustering algorithm (DBSCAN) and determine the best dimension, and to reduce the dimension of embedded text using the uniform manifold approximation and projection algorithm (UMAP);

[0080] In some embodiments, the density clustering generator first transforms the data set Divide into training set and test set , Manually assigning topic labels .Will and Get high-dimensional vector features through text embedding Then set different dimensionality reduction values ​​for UMAP ,right and Dimensionality reduction Then use DBSCAN to Perform clustering.

[0081] Specifically, in the dimension reduction training set In the Settings is the neighborhood distance threshold, is the minimum number of samples in the domain, The number of features within the threshold distance defines the core points for:

[0082] (4)

[0083] make is the distance metric function, for For two random uncalculated data in the training set, the density reachability is expressed as:

[0084] (5)

[0085] The clustering process is as follows: Randomly select a point And determine whether it is a core point. If it is a core point, select the range data according to the density accessibility to form a cluster. If it is a boundary point, traverse the remaining points. The boundary point is a point that does not belong to the core point but is in the neighborhood of a core point. Continue to traverse other points until all points are traversed to form a density cluster and build a density cluster generator. , where noise points are uniformly marked as -1.

[0086] In the Optimal Dimensions Calculator, Data in Predicting topic labels via density clustering generator , the formula is:

[0087] (6)

[0088] calculate and the original label The clustering accuracy , the formula is:

[0089] (7)

[0090] in, yes The set of all permutations of , Indicates the number of clusters. Then traverse the range of other dimensions and select the best dimension. The formula is:

[0091] (8)

[0092] UMAP consists of two main steps: the first step is to learn the manifold structure in the high-dimensional space, and the second step is to find the low-dimensional representation of the manifold. , construct the neighborhood of each text feature vector through the KNN model, and then determine the local connectivity constraints and the normalization factor , It ensures that each eigenvalue At least one edge with a weight of 1 is connected, thus effectively expressing high-dimensional features and alleviating the dimensionality dilemma. For the eigenvalue To calculate the decentralized Riemann metric, the formula is defined as follows:

[0093] (9)

[0094] (10)

[0095] in, is the neighborhood feature of the text feature vector, j=1,2…n, given the hyperparameter It is measuring Calculate the k nearest neighbors for each data point.

[0096] Then calculate the distribution, the formula is defined as follows:

[0097] (11)

[0098] In finding a low-dimensional representation, the conversion from variable distance to standard distance affects the distance to the nearest neighbor. First, the minimum distance between embedded points is defined, and then the low-dimensional representation is obtained by minimizing the cross entropy. .

[0099] In this embodiment, a hierarchical density clustering algorithm (HDBSCAN) is used to identify and group categories and clusters in the data;

[0100] The low-dimensional features The distance to the kth nearest neighbor sample point is called the core distance, and the formula is defined as follows:

[0101] (12)

[0102] The distance between two sample points is represented by the mutually reachable distance. The sample distance in the dense area is not affected, while the distance between the sample point and other sample points in the sparse area is magnified. The formula of the mutually reachable distance is defined as follows:

[0103] (13)

[0104] in, Represents two nodes The original distance. The minimum spanning tree is constructed by Prim's algorithm and converted into a hierarchical structure. The edges of the spanning tree are sorted according to the distance, and then a new merged cluster is created for each edge by traversal. Finally, the topic clustering cluster is extracted. , and cluster them according to themes Divide into corresponding topics ].

[0105] Traditional dimensionality reduction tasks are static and difficult to express the contextual information of documents in different fields, resulting in the loss of some key information. Some dynamic dimensionality reduction methods based on K-means will affect the clustering effect due to the randomization of centroids and outliers.

[0106] In step 22 above, in order to solve the problem that static dimensionality reduction is prone to losing key information and K-means random initial centroid affects clustering results, a vector dimension optimizer is added in the dimensionality reduction stage to obtain dynamic optimization vectors and determine the optimal dimension based on the data to be analyzed, which can maximize the retention of useful information. Then, the hierarchical density clustering algorithm (HDBSCAN) is used to cluster the reduced dimensionality data to obtain the theme =[ ]. UMAP manifold dimensionality reduction is used to extract more local semantic features; the cluster data corresponding to each topic is the topic data.

[0107] In step 3, a topic consistency check is performed. By calculating the consistency between the topic data and the adjacent noise, the noise data is re-embedded and classified into the most relevant topic, and the topic is optimized and updated.

[0108] Specifically, we filter out the noise data adjacent to the topic, use the ELMO (Embedding from LanguageModel) model to re-embed the noise data, calculate the consistency of the clustered data and the adjacent noise, and perform topic optimization and update;

[0109] Check the subject through consistency The specific steps are as follows:

[0110] Step 31: According to each theme Low-dimensional feature distribution in , calculate each topic The gathering point , the formula is:

[0111] (14)

[0112] Step 32: According to the data subject Internal data is distributed to thematic cohesion points Maximum distance , select the maximum distance All noise data within the range , the ELMO model is used to encode the noise data and re-encode the partition, the formula is expressed as:

[0113] (15)

[0114] Then, the noisy data is re-partitioned by cosine similarity, and the formula is expressed as:

[0115] (16)

[0116] in, Represents the threshold of the new division. When the calculated value is less than the threshold, the noise Re-partition into topic labels and update the dataset.

[0117] Among them, ELMO (Embeddings from Language Models) is a deep learning pre-training model proposed by the Allen Institute for AI for generating word embeddings.

[0118] Step 33: Extract keywords from the optimized topics, use class-based term frequency-inverse document frequency (c-TF-IDF) to mine the clustered topics, and extract the topics. High frequency keywords in ;

[0119] First, the topic [ ] in the cluster Processing is performed so that the features under the same cluster And word segmentation dataset Data in Corresponding, and using c-TF-IDF to cluster data Mining keywords First, calculate the word frequency ratio , the formula is defined as follows:

[0120] (17)

[0121] in, Indicates the number of times a word appears in a document. Represents the total number of occurrences of all words in the document.

[0122] Then calculate the inverse document frequency , the formula is:

[0123] (18)

[0124] The overall c-TF-IDF formula is expressed as:

[0125] (19)

[0126] Among them, the term exist The frequencies in are expressed as term frequencies, Represents the class. The reverse class frequency is calculated by The average number of words and The frequency among all classes, a measure of the useful information a term provides for a class.

[0127] Step 34: Analyze the data content of the mined topics and divide the topics into technical topics =[ ] and social themes =[ ].

[0128] Theme =[ ] Conduct thematic analysis and classify themes according to the data content and form. =[ ]Divided into technical topics =[ ] and social themes =[ ].

[0129] In the solution of step 3 above, for the BERTopic neural topic model, the hierarchical density clustering method is used to easily misjudge the data as noise. A consistency screening is added to check the noise data and re-embed the noise.

[0130] In step 4, the topic sentiment analysis phase includes the following steps:

[0131] Step 41, define the data as independent variables and dependent variables according to statistical methods;

[0132] Step 42: Based on the SeqModel paragraph segmentation model, knowledge graph embedding is introduced to integrate external knowledge to improve text representation and perform paragraph segmentation on thematic data.

[0133] Step 43: For the data after paragraph segmentation, label a part of the variable data, use the pre-trained BERT model to predict the variables in the topic and label the unsupervised data;

[0134] Step 44: Annotate the new dataset , for each topic's independent variable and dependent variable, we conduct topic time series analysis and topic sentiment tendency analysis, and calculate the correlation between the independent variable and the dependent variable;

[0135] Through topic modeling and sentiment analysis results, we can visualize topic keywords, topic sentiment tendencies, temporal changes in topic sentiment, and the distribution correlation of different topics.

[0136] In step 41, the independent variables are technology maturity and social factors, and the dependent variables are technology recognition and social recognition; technology maturity and technology recognition can be analyzed according to degree;

[0137] Optionally, the technical content introduced in the text can be graded from 1 to 5; the dependent variable is technical recognition, which is graded from 1 to 5.

[0138] Specifically, on technical topics =[ ], define technology maturity , dependent variable technology recognition ;

[0139] On social topics =[ ], define social acceptance .

[0140] In variable definition, independent variables and dependent variables are defined according to the nature of the subject for fine-grained data mining.

[0141] For medical evaluation, in the technical topic, define the independent variable technology maturity level , specifically expressed as:

[0142] Level 1: Conceptual report on AI in the medical field, feasible target plan;

[0143] Level 2: The key functions of AI products in the medical field can be realized, resulting in papers, books, and intellectual property rights;

[0144] Level 3: The AI ​​medical product has completed the sample in the simulation environment, and all functions and performance meet the requirements;

[0145] Level 4: AI medical products are used in clinical trials and are recognized by doctors and patients. Level 5: AI medical products have market access conditions and clinical applications.

[0146] Dependent variable: technology acceptance It is divided into 5 levels, namely, very disagree, somewhat disagree, neutral, somewhat agree, and very agree.

[0147] In social topics, the independent variable of social topics is social topics =[ ], such as legal bills, introductions to AI medical applications, and products from technology companies. The dependent variable is the social acceptance rating The rating levels are divided into 5 levels, namely, very disagree, somewhat disagree, neutral, somewhat agree, and very agree.

[0148] Step 42: Based on the SeqModel paragraph segmentation model, knowledge graph embedding is introduced to integrate external knowledge to improve text representation and perform paragraph segmentation on thematic data.

[0149] Use SeqModel (Sequence Model) to analyze the topic Long text data Perform paragraph segmentation so that Split into multiple short texts according to content = [ ];

[0150] Document segmentation is defined as automatically predicting the paragraph boundaries of a document. In the paragraph segmentation task, an improved model based on SeqModel is adopted, which adds knowledge embedding on the basis of the BERT embedding method. Word embedding is enhanced by entities and relations in the knowledge graph, and external knowledge is integrated to improve text representation.

[0151] Specifically, paragraph segmentation includes the following steps:

[0152] Step 421: First, the input document is segmented into sentences, and the segmented character sequences are represented by the input to obtain word vectors. , position vector and segment vector ;

[0153] Step 422: For each sentence, obtain a knowledge vector by encoding the knowledge graph , and sum the elements to get the final character features ; The formula is:

[0154] (20)

[0155] in, Represent weights respectively.

[0156] Step 423: Get the character features Input to the BERT encoder for encoding to obtain character features;

[0157] Specifically, the encoder is composed of multiple layers of encoders, which are specifically expressed by formula (1) and formula (2).

[0158] Step 424: Map the character features output by the encoder to each sentence , the final sentence features are obtained by mean pooling the character features of each sentence.

[0159] Step 425: The encoded sentence features of each sentence are mapped through the output layer and the softmax layer to classify each sentence. Is it a paragraph boundary? By segmenting the paragraph, Split into multiple short texts according to content =[ ].

[0160] In order to solve the problem of sentiment complexity of long texts, the scheme of step 42 of this embodiment introduces a paragraph segmentation model integrating external knowledge to perform automatic paragraph segmentation to achieve the processing of long texts and simplify the sentiment analysis problem of long texts.

[0161] Step 43: For the data after paragraph segmentation, label a part of the variable data, use the pre-trained BERT model to predict the variables in the topic and label the unsupervised data;

[0162] Specifically, mark some paragraphs The independent variable and the dependent variable label ; Fine-tune the BERT model based on the labeled data; Use the trained BERT model to predict the variables in the topic and assign corresponding variable labels to the short texts according to the nature of the topic.

[0163] Specifically, the trained BERT model is used to predict the unlabeled data for the variables in the topic and assign the data technology maturity mark. , Technology Recognition Mark and social recognition marks , the formula is:

[0164] (twenty one)

[0165] in, , the specific structure is expressed by formula (1) and formula (2).

[0166] Finally, the topics obtained by topic modeling , variable labels and raw data Merge to get a new data set .

[0167] There are three time series datasets , and , the topic labels in each time series dataset Including evaluation data , independent variable label or , dependent variable label or .

[0168] Step 44: Annotate the new dataset , for each topic's independent variable and dependent variable, conduct topic time series analysis and topic sentiment tendency analysis respectively, calculate the correlation between the independent variable and the dependent variable, and obtain the sentiment analysis result;

[0169] Furthermore, the sentiment analysis results may be visualized, including visualization of topic keywords, topic sentiment tendencies, temporal changes in topic sentiment, and distribution correlations of different topics.

[0170] Specifically, timing analysis , and The relevance of the data. Based on the top ten high-frequency keywords under the topic Determine the topic title, calculate the overall sentiment tendency according to the percentage of the sentiment under the topic, and calculate the independent variable and the dependent variable The correlation between them.

[0171] Optionally, the method for visualizing the sentiment analysis results may include one or more of the following:

[0172] 1) Visualize the frequency of occurrence of high-frequency keywords;

[0173] Specifically, the task topic words are extracted through the topic words in step 33, and then a bar chart can be used to display the frequency of occurrence of high-frequency and high-frequency words under each topic;

[0174] 2) Count the sentiment categories under each topic, and dynamically display the sentiment distribution of the topic through a percentage pie chart;

[0175] Specifically, in visualizing the sentiment tendency of the topic, Python's matplotlib is used to configure pie charts and analyze the data under three scenarios. First, the percentage shows the overall theme [ ], and then the percentage shows the recognition of the overall data, and finally the sentiment distribution under each topic is visualized.

[0176] 3) Analyze the evolution of topics in different time periods and visualize the changes in attention and sentiment distribution of time-series topics;

[0177] Specifically, in the analysis of the temporal changes of the topic sentiment, we first analyze the topic keywords. Comprehensive analysis of three time series data sets , and Topics in Then select the data distribution of the same topic in the three data sets , and , then use Matplotlib to visualize the theme , and The data quantity and sentiment distribution in are used to analyze the changes in attention and sentiment of time series topics.

[0178] Among them, Matplotlib is one of the data visualization libraries in Python.

[0179] 4) Dynamically generate a two-dimensional spatial distance distribution based on topic clustering, and visualize similar topics and parent category topics in a dendrogram;

[0180] Specifically, in the analysis of the correlation of medical topic distribution, the topic clusters are obtained through the topic modeling task in step 2. , and Transformed into a two-dimensional distribution vector, and based on the coordinates of the cluster point and the theme [ ] determines the position and size of the topic in the distribution map. The distribution of topics can be observed through the position of the topic in the distribution map, and whether there is an intersection and inclusion relationship between the topics. Finally, the similarity of the distance between the subjects is calculated and the topic nodes with similar distances are used as leaf nodes of the tree diagram, and the parent nodes are continuously recursively visualized until the root node. Dendrogram visualization is conducive to analyzing similar topics and parent category topics.

[0181] The neural topic modeling mentioned above uses a deep learning-based feature fusion method and vector dimension optimizer to effectively ensure the quality of the extracted topics, and the topic consistency screening can effectively re-partition the noisy data. Paragraph segmentation in sentiment analysis can effectively divide long texts into short texts based on the content, and the BERT-based pre-trained fine-tuning model can effectively annotate custom variables, shorten the training time and improve the accuracy of sentiment prediction.

[0182] For medical evaluation data, through the above method of this embodiment, popular medical topic keywords, medical topic sentiment tendencies, temporal changes in topic sentiment, and distribution correlation of medical topics can be visualized in multiple dimensions. Ultimately, it is possible to analyze in a specific medical field whether the attitudes of doctors, patients, etc. towards the use of AI-assisted medical care are positive, neutral, or negative, thereby improving the application effect of AI systems in medical care and serving the medical and health field.

[0183] Example 2

[0184] Based on Example 1, this embodiment provides a topic modeling and sentiment analysis system based on deep learning, such as Figures 2 to 3 As shown, including:

[0185] A data preprocessing module is configured to obtain an unlabeled text data set to be analyzed and perform preprocessing;

[0186] The neural topic modeling module is configured to perform text embedding based on the feature fusion method of deep learning for the preprocessed data, dynamically determine the dimension reduction dimension to reduce the dimension of the embedded text, and cluster the reduced-dimensional data to obtain topics;

[0187] The neural topic modeling module is also configured to filter out noise data distributed adjacent to the topic, calculate the consistency of the topic data and the adjacent noise, and re-divide the noise data for each topic to perform topic optimization;

[0188] The topic sentiment analysis module is also configured to define variables, segment paragraphs based on knowledge graph embedding, label variables, and design time series analysis to extract the temporal changes of topics and the continuity of topic development characteristics after dividing the data to be analyzed, analyze the overall sentiment tendency of the topic, and obtain the sentiment analysis results.

[0189] It should be noted here that the various modules in this embodiment correspond one-to-one to the various steps in Example 1, and the specific implementation process is the same, which will not be repeated here.

[0190] Example 3

[0191] This embodiment provides an electronic device, including a memory and a processor, and computer instructions stored in the memory and running on the processor. When the computer instructions are executed by the processor, the steps of a topic modeling and sentiment analysis method based on deep learning in Example 1 are completed.

[0192] Example 4

[0193] This embodiment provides a computer-readable storage medium for storing computer instructions. When the computer instructions are executed by a processor, the steps in the topic modeling and sentiment analysis method based on deep learning in Embodiment 1 are completed.

[0194] The electronic device proposed in the present invention can be a mobile terminal or a non-mobile terminal. The non-mobile terminal includes a desktop computer, and the mobile terminal includes a smart phone (such as an Android phone, an IOS phone, etc.), smart glasses, a smart watch, a smart bracelet, a tablet computer, a laptop computer, a personal digital assistant, and other mobile Internet devices that can perform wireless communication.

[0195] It should be understood that in the present invention, the processor may be a central processing unit CPU, and the processor may also be other general-purpose processors, digital signal processors DSP, application-specific integrated circuits ASIC, off-the-shelf programmable gate arrays FPGA or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.

[0196] The memory may include a read-only memory and a random access memory, and provide instructions and data to the processor, and a portion of the memory may also include a non-volatile random access memory. For example, the memory may also store information about the device type.

[0197] In the implementation process, each step of the above method can be completed by an integrated logic circuit of hardware in a processor or an instruction in the form of software. The steps of the method disclosed in the present invention can be directly embodied as being executed by a hardware processor, or being executed by a combination of hardware and software modules in a processor. The software module can be located in a mature storage medium in the art such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable memory, a register, etc. The storage medium is located in a memory, and the processor reads the information in the memory and completes the steps of the above method in combination with its hardware. To avoid repetition, it is not described in detail here. A person of ordinary skill in the art can appreciate that the units and algorithm steps of each example described in combination with the embodiments disclosed herein can be implemented in electronic hardware or a combination of computer software and electronic hardware. Whether these functions are executed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the present invention.

[0198] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0199] In the several embodiments provided by the present invention, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a division of logical functions. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, and the indirect coupling or communication connection of devices or units can be electrical, mechanical or other forms.

[0200] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, server or network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc., which can store program codes.

[0201] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A topic modeling and sentiment analysis method based on deep learning, characterized by: The steps include: Obtain the unlabeled text dataset to be analyzed and perform preprocessing; For the preprocessed data, text embedding is performed based on the feature fusion method of deep learning, and the dimension reduction dimension is dynamically determined to reduce the dimension of the embedded text. The data after dimension reduction is clustered to obtain the theme; Filter out the noise data that is distributed adjacent to the topic, calculate the consistency between the topic data and the adjacent noise, and re-divide the noise data for each topic to perform topic optimization; After dividing the data to be analyzed into topics, we define variables, segment paragraphs based on knowledge graph embedding, label variables, and design time series analysis to extract the time changes of topics and the continuity of topic development characteristics, analyze the overall emotional tendency of the topic, and obtain the emotional analysis results. The specific steps include: Define the data as independent and dependent variables according to statistical methods; Introducing knowledge graph embedding into the SeqModel paragraph segmentation model, integrating external knowledge to improve text representation and perform paragraph segmentation on thematic data; For the data after paragraph segmentation, annotate some variable data, use the pre-trained BERT model to predict the variables in the topic and annotate the unsupervised data; For the annotated new data set, we conduct topic time series analysis and topic sentiment tendency analysis on the independent variables and dependent variables in each topic, calculate the correlation between the independent variables and the dependent variables, and obtain the sentiment analysis results.

2. The topic modeling and sentiment analysis method based on deep learning according to claim 1, characterized in that: The data is themed using BERTopic-based neural topic modeling, which includes the following steps: In the text embedding stage, the preprocessed text data is embedded in sentences and words, and the embedded vectors are concatenated to obtain a high-dimensional vector representation of the text data; Dynamically determine the dimension reduction and reduce the dimension of the embedded text; The hierarchical density clustering algorithm was used to cluster the data after dimensionality reduction to obtain themes.

3. The topic modeling and sentiment analysis method based on deep learning as claimed in claim 2, characterized in that: Dynamically determine the dimension reduction dimension and reduce the dimension of the embedded text, including the following steps; Map the high-dimensional vector of the embedded text into a low-dimensional vector of different dimensions; The density-based clustering algorithm calculates the distribution distance between different low-dimensional vectors and the original data topic labels to determine the optimal dimension; According to the optimal dimension, the uniform manifold approximation and projection algorithm is used to reduce the dimension of the embedded text to obtain low-dimensional features.

4. The topic modeling and sentiment analysis method based on deep learning as claimed in claim 1, characterized in that: Calculate the consistency of clustered data and adjacent noise, and optimize the data in the topic. The specific steps are as follows: Calculate the cluster points in each topic based on the low-dimensional feature distribution in each topic; According to the maximum distance from the data distribution in the data topic to the topic cohesion point, all the noise data within the maximum distance range are selected, and the noise data is encoded and re-encoded using the ELMO model to obtain the optimized topic; Extract keywords from the optimized topics, use the class-based word frequency-inverse document frequency method to mine the topics, and extract high-frequency keywords from the topics; By analyzing the data content of the mined topics, the topics are divided into technical topics and social topics.

5. The topic modeling and sentiment analysis method based on deep learning according to claim 1, characterized in that: Paragraph segmentation includes the following steps: The input document is segmented into sentences, and the segmented character sequences are represented as input to obtain word vectors, position vectors, and segment vectors; For each sentence, the knowledge vector is obtained through knowledge graph encoding, and the elements are summed to obtain the final character features; Input the obtained character features into the BERT encoder for encoding to obtain character features; Map the character features output by the encoder to each sentence, and obtain the final sentence features by mean pooling the character features of each sentence; The encoded sentence features of each sentence are mapped through the output layer and the activation function to determine whether each sentence is a paragraph boundary.

6. The topic modeling and sentiment analysis method based on deep learning according to claim 1, characterized in that: It also includes methods for visualizing sentiment analysis results, as follows: Visualize the frequency of occurrence of high-frequency keywords; Count the sentiment categories under each topic and dynamically display the sentiment distribution of the topic through a percentage pie chart; Analyze the evolution of topics in different time periods, and visualize the changes in attention and sentiment distribution of time-series topics; Dynamically generate a two-dimensional spatial distance distribution based on topic clustering, and visualize similar topics and parent category topics in a dendrogram.

7. The topic modeling and sentiment analysis system based on deep learning is characterized by: include: A data preprocessing module is configured to obtain an unlabeled text data set to be analyzed and perform preprocessing; The neural topic modeling module is configured to perform text embedding based on the feature fusion method of deep learning for the preprocessed data, dynamically determine the dimension reduction dimension to reduce the dimension of the embedded text, and cluster the reduced-dimensional data to obtain topics; The neural topic modeling module is also configured to filter out noise data distributed adjacent to the topic, calculate the consistency of the topic data and the adjacent noise, and re-divide the noise data for each topic to perform topic optimization; The topic sentiment analysis module is also configured to define variables, segment paragraphs based on knowledge graph embedding, label variables, and design time series analysis to extract the time changes of topics and the continuity of topic development characteristics, analyze the overall sentiment tendency of the topic, and obtain sentiment analysis results. The specific steps include: Define the data as independent and dependent variables according to statistical methods; Introducing knowledge graph embedding into the SeqModel paragraph segmentation model, integrating external knowledge to improve text representation and perform paragraph segmentation on thematic data; For the data after paragraph segmentation, annotate some variable data, use the pre-trained BERT model to predict the variables in the topic and annotate the unsupervised data; For the annotated new data set, we conduct topic time series analysis and topic sentiment tendency analysis on the independent variables and dependent variables in each topic, calculate the correlation between the independent variables and the dependent variables, and obtain the sentiment analysis results.

8. An electronic device, characterized in that: The method comprises a memory and a processor, and computer instructions stored in the memory and executed on the processor. When the computer instructions are executed by the processor, the steps in the deep learning-based topic modeling and sentiment analysis method described in any one of claims 1 to 6 are completed.

9. A computer-readable storage medium, characterized in that: Used to store computer instructions, which, when executed by a processor, complete the steps in the deep learning-based topic modeling and sentiment analysis method described in any one of claims 1 to 6.