Sentiment analysis method, device and storage medium based on natural language processing
Through natural language processing technology, combined with the interactive similarity of news and comments, and using the variational autoencoder model, the problem of difficulty in analyzing interactive information in the existing technology is solved, and accurate analysis and information extraction of public emotions are achieved.
Patent Information
- Application Number
- CN202311812513.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-26
- Publication Date
- 2024-09-03
- Estimated Expiration
- 2043-12-26
AI Technical Summary
Existing sentiment analysis technology is difficult to effectively extract rich and accurate public sentiment information from interactive information, especially from the large amount of news information and comments published on Internet social platforms. How to collect and analyze this information is a challenge.
Use a method based on natural language processing to obtain news data and comment data. By determining the emotional characteristic information of news text and comment text, and constructing an emotional information matrix, the variational autoencoder model is used to analyze the emotional information, combined with the interaction of news and comments. Similarity, comprehensive analysis of public sentiment.
It achieves a more accurate analysis of public sentiment, can extract valuable information from non-interactive and interactive information, and improves the accuracy and richness of sentiment analysis.
Smart Images

Figure CN117875330B
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of sentiment analysis, and in particular to a sentiment analysis method, device and storage medium based on natural language processing. Background Art
[0002] Sentiment analysis extracts the public's emotional tendencies by processing and analyzing text data, and is widely used in market research, finance, and social media monitoring. At present, sentiment analysis technology mainly extracts public emotional information by simply analyzing non-interactive text information such as news information.
[0003] However, due to the rapid development of Internet social networking, more and more news and other text information are published on major social forums / websites. Due to the participation and comments of users, news and information have become interactive and more widely circulated. With the influx of information and data, how to collect a series of valuable non-interactive and interactive information around news and information, and extract rich and accurate public sentiment information from it is a very difficult and challenging task. Summary of the invention
[0004] Embodiments of the present disclosure provide a sentiment analysis method, device, and storage medium based on natural language processing to extract rich and accurate public sentiment information from non-interactive information and interactive information of news information.
[0005] According to one aspect of an embodiment of the present disclosure, a sentiment analysis method based on natural language processing is provided, comprising: acquiring multiple news data related to a specified target, wherein the news data includes news text information and at least one corresponding comment text information; determining sentiment feature information corresponding to the news data, wherein the sentiment feature information includes: news sentiment information determined according to the corresponding news text information, first comment sentiment information determined according to the corresponding comment text information, and similarity interaction information between the news text information and the corresponding comment text information, wherein the similarity interaction information can reflect the degree of similarity between the news text information and the corresponding comment text information; constructing a corresponding sentiment information matrix according to the sentiment feature information of multiple news data; and determining the sentiment information corresponding to the specified target based on the sentiment information matrix by using a pre-set first sentiment analysis model based on a variational autoencoder.
[0006] According to another aspect of the embodiments of the present disclosure, a storage medium is further provided. The storage medium includes a stored program, wherein the above method is executed by a processor when the program is running.
[0007] According to another aspect of an embodiment of the present disclosure, a sentiment analysis device based on natural language processing is also provided, including: a news acquisition module, used to acquire multiple news data related to a specified target, wherein the news data includes news text information and at least one corresponding comment text information; a feature determination module, used to determine sentiment feature information corresponding to the news data, wherein the sentiment feature information includes: news sentiment information determined according to the corresponding news text information, first comment sentiment information determined according to the corresponding comment text information, and similarity interaction information between the news text information and the corresponding comment text information, wherein the similarity interaction information can reflect the degree of similarity between the news text information and the corresponding comment text information; a matrix construction module, used to construct a corresponding sentiment information matrix according to the sentiment feature information of multiple news data; and a sentiment information determination module, used to determine the sentiment information corresponding to the specified target based on the sentiment information matrix and using a pre-set first sentiment analysis model based on a variational autoencoder.
[0008] According to another aspect of an embodiment of the present disclosure, a sentiment analysis device based on natural language processing is also provided, including: a processor; and a memory, connected to the processor, for providing the processor with instructions for processing the following processing steps: obtaining multiple news data related to a specified target, wherein the news data includes news text information and at least one corresponding comment text information; determining sentiment feature information corresponding to the news data, wherein the sentiment feature information includes: news sentiment information determined based on the corresponding news text information, first comment sentiment information determined based on the corresponding comment text information, and similarity interaction information between the news text information and the corresponding comment text information, wherein the similarity interaction information can reflect the degree of similarity between the news text information and the corresponding comment text information; constructing a corresponding sentiment information matrix based on the sentiment feature information of multiple news data; and determining the sentiment information corresponding to the specified target based on the sentiment information matrix using a pre-set first sentiment analysis model based on a variational autoencoder.
[0009] In the disclosed embodiment, not only the non-interactive text information such as the news itself is analyzed, but the respective emotional information is extracted from the news text and the related evaluation text information, so as to obtain the news emotional information reflecting the news author himself and the comment emotional information reflecting the user who posted the comment. And the technical scheme further determines the interactive similarity information between the comment text information and the news text information, so as to comprehensively combine the news emotional information contained in the news, the comment emotional information contained in the comments posted by each user, and the interactive similarity between the selection text and the news, and jointly determine the emotional information related to the specified target. Therefore, the technical scheme of this embodiment can collect a series of valuable non-interactive information and interactive information surrounding news information, and extract rich and accurate public emotional information therefrom, so as to more accurately analyze the public's emotions. BRIEF DESCRIPTION OF THE DRAWINGS
[0010] The drawings described herein are used to provide a further understanding of the present disclosure and constitute a part of the present application. The illustrative embodiments of the present disclosure and their descriptions are used to explain the present disclosure and do not constitute an improper limitation on the present disclosure. In the drawings:
[0011] Figure 1 is a hardware structure block diagram of a computing device for implementing the method according to Embodiment 1 of the present disclosure;
[0012] Figure 2 is a schematic diagram of a sentiment analysis system based on natural language processing according to Embodiment 1 of the present disclosure;
[0013] Figure 3 is a flowchart of a sentiment analysis method based on natural language processing according to the first aspect of Embodiment 1 of the present disclosure;
[0014] Figure 4A is a schematic diagram of a sentiment analysis model based on the Ro-BERT model according to Embodiment 1 of the present disclosure;
[0015] Figure 4B is a further detailed flowchart of the sentiment analysis method based on natural language processing according to the first aspect of Embodiment 1 of the present disclosure;
[0016] Figure 5 is a schematic diagram of a sentiment analysis device based on natural language processing according to Embodiment 2 of the present disclosure; and
[0017] Figure 6 It is a schematic diagram of a sentiment analysis device based on natural language processing according to Embodiment 3 of the present disclosure. DETAILED DESCRIPTION
[0018] In order to enable those skilled in the art to better understand the technical solutions of the present disclosure, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are only embodiments of a part of the present disclosure, not all of the embodiments. Based on the embodiments in the present disclosure, all other embodiments obtained by ordinary technicians in this field without making creative work should fall within the scope of protection of the present disclosure.
[0019] It should be noted that the terms "first", "second", etc. in the specification and claims of the present disclosure and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present disclosure described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product, or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products, or devices.
[0020] Example 1
[0021] According to this embodiment, a method embodiment of a sentiment analysis method based on natural language processing is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0022] The method embodiment provided in this embodiment can be executed in a server or a similar computing device. Figure 1 FIG. 1 shows a hardware structure block diagram of a computing device for implementing a sentiment analysis method based on natural language processing. Figure 1 As shown, the computing device may include one or more processors (the processor may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA), a memory for storing data, a transmission device for communication functions, and an input / output interface. The memory, the transmission device, and the input / output interface are connected to the processor via a bus. In addition, it may also include: a display, a keyboard, and a cursor control device connected to the input / output interface. A person skilled in the art can understand that Figure 1 The structure shown is only for illustration and does not limit the structure of the above electronic device. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations shown.
[0023] It should be noted that the one or more processors and / or other data processing circuits described above may generally be referred to herein as "data processing circuitry". The data processing circuitry may be embodied in whole or in part as software, hardware, firmware, or any other combination thereof. In addition, the data processing circuitry may be a single independent processing module, or may be incorporated in whole or in part into any of the other components of the computing device. As involved in the embodiments of the present disclosure, the data processing circuitry acts as a processor control (e.g., selection of a variable resistor terminal path connected to an interface).
[0024] The memory can be used to store software programs and modules of application software, such as a program instruction / data storage device corresponding to a method for sentiment analysis based on natural language processing in an embodiment of the present disclosure. The processor executes various functional applications and data processing by running the software programs and modules stored in the memory, that is, a method for sentiment analysis based on natural language processing for implementing the above-mentioned application. The memory may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory may further include a memory remotely arranged relative to the processor, and these remote memories may be connected to the computing device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0025] The transmission device is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of the computing device. In one example, the transmission device includes a network adapter (Network Interface Controller, NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device can be a radio frequency (Radio Frequency, RF) module, which is used to communicate with the Internet wirelessly.
[0026] The display may be, for example, a touch screen liquid crystal display (LCD) that may enable a user to interact with a user interface of the computing device.
[0027] It should be noted that, in some optional embodiments, the above Figure 1 The computing device shown may include hardware elements (including circuits), software elements (including computer code stored on a computer-readable medium), or a combination of both hardware elements and software elements. Figure 1This is merely one example of a particular embodiment and is intended to illustrate the types of components that may be present in the computing devices described above.
[0028] Figure 2 is a schematic diagram of a sentiment analysis system based on natural language processing according to this embodiment. Figure 2 As shown, the system includes: a sentiment analysis data platform 100 and various social forums / websites 201~20n. Thus, the sentiment analysis data platform 100 can crawl news information and related comments in related fields from various social forums / websites 201~20n through crawlers set in various social forums / websites 201~20n, thereby constructing a news information data set. For example, the related field can be the financial field, and the news information can be, for example, a financial-related field. Thus, the sentiment analysis data platform 100 can analyze the emotions of investors based on the news information and related comments in the financial field, thereby determining the corresponding sentiment information. In addition, the sentiment analysis data platform 100 can, for example, be deployed with a news information database, so that the news information data obtained by the crawler can be stored in the news information database.
[0029] It should be noted that the sentiment analysis data platform 100 in the system can be applicable to the hardware structure described above.
[0030] Under the above operating environment, according to the first aspect of this embodiment, a sentiment analysis method based on natural language processing is provided. Figure 2 The sentiment analysis data platform 100 shown in FIG.
[0031] Figure 3 A schematic diagram showing the process of the method is shown in FIG. Figure 3 As shown, the method includes:
[0032] S302: Acquire a plurality of news data related to a specified target, wherein the news data includes news text information and corresponding at least one comment text information;
[0033] S304: Determine emotional feature information corresponding to the news data, wherein the emotional feature information includes: news emotional information determined according to the corresponding news text information, first comment emotional information determined according to the corresponding comment text information, and similarity interaction information between the news text information and the corresponding comment text information, wherein the similarity interaction information can reflect the similarity between the news text information and the corresponding comment text information;
[0034] S306: constructing a corresponding emotion information matrix according to the emotion feature information of the plurality of news data; and
[0035] S308: Based on the emotion information matrix, using a preset first emotion analysis model based on a variational autoencoder, determine the emotion information corresponding to the specified target.
[0036] Specifically, refer to Figure 2 As shown, according to the technical solution of this embodiment, the sentiment analysis data platform 100 first obtains multiple news data related to the specified target. The specific type of the "specified target" described in this embodiment is not limited. For example, the specified target can be a specified time period, a specified topic and / or a specified field. For example, in this embodiment, the specified target can be the financial field of a specified trading day, so that the sentiment analysis data platform 100 obtains multiple news data related to the financial field released on the specified trading day (S302).
[0037] Specifically, for example, the sentiment analysis data platform 100 can use crawlers to crawl news data related to 24 companies in 6 industries (such as beverage manufacturing, new energy vehicles, real estate development, chemical pharmaceuticals, steel manufacturing, and securities) on a specified trading day from various social forums / websites 201-20n. Therefore, the news data crawled by the sentiment analysis data platform 100 contains sentiment information related to the financial field.
[0038] In addition, in the embodiment of the present application, the sentiment analysis data platform 100 not only crawls the title or text information of the news (i.e., news text information), but also crawls the comment text information corresponding to the news. Thus, the sentiment analysis data platform 100 obtains a plurality of interactive news data D i (i=1-m), m is the number of news data. The following table 1 shows the news data:
[0039]
[0040]
[0041] As shown in Table 1, each news data D i It includes news text information and comment text information. The news text information includes the news title T i and news text M i . Comment text information C i Includes text information C of comments from different users on the news i,j (j=1~n i ), where n i Represents news data D i The amount of text information included in the review.
[0042] Then, the sentiment analysis data platform 100 uses the news data D i News text information (news title Ti and news text M i ) and comment text information Comment text information C i , determine the corresponding news data D i Corresponding emotional feature information F i (S304). Specifically, the emotion feature information F i For example, including: according to the news text information (news title T i and news text M i ) Determined news sentiment information En i ; Based on the comment text information C i,j , the determined comment sentiment information Ec i ; and according to the news text information (news title T i and news text M i ) and comment text information C i The determined news text information and comment text information C i The interaction similarity information S between i , where the interaction similarity information S i It can reflect the similarity between news text information and the corresponding comment text information. Among them, news sentiment information En i and comment sentiment information Ec i For example, it can be expressed by multiple different scores to represent the emotional state of not passing. In this embodiment, according to the emotions from low to high, 5 scores can be set, namely: 1 (very negative emotion), 2 (negative emotion), 3 (neutral), 4 (positive emotion) and 5 (very positive emotion). i and comment sentiment information Ec i Can display news data in an interactive way i The specific calculation of the above parameters will be described in detail below.
[0043] Then, the sentiment analysis data platform 100 analyzes the sentiment analysis data based on the plurality of news data D i Emotional feature information F i (i=1-m), construct an emotion information matrix related to the designated target (S306). The specific process of constructing the emotion information matrix will be described in detail later.
[0044] Finally, the sentiment analysis data platform 100 determines the sentiment information corresponding to the specified target (S308) based on the sentiment information matrix constructed in step S306 using a sentiment analysis model based on a variational autoencoder (VAE).
[0045] Among them, the sentiment analysis model uses the encoder neural network of VAE to map the sentiment information matrix into the latent space; then a vector in the latent space is input into the classifier of VAE for classification. Thus, according to the classification result, the sentiment information related to the specified target is determined. Among them, the sentiment information can also be expressed by 5 scores from low to high, namely: 1 (very negative sentiment), 2 (negative sentiment), 3 (neutral), 4 (positive sentiment) and 5 (very positive sentiment). Thus, the sentiment information corresponding to the specified target can be determined through the sentiment information. For example, on a specified trading day, the public (especially investors)’s sentiment towards finance.
[0046] Among them, the variational autoencoder can be constructed and trained in the following ways:
[0047] 1) Constructing the encoder network: The encoder neural network of VAE maps the emotion matrix to the distribution parameters in the latent space. And a vector sampled from the latent space can be used to generate new data;
[0048] 2) Construct the decoder network: The decoder network of VAE maps the latent vector back to the original data space;
[0049] 3) Constructing the loss function: The loss function of VAE consists of two parts: one is the reconstruction error, which is the error between the original data and the data generated by the decoder; the other is the KL divergence, which is used to penalize the difference between the distribution in the latent space and the standard normal distribution; and
[0050] 4) Training: Use optimization algorithms such as back-propagation and stochastic gradient descent to minimize the loss function and update the parameters of the encoder and decoder.
[0051] As described in the background technology, due to the rapid development of Internet social networking, more and more news and other text information are published on major social forums / websites. Due to the participation and comments of users, news and information have become interactive and more widely circulated. With the influx of information and data, how to collect a series of valuable non-interactive and interactive information around news and information, and extract rich and accurate public sentiment information from them is a very difficult and challenging task.
[0052] In view of this, according to the technical solution of this embodiment, not only the non-interactive text information such as the news itself is analyzed, but the respective emotional information is extracted from the news text and the related evaluation text information, so as to obtain the news emotional information reflecting the news author himself and the comment emotional information reflecting the user who posted the comment. And this technical solution further determines the interactive similarity information between the comment text information and the news text information, so as to comprehensively combine the news emotional information contained in the news, the comment emotional information contained in the comments posted by each user, and the interactive similarity between the selection text and the news, and jointly determine the emotional information related to the specified target. Therefore, the technical solution of this embodiment can collect a series of valuable non-interactive information and interactive information surrounding news information, and extract rich and accurate public emotional information from it, so as to more accurately analyze the public's emotions.
[0053] Optionally, the operation of acquiring a plurality of news data related to the designated target includes: building a web crawler mechanism to crawl the plurality of news data related to the designated target.
[0054] Specifically, in this embodiment, the sentiment analysis data platform 100 obtains data through web crawler technology, including:
[0055] Visit the information homepage of the social forum / website 201~20n, build url_list, grab the current information page URL in sequence and store it in url_list.
[0056] Use the request library to access the web page corresponding to the url, that is, the news title page, use the Beautifulsoup library to parse the web page, and extract the news release time, news title, news reading volume, news comment volume, and the corresponding text link of the news according to the web page source code tags, and store them in the database;
[0057] Similar to the above, use the request library to access the web page corresponding to the news text URL, use the Beautifusoup library to parse the web page, extract the news text, and store it in the database;
[0058] Set up an automatic page turning mechanism to dynamically capture user comments in the news and store them in the database.
[0059] Furthermore, the method further includes performing the following preprocessing on the crawled data:
[0060] For news titles, news bodies, and comment text information, delete the same corpus, load the retained corpus into Python, use string processing tools to remove special characters such as URLs, HTML, codes, comments, advertisements, and other tags, and update the database;
[0061] Check and supplement the missing content during the crawling process, such as news release media and news release time, and update the database; and
[0062] Sort the data in chronological order and align them according to the time window of the trading day (for example, the closing time of the previous trading day to the closing time of the current trading day).
[0063] Optionally, the operation of determining emotional feature information corresponding to news data includes: using a second emotion analysis model based on an attention mechanism to determine title emotion information corresponding to a news title of the news data; using a second emotion analysis model to determine text emotion information corresponding to a news text of the news data; and performing weighted summation of the title emotion information and the text emotion information to determine the news emotion information.
[0064] Specifically, for news data D i The sentiment analysis data platform 100 uses the BERT-based sentiment analysis model (i.e., the second sentiment analysis model) to analyze the news title T i and news text M i Emotion extraction is performed separately to determine the news title T i Corresponding title sentiment information Et i and the text M i Corresponding text emotion information Em i Then, we can analyze the title emotional information Et i and the emotional information of the text Em i Perform weighted summation to determine the corresponding news sentiment information En i The weight values of the title sentiment information and the text sentiment information can be preset based on experience or test results, and will not be described in detail here.
[0065] Furthermore, the sentiment analysis model based on BERT can adopt the pre-trained model from Hugging-face, namely the Ro-BERT model. Figure 4A A schematic diagram of a sentiment analysis model based on the Ro-BERT model is shown. The sentiment analysis model can be trained in the following ways:
[0066] 1) Dataset division: The news headlines, news texts and comment text information are divided into training sets, validation sets and test sets respectively. That is, the news headlines are divided into training sets, validation sets and test sets; the news texts are divided into training sets, validation sets and test sets; and the comment text information is divided into training sets, validation sets and test sets. Among them, the training set, validation set and test set are divided in a ratio of 8:1:1.
[0067] 2) Labeled data: The training set and test set are manually assigned sentiment scores, with 1 to 5 representing: very negative, negative, neutral, positive, and very positive.
[0068] 3) Construct a Ro-BERT pre-trained model: The Ro-BERT model from Hugging-face is processed by multiple layers of encodding, decodding, and self-attention to obtain a Ro-BERT pre-trained model.
[0069] 4) Build a sentiment analysis model based on the Ro-BERT model: Reference Figure 4A As shown in the figure, a fully connected layer and a softmax classifier are constructed based on the Ro-BERT pre-trained model, thereby constructing a sentiment analysis model based on the Ro-BERT model. The sentiment analysis model outputs sentiment classification vector information corresponding to the five sentiment scores: Q = [q 1 ,q 2 ,q 3 ,q 4 ,q 5 ] T Among them, q 1 ~q 5 are the probability values corresponding to different emotion scores. 1 is the probability corresponding to the sentiment score “1”, q 2 is the probability corresponding to the sentiment score “2”, q 3 is the probability corresponding to the sentiment score “3”, q 4 is the probability corresponding to the sentiment score “4”, and q 5 is the probability corresponding to the sentiment score “5”. The sentiment analysis data platform 100 may use the sentiment score with the highest probability as the sentiment information of the corresponding input text.
[0070] 4) Input the training set into the sentiment analysis model and fine-tune the model, that is, fine-tune the hyperparameters in the model to make the fine-tuned model more suitable for the corpus context in the database; stop training when the accuracy of the validation set is >85%, and save the best model;
[0071] 5) Sentiment analysis test: The fine-tuned sentiment analysis model is loaded to perform five-category sentiment analysis on the financial news headlines, financial news texts, and financial news comments in the test set, including using a softmax classifier to score the information output by the Ro-BERT model. The financial news sentiment scores range from 1 to 5, representing emotions: relatively negative, negative, neutral, positive, and relatively positive.
[0072] Thus, the sentiment analysis data platform 100 uses the sentiment analysis model trained according to the above steps to perform sentiment analysis on the news title and the news text, thereby determining the sentiment scores of the news title and the news text. i After inputting the sentiment analysis model, the model will output the news title T i Corresponding emotion classification vector information in, For news title T i The probability that the sentiment score is "1"; For news title T i The probability that the sentiment score is "2"; ...; and so on, For news title T i The probability that the sentiment score is "5". Therefore, the sentiment analysis data platform can determine the score with the highest probability as the one related to the news title T i Corresponding title sentiment information Et i Similarly, the news article M i After inputting the sentiment analysis model, the model will output i Corresponding emotion classification vector information in, For news content M i The probability that the sentiment score is "1"; For news content M i The probability that the sentiment score is "2"; ...; and so on, For news content M i The probability that the sentiment score is "5". Therefore, the sentiment analysis data platform can determine the score with the highest probability as the one related to the news text M. i Corresponding text emotion information Em i .
[0073] Optionally, the operation of determining the emotional characteristic information corresponding to the news data also includes: performing emotional analysis on multiple comment text information of the news data through a second emotional analysis model to determine second comment emotional information of the multiple comment text information; and respectively determining the similarity between the multiple comment text information and the news titles of the news data.
[0074] Specifically, as shown in Table 1, for each news data D i , which also includes multiple comment text information C i,1 ~C i,ni . The comment text information C i,j (j=1~n i ) For example, it can be the users of social forums / websites 201-20n for the news data D i The jth comment published on the news.
[0075] In order to extract interactive feature information related to news information, the sentiment analysis data platform 100 can use the sentiment analysis model based on the Ro-BERT model (i.e., the second sentiment analysis model) to extract interactive feature information related to news information for each comment text information C i,j , determine the corresponding emotion classification vector information:
[0076]
[0077] in, Comment text information C i,j The probability that the sentiment score is "1"; Comment text information C i,j The probability that the sentiment score is "2"; ...; and so on, Comment text information C i,j The probability that the sentiment score is "5". Therefore, the sentiment analysis data platform can determine the score with the highest probability as the one related to the comment text information C i,j Corresponding comment sentiment information Ec i,j (i.e., the second comment sentiment information).
[0078] Thus, the sentiment analysis data platform 100 can analyze the sentiment based on the news data D i Each comment text information C i,j , determine the corresponding emotion classification vector and comment emotion information. In this way, the emotion analysis data platform 100 can use the model based on the attention mechanism to extract the corresponding emotion information for each comment text information, so as to more fully collect the emotion information of the interactive information.
[0079] In addition, the sentiment analysis data platform 100 also generates a sentiment analysis result for each comment text information C i,j , determine the comment text information C i,j With news headlines T i The similarity S between i,j Specifically, the sentiment analysis data platform 100 can first analyze each comment text information C based on the Embedding mechanism in the BERT model (such as the Ro-BERT model described above). i,j And the news title T i Encode and determine the comment text information C i,j And the news title T i The corresponding tensor. Then calculate the text information C of each comment separately i,j The tensor with the news title T i The cosine similarity between the tensors is used as the comment text information C i,j With news headlines Ti The similarity S between i,j .
[0080] Therefore, according to this embodiment, for each news data D i , we can determine the text information C of each comment i,j With news headlines T i The similarity S between i,j , determine the text information C of each comment i,j With news headlines T i The interaction similarity between them can further determine the news data D i The degree of interactivity of the network is conducive to the comprehensive and accurate extraction of emotional information from the interactive information.
[0081] Optionally, the operation of determining the emotional characteristic information corresponding to the emotional score news data also includes: normalizing the similarities corresponding to multiple comment text information with the emotional scores to determine the first weight corresponding to each comment text information; and taking the weighted sum of the second comment emotional information of each comment text information based on the first weight of the multiple comment text information with the emotional score to determine the first comment emotional information with the emotional score.
[0082] Specifically, when determining the news data D i Comments on emotional feature information Ec i In the process of sentiment analysis, the sentiment analysis data platform 100 first analyzes each comment text information C i,j With news headlines T i The similarity S between i,j Normalize it to get the text information C of each comment i,j The corresponding first weight w i,j .in,
[0083]
[0084] Among them, n i It is news data D i The number of comment text information. Then the sentiment analysis data platform can determine the comment sentiment information Ec according to the following formula i :
[0085]
[0086] Therefore, this embodiment uses the information C that reflects each comment text. i,j and j With news headlines T i The interactive similarity information S i,j To determine the first weight information w i,j. And use the first weight information w i,j For each comment information C i,j Corresponding comment sentiment information Ec i,j (i.e., the second comment sentiment information) is weighted summed. The comment sentiment information Ec is obtained i (i.e., the first comment sentiment information) not only reflects the comprehensive sentiment of the comment text information, but also incorporates the interactivity between each comment text and the news, thereby being able to more accurately reflect the public's sentiments towards the content of the news.
[0087] In addition, optionally, the operation of determining the emotional feature information corresponding to the news data also includes: determining the number of comment text information corresponding to different second comment emotional information respectively according to the second comment emotional information of multiple comment text information; determining the comment probability information corresponding to each comment text information based on the Dirichlet distribution according to the emotion classification vector information corresponding to each comment text information and the number of comment text information corresponding to different second comment emotional information; normalizing the comment probability information corresponding to each comment text information to determine the second weight corresponding to each comment text information; and performing weighted summation of the similarities corresponding to each comment text information according to the second weights corresponding to the multiple comment text information to determine the interactive similarity information.
[0088] Specifically, in this embodiment, when determining the news data D i The corresponding interaction similarity information S i In the process, the sentiment analysis data platform 100 first analyzes the news data D i Each comment text information C i,j Comment sentiment information Ec i,j Statistics are performed to calculate the number of comment text information corresponding to different sentiment scores.
[0089] For example, the number of comment text information corresponding to the sentiment score of "1" is (α1-1); the number of comment text information corresponding to the sentiment score of "2" is (α2-1); the number of comment text information corresponding to the sentiment score of "3" is (α3-1); the number of comment text information corresponding to the sentiment score of "4" is (α4-1); and so on, the number of comment text information corresponding to the sentiment score of "5" is (α5-1).
[0090] Therefore, according to the a priori parameters α1~α5 determined above, let:
[0091]
[0092] The probability density function of the corresponding Dirichlet distribution can be determined:
[0093]
[0094] Then, the sentiment analysis data platform 100 targets the news data D i Each comment text information C i,j , get the corresponding emotion classification vector
[0095] Then, the sentiment analysis data platform 100 will Substituting into x1, Substituting into x2, Substituting into x3, Substitute x4 and Substitute x5 to calculate the comment text information C using formula (4) i,j The corresponding probability P i,j (i.e., review probability information).
[0096] The sentiment analysis data platform 100 calculates each comment text information C i,j P i,j Normalize it to get the text information C of each comment i,j The corresponding second weight k i,j .in,
[0097]
[0098] Among them, n i It is news data D i The sentiment analysis data platform can then determine the news data D according to the following formula i The interactive similarity information S i :
[0099]
[0100] Among them, the weight k i,j Reflects news data D i Each comment text information C i,j The probability corresponding to the distribution of different sentiment scores in , which reflects the text information C of each comment i,j The mapping distribution of the expressed emotions in the probability space. The similarity S i,j It reflects the text information of each comment C i,j The interaction similarity between the comments and the news. i,j The emotional information of the comment text information C i,j Similarity information S with news i,jThe emotion-related features are extracted. Thus, the calculated interaction similarity information S i Also contains the comment text information C i,j Therefore, the extracted features can more accurately reflect the emotional information in the interactive information.
[0101] Optionally, the operation of constructing a corresponding emotion information matrix based on emotion feature information of multiple news data includes: weighting the news emotion information of each news data according to the reading volume of the news text information of each news data, so as to determine the weighted news emotion information of each news data; weighting the first comment emotion information of each news data according to the amount of comment text information of each news data, so as to determine the weighted comment emotion information of each news data; acquiring the media type information corresponding to each news data; and constructing the emotion information matrix according to the weighted news emotion information, weighted comment emotion information, interaction similarity information and media type information of each news data.
[0102] Refer to Table 2 below. Through the above operations, for each news data D i The corresponding news sentiment information En can be determined i , Comment sentiment information Ec i And the interaction similarity information S i . Where i=1~m.
[0103] Table 2
[0104]
[0105] In addition, as shown in Table 2, the sentiment analysis data platform 100 also obtains information related to each news data D i The corresponding news reading volume Nr i 、Nc of news comments i And media type information Y i .
[0106] Among them, media type information Y i Used to indicate the release of the news data D i The type of news release media. For example, based on the attributes of the actual controlling shareholder of the news release media, the news release media can be divided into the following five categories: first-level official media; second-level official media; financial institutions; media-affiliated websites; and private self-media. Labels 5 to 1 are assigned in sequence. The higher the label value, the greater the authority of the media news. Therefore, news data D i Media type information Y i This is one of tags 1 to 5.
[0107] Therefore, in order to perform sentiment analysis more accurately, the sentiment analysis data platform 100 performs further processing based on the data shown in Table 2.
[0108] First, the sentiment analysis data platform 100 analyzes each piece of news data D i News reading volume Nr i Normalization is performed to determine the emotional information En of each news i The corresponding weights, where each news sentiment information En i The sum of the weights is 1. Then the sentiment analysis data platform 100 analyzes the sentiment information En of each news i Perform weighted processing to obtain weighted news sentiment information En i In addition, the sentiment analysis data platform 100 converts each news data D i The number of news comments Nc i With each comment sentiment information Ec i Multiply them together to get the adjusted comment sentiment information Ec i '. Then we get the emotion information matrix shown in Table 3.
[0109] Table 3
[0110]
[0111] Therefore, referring to Table 3, with each news data D1~D m Corresponding weighted news sentiment information En1'~En m ', adjusted comment sentiment information Ec1'~Ec m ', interactive similarity information S1~S m And media type information Y1~Y m It constitutes the emotional information matrix.
[0112] Then, the sentiment analysis data platform 100 inputs the sentiment information matrix shown in Table 3 into the first sentiment analysis model based on variational autoencoder (VEA), so as to further obtain the sentiment information corresponding to the specified target.
[0113] Figure 4B A specific flow chart of the natural language processing-based sentiment analysis method described in this embodiment is further shown. Figure 4B As shown, the specific operation process of the sentiment analysis data platform 100 described in this embodiment is as follows:
[0114] S402: Acquire news data D corresponding to the designated target from various social forums / websites 201 to 20n through crawlers i .
[0115] S404: Acquired news data Di , perform data cleaning and preprocessing to determine the D i Corresponding news text M i 、News TitleT i 、News Comments C i 、News reading volume Nr i 、Nc i and media type Y i .
[0116] S406: Using the BERT-based sentiment analysis model to analyze the news data D i The text of M i Perform sentiment analysis to obtain the corresponding text sentiment information Em i .
[0117] S408: Using the BERT-based sentiment analysis model to analyze news data D i Title T i Perform sentiment analysis to obtain the corresponding title sentiment information Et i .
[0118] S410: For news data D i Each comment text information C i,j , calculate the comment text information C i,j With news headlines T i The similarity S between i,j .
[0119] S412: Using the BERT-based sentiment analysis model, we analyze the news data D i Comment text information C i,j Perform sentiment analysis to obtain the corresponding comment sentiment information Ec i,j .
[0120] S414: Similarity S i,j Normalize and get the first weight w i,j , and use the first weight w i,j Comment sentiment information Ec i,j Perform weighted summation to obtain comment sentiment information Ec i .
[0121] S416: Based on the comment sentiment information Ec i,j , using Dirichlet distribution to determine the text C of each comment information i,j The corresponding probability P i,j , and for the probability P i,j Normalize it and get the second weight k i,j , and then use the second weight k i,j For similarity Si,j Perform weighted summation to obtain the interaction similarity S i .
[0122] S418: For each news data D i Number of readings i Normalize the data to get the news data D i Reading weight.
[0123] S420: Using reading weights to sort each piece of news data D i News sentiment information i Perform weighted processing to obtain weighted news sentiment information En i '.
[0124] S422: The news data D i Number of comments Nc i and the corresponding comment sentiment information Ec i Multiply them together to get the adjusted comment sentiment information Ec i '.
[0125] S424: Using various news data D i Weighted news sentiment information En i ', adjusted comment sentiment information Ec i ', interactive similarity information S i And media type information Y i Constructing the emotional information matrix.
[0126] S426: Input the emotion information matrix into a emotion analysis model based on a variational autoencoder (VAE) to determine the emotion information related to the specified target.
[0127] In addition, reference Figure 1 As shown, according to the second aspect of this embodiment, a storage medium is provided, wherein the storage medium includes a stored program, wherein when the program is run, a processor executes any one of the above methods.
[0128] Therefore, according to the technical solution of this embodiment, not only the non-interactive text information such as the news itself is analyzed, but the respective emotional information is extracted from the news text and the related evaluation text information, so as to obtain the news emotional information reflecting the news author himself and the comment emotional information reflecting the user who posted the comment. And this technical solution further determines the interactive similarity information between the comment text information and the news text information, so as to comprehensively combine the news emotional information contained in the news, the comment emotional information contained in the comments posted by each user, and the interactive similarity between the selection text and the news, and jointly determine the emotional information related to the specified target. Therefore, the technical solution of this embodiment can collect a series of valuable non-interactive information and interactive information surrounding news information, and extract rich and accurate public emotional information from it, so as to analyze the public's emotions more accurately.
[0129] It should be noted that, for the above-mentioned method embodiments, for the sake of simplicity, they are all described as a series of action combinations, but those skilled in the art should know that the present invention is not limited by the described action sequence, because according to the present invention, certain steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present invention.
[0130] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for enabling a terminal device (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present invention.
[0131] Example 2
[0132] Figure 5 The apparatus 500 for analyzing emotions based on natural language processing according to the first aspect of this embodiment is shown. The apparatus 500 corresponds to the method according to the first aspect of embodiment 1. Figure 5As shown, the device 500 includes: a news acquisition module 510, used to acquire multiple news data related to a specified target, wherein the news data includes news text information and at least one corresponding comment text information; a feature determination module 520, used to determine emotional feature information corresponding to the news data, wherein the emotional feature information includes: news emotional information determined according to the corresponding news text information, first comment emotional information determined according to the corresponding comment text information, and similarity interaction information between the news text information and the corresponding comment text information, wherein the similarity interaction information can reflect the degree of similarity between the news text information and the corresponding comment text information; a matrix construction module 530, used to construct a corresponding emotional information matrix based on the emotional feature information of multiple news data; and an emotional information determination module 540, used to determine the emotional information corresponding to the specified target based on the emotional information matrix and using a pre-set first emotional analysis model based on a variational autoencoder.
[0133] Optionally, the news acquisition module 510 includes: a news acquisition submodule for constructing a web crawler mechanism to crawl the multiple news data related to the specified target. The device also includes a preprocessing module for preprocessing the multiple news data acquired.
[0134] Optionally, the feature determination module 520 includes: a title emotion information determination submodule, which is used to determine the title emotion information corresponding to the news title of the news data by using a second emotion analysis model based on the attention mechanism; a text emotion information determination submodule, which is used to determine the text emotion information corresponding to the news text of the news data by using the second emotion analysis model; and a news emotion information determination submodule, which is used to perform a weighted summation of the title emotion information and the text emotion information to determine the news emotion information.
[0135] Optionally, the feature determination module 520 also includes: a second comment sentiment information determination submodule, used to perform sentiment analysis on multiple comment text information of the news data through the second sentiment analysis model, and determine second comment sentiment information of the multiple comment text information; and a similarity determination submodule, used to respectively determine the similarity between the multiple comment text information and the news titles of the news data.
[0136] Optionally, the feature determination module 520 also includes: a first weight determination submodule, used to normalize the similarities corresponding to the multiple comment text information, and determine the first weight corresponding to each comment text information; and a first comment emotion information determination submodule, used to perform weighted summation of the second comment emotion information of each comment text information according to the first weights of the multiple comment text information, and determine the first comment emotion information.
[0137] Optionally, the feature determination module 520 also includes: a comment quantity determination submodule, which is used to determine the number of comment text information corresponding to different second comment emotion information according to the second comment emotion information of the multiple comment text information; a comment probability information determination submodule, which is used to determine the comment probability information corresponding to each comment text information based on the Dirichlet distribution according to the emotion classification vector information corresponding to each comment text information and the number of comment text information corresponding to different second comment emotion information; a second weight determination submodule, which is used to normalize the comment probability information corresponding to each comment text information and determine the second weight corresponding to each comment text information; and a similarity interaction determination submodule, which is used to perform weighted summation of the similarities corresponding to each comment text information according to the second weights corresponding to the multiple comment text information and determine the similarity interaction information.
[0138] Optionally, the matrix construction module 530 includes: a news sentiment information weighting sub-module, which is used to weight the news sentiment information of each news data according to the news reading volume of the news text information of each news data, so as to determine the weighted news sentiment information of each news data; a comment sentiment information adjustment sub-module, which is used to multiply the number of comment text information of each news data by the corresponding first comment sentiment information, so as to determine the adjusted comment sentiment information of each news data; a media type information acquisition sub-module, which is used to acquire the media type information corresponding to each news data; and a matrix construction sub-module, which is used to construct a sentiment information matrix according to the weighted news sentiment information of each news data, the adjusted comment sentiment information, the similarity interaction information and the media type information.
[0139] Therefore, according to the technical solution of this embodiment, not only the non-interactive text information such as the news itself is analyzed, but the respective emotional information is extracted from the news text and the related evaluation text information, so as to obtain the news emotional information reflecting the news author himself and the comment emotional information reflecting the user who posted the comment. And this technical solution further determines the interactive similarity information between the comment text information and the news text information, so as to comprehensively combine the news emotional information contained in the news, the comment emotional information contained in the comments posted by each user, and the interactive similarity between the selection text and the news, and jointly determine the emotional information related to the specified target. Therefore, the technical solution of this embodiment can collect a series of valuable non-interactive information and interactive information surrounding news information, and extract rich and accurate public emotional information from it, so as to analyze the public's emotions more accurately.
[0140] Example 3
[0141] Figure 6The apparatus 600 for sentiment analysis based on natural language processing according to this embodiment is shown, and the apparatus 600 corresponds to the method according to the first aspect of embodiment 1. Figure 6 As shown, the device 600 includes: a processor 610; and a memory 620, which is connected to the processor 610 and is used to provide the processor 610 with instructions for processing the following processing steps: obtaining multiple news data related to a specified target, wherein the news data includes news text information and at least one corresponding comment text information; determining emotional feature information corresponding to the news data, wherein the emotional feature information includes: news emotional information determined based on the corresponding news text information, first comment emotional information determined based on the corresponding comment text information, and similarity interaction information between the news text information and the corresponding comment text information, wherein the similarity interaction information can reflect the degree of similarity between the news text information and the corresponding comment text information; constructing a corresponding emotional information matrix based on the emotional feature information of multiple news data; and determining the emotional information corresponding to the specified target based on the emotional information matrix using a pre-set first emotional analysis model based on a variational autoencoder.
[0142] Optionally, the operation of acquiring multiple news data related to the specified target includes: constructing a web crawler mechanism to crawl the multiple news data related to the specified target. And the memory 620 is also used to provide the processor 610 with instructions for processing the following processing steps: pre-processing the acquired multiple news data.
[0143] Optionally, the operation of determining the emotional feature information corresponding to the news data includes: using a second emotion analysis model based on an attention mechanism to determine the title emotional information corresponding to the news title of the news data; using the second emotion analysis model to determine the text emotional information corresponding to the news text of the news data; and performing weighted summation of the title emotional information and the text emotional information to determine the news emotional information.
[0144] Optionally, the operation of determining the emotional characteristic information corresponding to the news data also includes: performing emotional analysis on multiple comment text information of the news data through the second emotional analysis model to determine second comment emotional information of the multiple comment text information; and respectively determining the similarity between the multiple comment text information and the news titles of the news data.
[0145] Optionally, the operation of determining the emotional characteristic information corresponding to the news data also includes: normalizing the similarities corresponding to the multiple comment text information to determine the first weight corresponding to each comment text information; and weighted summing the second comment emotional information of each comment text information based on the first weights of the multiple comment text information to determine the first comment emotional information.
[0146] Optionally, the operation of determining the emotional characteristic information corresponding to the news data also includes: determining the number of comment text information corresponding to different second comment emotional information respectively according to the second comment emotional information of the multiple comment text information; determining the comment probability information corresponding to each comment text information based on the Dirichlet distribution according to the emotion classification vector information corresponding to each comment text information and the number of comment text information corresponding to different second comment emotional information; normalizing the comment probability information corresponding to each comment text information to determine the second weight corresponding to each comment text information; and performing weighted summation of the similarities corresponding to each comment text information according to the second weights corresponding to the multiple comment text information to determine the similarity interaction information.
[0147] Optionally, the operation of constructing a corresponding emotion information matrix based on the emotion feature information of the multiple news data includes: weighting the news emotion information of each news data according to the news reading volume of the news text information of each news data, so as to determine the weighted news emotion information of each news data; multiplying the number of comment text information of each news data by the corresponding first comment emotion information, so as to determine the adjusted comment emotion information of each news data; acquiring the media type information corresponding to each news data; and constructing the emotion information matrix based on the weighted news emotion information, adjusted comment emotion information, similarity interaction information and media type information of each news data.
[0148] Therefore, according to the technical solution of this embodiment, not only the non-interactive text information such as the news itself is analyzed, but the respective emotional information is extracted from the news text and the related evaluation text information, so as to obtain the news emotional information reflecting the news author himself and the comment emotional information reflecting the user who posted the comment. And this technical solution further determines the interactive similarity information between the comment text information and the news text information, so as to comprehensively combine the news emotional information contained in the news, the comment emotional information contained in the comments posted by each user, and the interactive similarity between the selection text and the news, and jointly determine the emotional information related to the specified target. Therefore, the technical solution of this embodiment can collect a series of valuable non-interactive information and interactive information surrounding news information, and extract rich and accurate public emotional information from it, so as to analyze the public's emotions more accurately.
[0149] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.
[0150] In the above embodiments of the present invention, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0151] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, 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, indirect coupling or communication connection of units or modules, which can be electrical or other forms.
[0152] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0153] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0154] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server or a 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, read-only memory (ROM, Read-Only Memory), random access memory (RAM, RandomAccess Memory), mobile hard disk, magnetic disk or optical disk and other media that can store program codes.
[0155] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principle of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.
Claims
1. A sentiment analysis method based on natural language processing, characterized in that: include: Acquire a plurality of news data related to a specified target, wherein the news data includes news text information and corresponding at least one comment text information; Determine emotional characteristic information corresponding to the news data, wherein the emotional characteristic information includes: news emotional information determined according to the corresponding news text information, first comment emotional information determined according to the corresponding comment text information, and similarity interaction degree information between the news text information and the corresponding comment text information, wherein the similarity interaction degree information can reflect the similarity degree between the news text information and the corresponding comment text information; Constructing a corresponding emotion information matrix according to the emotion feature information of the plurality of news data; and Based on the emotion information matrix, the emotion information corresponding to the specified target is determined by using a preset first emotion analysis model based on a variational autoencoder, wherein The operation of determining the emotional characteristic information corresponding to the news data further includes: Performing sentiment analysis on the plurality of comment text information of the news data by using a second sentiment analysis model to determine second comment sentiment information of the plurality of comment text information; and Determine the similarity between the plurality of comment text information and the news title of the news data respectively, wherein The operation of determining the emotional characteristic information corresponding to the news data further includes: Determining the number of review text information corresponding to different second review emotion information respectively according to the second review emotion information of the plurality of review text information; Determine, based on Dirichlet distribution, the comment probability information corresponding to each comment text information according to the emotion classification vector information corresponding to each comment text information and the number of comment text information corresponding to different second comment emotion information; Normalizing the review probability information corresponding to each review text information to determine a second weight corresponding to each review text information; and According to the second weights corresponding to the plurality of comment text information, the similarities corresponding to the respective comment text information are weighted and summed to determine the similarity interaction degree information, wherein The operation of constructing a corresponding emotion information matrix according to the emotion feature information of the plurality of news data includes: According to the news reading amount of the news text information of each news data, the news sentiment information of each news data is weighted, so as to determine the weighted news sentiment information of each news data; Multiplying the amount of comment text information of each news data by the corresponding first comment sentiment information, thereby determining adjusted comment sentiment information of each news data; Obtaining media type information corresponding to each piece of news data; and The sentiment information matrix is constructed according to the weighted news sentiment information, the adjusted comment sentiment information, the similarity interaction information and the media type information of each news data.
2. The method according to claim 1, characterized in that The operation of acquiring multiple news data related to the designated target includes: building a network crawler mechanism to crawl the multiple news data related to the designated target, and the method also includes: preprocessing the acquired multiple news data.
3. The method according to claim 1, characterized in that The operation of determining the emotional characteristic information corresponding to the news data includes: Determine title sentiment information corresponding to the news title of the news data by using a second sentiment analysis model based on an attention mechanism; Determining text emotion information corresponding to the news text of the news data using the second emotion analysis model; and The title sentiment information and the text sentiment information are weightedly summed to determine the news sentiment information.
4. The method according to claim 1, characterized in that: The operation of determining the emotional characteristic information corresponding to the news data further includes: Normalizing the similarities corresponding to the plurality of comment text information to determine a first weight corresponding to each comment text information; and The second comment emotion information of each comment text information is weightedly summed according to the first weights of the plurality of comment text information to determine the first comment emotion information.
5. A storage medium, characterized in that: The storage medium includes a stored program, wherein when the program is run, the processor executes the method according to any one of claims 1 to 4.
6. A sentiment analysis device based on natural language processing, characterized in that: include: A news acquisition module, used to acquire a plurality of news data related to a specified target, wherein the news data includes news text information and corresponding at least one comment text information; A feature determination module, configured to determine emotional feature information corresponding to the news data, wherein the emotional feature information includes: news emotional information determined according to the corresponding news text information, first comment emotional information determined according to the corresponding comment text information, and similarity interaction degree information between the news text information and the corresponding comment text information, wherein the similarity interaction degree information can reflect the similarity degree between the news text information and the corresponding comment text information; A matrix construction module, used to construct a corresponding emotion information matrix according to the emotion feature information of the plurality of news data; and The emotion information determination module is used to determine the emotion information corresponding to the specified target based on the emotion information matrix and using a preset first emotion analysis model based on a variational autoencoder, wherein The feature determination module further includes: a second comment sentiment information determination submodule, configured to perform sentiment analysis on the plurality of comment text information of the news data through a second sentiment analysis model to determine second comment sentiment information of the plurality of comment text information; and The similarity determination submodule is used to determine the similarity between the plurality of comment text information and the news title of the news data respectively, wherein The feature determination module further includes: a comment quantity determination submodule, which is used to determine the quantity of comment text information corresponding to different second comment emotion information respectively according to the second comment emotion information of the plurality of comment text information; A comment probability information determination submodule, used to determine the comment probability information corresponding to each comment text information based on the Dirichlet distribution according to the emotion classification vector information corresponding to each comment text information and the number of comment text information corresponding to different second comment emotion information; A second weight determination submodule is used to normalize the comment probability information corresponding to each comment text information to determine a second weight corresponding to each comment text information; and The similarity interaction determination submodule is used to perform weighted summation of the similarities corresponding to the respective comment text information according to the second weights corresponding to the plurality of comment text information to determine the similarity interaction information, wherein The matrix construction module includes: a news sentiment information weighting submodule, which is used to perform weighted processing on the news sentiment information of each news data according to the news reading volume of the news text information of each news data, so as to determine the weighted news sentiment information of each news data; A comment sentiment information adjustment submodule, used for multiplying the amount of comment text information of each news data by the corresponding first comment sentiment information, thereby determining the adjusted comment sentiment information of each news data; A media type information acquisition submodule, used to acquire media type information corresponding to each piece of news data; and The matrix construction submodule is used to construct a sentiment information matrix based on the weighted news sentiment information, adjusted comment sentiment information, similar interaction information and media type information of each news data.
7. A sentiment analysis device based on natural language processing, characterized in that: include: processor; as well as A memory, connected to the processor, configured to provide the processor with instructions for processing the following processing steps: Acquire a plurality of news data related to a specified target, wherein the news data includes news text information and corresponding at least one comment text information; Determine emotional characteristic information corresponding to the news data, wherein the emotional characteristic information includes: news emotional information determined according to the corresponding news text information, first comment emotional information determined according to the corresponding comment text information, and similarity interaction degree information between the news text information and the corresponding comment text information, wherein the similarity interaction degree information can reflect the similarity degree between the news text information and the corresponding comment text information; Constructing a corresponding emotion information matrix according to the emotion feature information of the plurality of news data; and Based on the emotion information matrix, the emotion information corresponding to the specified target is determined by using a preset first emotion analysis model based on a variational autoencoder, wherein The operation of determining the emotional characteristic information corresponding to the news data further includes: Performing sentiment analysis on the plurality of comment text information of the news data by using a second sentiment analysis model to determine second comment sentiment information of the plurality of comment text information; and Determine the similarity between the plurality of comment text information and the news title of the news data respectively, wherein The operation of determining the emotional characteristic information corresponding to the news data further includes: Determining the number of review text information corresponding to different second review emotion information respectively according to the second review emotion information of the plurality of review text information; Determine, based on Dirichlet distribution, the comment probability information corresponding to each comment text information according to the emotion classification vector information corresponding to each comment text information and the number of comment text information corresponding to different second comment emotion information; Normalizing the review probability information corresponding to each review text information to determine a second weight corresponding to each review text information; and According to the second weights corresponding to the plurality of comment text information, the similarities corresponding to the respective comment text information are weighted and summed to determine the similarity interaction degree information, wherein The operation of constructing a corresponding emotion information matrix according to the emotion feature information of the plurality of news data includes: According to the news reading amount of the news text information of each news data, the news sentiment information of each news data is weighted, so as to determine the weighted news sentiment information of each news data; Multiplying the amount of comment text information of each news data by the corresponding first comment sentiment information, thereby determining adjusted comment sentiment information of each news data; Obtaining media type information corresponding to each piece of news data; and The sentiment information matrix is constructed according to the weighted news sentiment information, the adjusted comment sentiment information, the similarity interaction information and the media type information of each news data.
