Intelligent news topic sentiment analysis method, device, equipment and storage medium

By training Bert/Xlnet+CRF and Bert main models and combining crawling technology, the emotional recognition problem in public opinion analysis is solved, and the accurate analysis of the emotions of news articles is achieved, helping enterprises quickly lock in public opinion.

CN114969345BActive Publication Date: 2024-12-13PING AN TECH (SHENZHEN) CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202210680074.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-06-16
Publication Date
2024-12-13
Estimated Expiration
2042-06-16

AI Technical Summary

Technical Problem

In the existing technology, it is difficult to accurately identify the emotions of news articles in public opinion analysis, especially for public opinion analysis between businesses. Traditional machine learning and deep learning algorithms are difficult to effectively distinguish the emotions of articles, resulting in too many neutral marks and being unable to quickly lock in corporate public opinion. .

Method used

The preset extraction and annotation method is used to repeatedly train Bert/Xlnet+CRF subject model and Bert subject model to form the subject extraction model and subject sentiment analysis model. Combined with crawling software to crawl and clean news releases, and obtain news through subject extraction and sentiment analysis. Subject and its emotional data.

Benefits of technology

It realizes accurate identification and analysis of the emotions of news articles, and can easily obtain the theme and subject emotions of the news, and then easily and accurately grasp corporate public opinion.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114969345B_ABST
    Figure CN114969345B_ABST
Patent Text Reader

Abstract

The invention relates to the field of artificial intelligence, and proposes an intelligent news theme sentiment analysis method. Firstly, the accuracy of a Bert / Xlnet+CRF subject model is trained to reach a preset extraction accuracy threshold, and the Bert / Xlnet+CRF subject extraction model updated by the last training is used as a subject extraction model; then the Bert subject model updated by the last training is used as a subject analysis model, and the subject analysis model is linked with the subject extraction model to form a subject sentiment analysis model; then, data cleaning is performed on news articles to obtain target data; then, the target data is input into a subject sentiment analysis model to perform a subject extraction operation on the target data through the subject extraction model to obtain a news subject, and the news subject is input into a subject sentiment analysis model to obtain sentiment analysis data corresponding to the news subject, so that the theme emotion and subject emotion of the news can be easily obtained, and then the public opinion of a target enterprise can be obtained according to entries in various types of news.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of artificial intelligence, to semantic emotion recognition technology, and in particular to an intelligent news topic emotion analysis method, device, electronic device and computer-readable storage medium. Background Art

[0002] With the continuous progress and development of society, the emergence of social media has greatly enriched our lives, and various types of news are emerging in an endless stream.

[0003] Based on the development of artificial intelligence, sentiment analysis based on deep learning has been applied to public opinion analysis, product analysis and other fields. Compared with traditional machine learning algorithms such as SVG, deep learning, especially pre-trained models, has higher accuracy, precision and recall. However, both traditional machine learning algorithms and current deep learning solutions are text analysis of a piece of text, but in many cases, it is difficult for both people and models to control the sentiment of the article. For example, "Xinhua company achieved very good results in a certain year, XYZ platform achieved very poor results, and XYZ company achieved average results." This text is usually marked as neutral; however, neutrality is of little significance for public opinion analysis between businesses. If a company wants to analyze its own public opinion and the public opinion of its competitors, it will not be able to quickly lock in news about its own company or other companies.

[0004] Therefore, there is an urgent need for an intelligent news topic sentiment analysis method, device, electronic device, and computer-readable storage medium based on a subject recognition model. Summary of the invention

[0005] The present invention provides an intelligent news topic sentiment analysis method to solve the problem of inaccurate punctuation addition.

[0006] To achieve the above object, the present invention provides an intelligent news topic sentiment analysis method, comprising:

[0007] The preset extraction and annotation method is used to repeatedly train the preset Bert / Xlnet+CRF subject model through the pre-collected annotated corpus until the accuracy of the Bert / Xlnet+CRF subject model reaches the preset extraction accuracy threshold, and the Bert / Xlnet+CRF subject extraction model updated by the last training is used as the subject extraction model;

[0008] The subject extraction model is linked to the pre-trained subject analysis model to form a subject sentiment analysis model; wherein the training process of the subject analysis model includes: repeatedly training the preset Bert subject model through the sentiment terms of the annotated corpus using a preset analysis annotation method until the accuracy of the Bert subject model reaches a preset analysis accuracy threshold, and using the Bert subject model updated by the last training as the subject analysis model;

[0009] News articles are crawled by a preset crawler software, and data cleaning is performed on the news articles to obtain target data; the target data is input into the subject sentiment analysis model to perform subject extraction operation on the target data through the subject extraction model to obtain the news body, and the news body is input into the subject sentiment analysis model to obtain sentiment analysis data corresponding to the news body.

[0010] Optionally, the method of repeatedly training a preset Bert / Xlnet+CRF subject model using pre-collected annotated corpus using a preset extraction and annotation method includes:

[0011] Performing length statistics on the pre-collected annotated corpus, performing data cleaning on the annotated corpus after statistics to obtain clean corpus, and annotating the clean corpus using a preset extraction and annotation method to obtain annotated corpus; dividing the annotated corpus into a training data set and a validation data set according to a ratio;

[0012] Input the training data set into a pre-built Bert / Xlnet+CRF subject model, so that the Bert / Xlnet+CRF subject model automatically extracts the subject of the training set to obtain the training news subject;

[0013] Comparing the validation set with the training news body to obtain the accuracy and recall of the Bert / Xlnet+CRF body model;

[0014] The Bert / Xlnet+CRF main model is adjusted according to the accuracy and the recall rate to perform continuous and repeated training.

[0015] Optionally, the step of performing data cleaning on the statistically annotated corpus to obtain clean corpus includes:

[0016] Performing expression elimination on the statistically annotated corpus to remove links, tabs, emoticons and unwritten character codes to form clean text;

[0017] The clean texts are all converted into Chinese characters to obtain clean corpus.

[0018] Optionally, the method of repeatedly training a preset Bert subject model by using the sentiment terms of the annotated corpus using a preset analysis and annotation method until the accuracy of the Bert subject model reaches a preset analysis accuracy threshold comprises:

[0019] Pre-build a Bert architecture, limit the Bert input length in the Bert architecture within a limit threshold, and define news parameters and subject parameters of the SegmentEmbeddings subject in the Bert architecture to form a Bert subject model;

[0020] Inputting the training sample into the Bert subject model to form a feature vector;

[0021] Inputting the feature vector into a preset self-attention part for loop processing to form a coding vector;

[0022] Performing dimensionality reduction processing on the encoding vector to form a preset number of target vectors;

[0023] Performing cross entropy calculation on the target vector and the test sample to obtain an accuracy rate;

[0024] Feedback adjustment is performed on the Bert main model according to the accuracy rate to repeatedly train the Bert main model until the accuracy rate of the Bert main model reaches a preset analysis accuracy threshold.

[0025] Optionally, performing cross entropy calculation on the target vector and the test sample to obtain an accuracy rate includes:

[0026] According to a preset cycle round, in each cycle round, the target vector is compared with the test sample to obtain precision and recall, and a cross entropy calculation is performed on the target vector and the test sample to form a cross entropy loss;

[0027] The accuracy of the trained BERT subject model is calculated based on the entropy loss, the precision and the recall.

[0028] Optionally, crawling news articles by using a preset crawler software and performing data cleaning on the news articles to obtain target data includes:

[0029] Crawl news articles on news clients, web pages, and media servers through preset crawler software;

[0030] Performing data cleaning on the news release to obtain target data; wherein the performing data cleaning to obtain target data includes:

[0031] Perform expression elimination on the news release to remove links, tabs, emoticons and unwritten character codes to form clean data;

[0032] The cleaned data are all converted into Chinese characters to obtain target data.

[0033] Optionally, the news body is noun keywords, tone keywords, sentence patterns and grammar in the target data;

[0034] The sentiment analysis data corresponding to the news body includes sentiment summary keywords and sentiment analysis sentences; the sentiment summary keywords are the main sentiments of the target data; and the sentiment analysis sentences are the sentiment introductions of the target data.

[0035] In order to solve the above problems, the present invention also provides an intelligent news topic sentiment analysis device, the device comprising:

[0036] An extraction model building unit is used to repeatedly train a preset Bert / Xlnet+CRF subject model using a preset extraction and annotation method through pre-collected annotated corpus until the accuracy of the Bert / Xlnet+CRF subject model reaches a preset extraction accuracy threshold, and the Bert / Xlnet+CRF subject extraction model updated by the last training is used as the subject extraction model;

[0037] The analysis model establishment unit is used to link the subject extraction model with the pre-trained subject analysis model to form a subject sentiment analysis model; wherein the training process of the subject analysis model includes: repeatedly training the preset Bert subject model through the sentiment terms of the annotated corpus using a preset analysis annotation method until the accuracy of the Bert subject model reaches a preset analysis accuracy threshold, and using the Bert subject model updated by the last training as the subject analysis model;

[0038] A data acquisition unit, used to crawl news articles through a preset crawler software, and perform data cleaning on the news articles to obtain target data;

[0039] The sentiment analysis unit is used to input the target data into the subject sentiment analysis model to perform a subject extraction operation on the target data through the subject extraction model to obtain a news subject, and input the news subject into the subject sentiment analysis model to obtain sentiment analysis data corresponding to the news subject.

[0040] In order to solve the above problem, the present invention further provides an electronic device, the electronic device comprising:

[0041] a memory storing at least one instruction; and

[0042] The processor executes the instructions stored in the memory to implement the steps in the above-mentioned intelligent news topic sentiment analysis method.

[0043] In order to solve the above problems, the present invention also provides a computer-readable storage medium, in which at least one instruction is stored. The at least one instruction is executed by a processor in an electronic device to implement the above-mentioned intelligent news topic sentiment analysis method.

[0044] The embodiment of the present invention firstly adopts a preset extraction and annotation method to repeatedly train a preset Bert / Xlnet+CRF subject model through pre-collected annotation corpus until the accuracy of the Bert / Xlnet+CRF subject model reaches a preset extraction accuracy threshold, and the Bert / Xlnet+CRF subject extraction model updated by the last training is used as the subject extraction model; then adopts a preset analysis and annotation method to repeatedly train the preset Bert subject model through the sentiment terms of the annotation corpus until the accuracy of the Bert subject model reaches a preset analysis accuracy threshold, and the Bert / Xlnet+CRF subject extraction model updated by the last training is used as the subject extraction model; The Bert subject model is used as the subject analysis model, and the subject analysis model is linked to the subject extraction model to form a subject sentiment analysis model; then the news releases are crawled through the preset crawler software, and the news releases are cleaned to obtain the target data; the target data is then input into the subject sentiment analysis model to perform subject extraction operations on the target data through the subject extraction model to obtain the news subject, and the news subject is input into the subject sentiment analysis model to obtain the sentiment analysis data corresponding to the news subject. In this way, the theme emotion and subject emotion of the news can be easily obtained, and then the public opinion of the target enterprise can be obtained according to the entries in various types of news. BRIEF DESCRIPTION OF THE DRAWINGS

[0045] Figure 1 A flowchart of an intelligent news topic sentiment analysis method provided by an embodiment of the present invention;

[0046] Figure 2 A schematic diagram of a module of an intelligent news topic sentiment analysis device provided by an embodiment of the present invention;

[0047] Figure 3 A schematic diagram of the internal structure of an electronic device for an intelligent news topic sentiment analysis method provided by an embodiment of the present invention;

[0048] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0049] It should be understood that the specific embodiments described herein are only used to explain the present invention, and are not used to limit the present invention.

[0050] Based on the development of artificial intelligence, sentiment analysis based on deep learning has been applied to public opinion analysis, product analysis and other fields. Compared with traditional machine learning algorithms such as SVG, deep learning, especially pre-trained models, has higher accuracy, precision and recall. However, both traditional machine learning algorithms and current deep learning solutions are text analysis of a piece of text, but in many cases, it is difficult for both people and models to control the sentiment of the article. For example, "Xinhua company achieved very good results in a certain year, XYZ platform achieved very poor results, and XYZ company achieved average results." This text is usually marked as neutral; however, neutrality is of little significance for public opinion analysis between businesses. If a company wants to analyze its own public opinion and the public opinion of its competitors, it will not be able to quickly lock in news about its own company or other companies.

[0051] To solve the above problems, an embodiment of the present invention provides an intelligent news topic sentiment analysis method.

[0052] In this embodiment, the execution subject is the intelligent news topic sentiment analysis system of the entire server cluster. The intelligent news topic sentiment analysis system is integrated in the server cluster, that is, different modules of the intelligent news topic sentiment analysis system under the server cluster perform different operation steps respectively. Among them, the architecture of the server cluster includes multiple servers, multiple cluster instances run under each server, and multiple scheduled tasks are stored under each cluster instance. In this way, the orderly execution of the scheduled task is achieved through the following steps.

[0053] It should be noted that the embodiments of the present application can acquire and process relevant data based on artificial intelligence technology. Among them, artificial intelligence (AI) is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results.

[0054] like Figure 1 As shown, in this embodiment, the intelligent news topic sentiment analysis method includes:

[0055] S1: repeatedly train the preset Bert / Xlnet+CRF subject model with the pre-collected annotation corpus using the preset extraction and annotation method until the accuracy of the Bert / Xlnet+CRF subject model reaches the preset extraction accuracy threshold, and use the Bert / Xlnet+CRF subject extraction model updated by the last training as the subject extraction model;

[0056] S2: linking the subject extraction model with the pre-trained subject analysis model to form a subject sentiment analysis model; wherein the training process of the subject analysis model includes: repeatedly training the preset Bert subject model through the sentiment terms of the annotated corpus using a preset analysis annotation method until the accuracy of the Bert subject model reaches a preset analysis accuracy threshold, and using the Bert subject model updated by the last training as the subject analysis model;

[0057] S3: crawl news articles through preset crawler software, perform data cleaning on the news articles to obtain target data; input the target data into the subject sentiment analysis model to perform subject extraction operation on the target data through the subject extraction model to obtain the news subject, and input the news subject into the subject sentiment analysis model to obtain sentiment analysis data corresponding to the news subject.

[0058] exist Figure 1 In the embodiment shown, step S1 is a process of repeatedly training a preset Bert / Xlnet+CRF subject model using a preset extraction and annotation method through pre-collected annotated corpus until the accuracy of the Bert / Xlnet+CRF subject model reaches a preset extraction accuracy threshold, and using the Bert / Xlnet+CRF subject extraction model updated by the last training as the subject extraction model; in this process:

[0059] The preset extraction and annotation method is used to repeatedly train the preset Bert / Xlnet+CRF main model through the pre-collected annotated corpus, including:

[0060] S11: Counting the length of the pre-collected annotated corpus, performing data cleaning on the annotated corpus after counting to obtain clean corpus, and annotating the clean corpus using a preset extraction and annotation method to obtain annotated corpus; dividing the annotated corpus into a training data set and a validation data set according to a ratio;

[0061] , S12: input the training data set into the pre-built Bert / Xlnet+CRF subject model, so that the Bert / Xlnet+CRF subject model automatically extracts the subject of the training set to obtain the training news subject;

[0062] S13: Compare the validation set with the training news body to obtain the accuracy and recall of the Bert / Xlnet+CRF body model;

[0063] S14: adjusting the Bert / Xlnet+CRF main model according to the accuracy and the recall rate for continuous and repeated training.

[0064] The step of performing data cleaning on the statistically annotated corpus to obtain clean corpus includes:

[0065] Performing expression elimination on the statistically annotated corpus to remove links, tabs, emoticons and unwritten character codes to form clean text;

[0066] The clean texts are all converted into Chinese characters to obtain clean corpus.

[0067] In a specific embodiment, the subject extraction model aims to extract the emotional subject in the news. Therefore, a preset extraction and annotation method is used, and the preset extraction and annotation method is the BIO annotation method; wherein B stands for begin, which means the beginning of the subject; I stands for inside, which means the middle of the subject; and O stands for outside, which means it does not belong to the subject. The details are as follows:

[0068] {"text":"XXX enterprise achieved very good results in 2021, XXX platform achieved very poor results, and XXX company achieved average results.","label":{"sentiment":{"XXX enterprise":[[0,3]],"XXX platform":[[20,25]],"XXX company":[[36,40]]}}}

[0069] The final converted training data is ["B-sentiment","I-sentiment","I-sentiment","I-sentiment","O","O","O","O","O","O" ,"O","O","O","O","O","O","O","O","O","O","B-sentiment","I-sentiment","I-sentiment","I-senti ment","I-sentiment","I-sentiment","O","O","O","O","O","O","O","O","O","O","B-sentiment","I -sentiment","I-sentiment","I-sentiment","I-sentiment","O","O","O","O","O","O","O","O","O"];

[0070] In a more specific embodiment, the specific process of training the Bert / Xlnet+CRF main model is:

[0071] First, 30,000 data were collected by article category (entertainment, sports, finance, technology, society, automobiles, etc.), and the length threshold of the training news articles was calculated. The articles with the minimum length accounting for 5% and the maximum length accounting for 5% were deleted, and then the data was cleaned, that is, [snickering], tab characters, uncode encoding, URL, emoji, links, unicode encoding, etc. were removed, and then the traditional Chinese or English was converted into simplified Chinese; then the cleaned data was manually annotated, and the main body of the news was annotated, and then the Bert / Xlnet+CRF main body extraction model was trained based on the annotated corpus. The training data was first divided into training data, verification data, and test data according to 8:1:1, and repeated training was performed. The loss was calculated by cross entropy according to the label, and the data was verified once every 100 cycles through the verification set. The accuracy, precision, recall rate of the verification set, and the loss of the verification set were obtained, and the loss value was recorded. The model parameters with the lowest loss in each validation set are retained every 100 rounds. After the training is completed, the performance, accuracy, precision, recall rate, and generalization ability of the model are tested on the test set. If the model does not meet the standards, the corpus with errors is analyzed and judged, the corpus is adjusted, and the model is trained again with the corpus. If the model meets the standards, the training is stopped and the Bert / Xlnet+CRF subject extraction model trained for the last time is used as the subject extraction model.

[0072] exist Figure 1 In the embodiment shown, step S2 is a process of repeatedly training a preset Bert subject model through the sentiment terms of the annotated corpus using a preset analysis and annotation method until the accuracy of the Bert subject model reaches a preset analysis accuracy threshold, using the Bert subject model updated by the last training as the subject analysis model, and linking the subject analysis model with the subject extraction model to form a subject sentiment analysis model; wherein,

[0073] The preset analysis and annotation method is used to repeatedly train the preset Bert subject model through the sentiment terms of the annotated corpus until the accuracy of the Bert subject model reaches a preset analysis accuracy threshold, including:

[0074] S21: pre-build a Bert architecture, limit the Bert input length in the Bert architecture within a limit threshold, and define news parameters and subject parameters of the SegmentEmbeddings subject in the Bert architecture to form a Bert subject model;

[0075] S22: using a preset analysis and annotation method to perform sentiment analysis annotation on the annotated corpus to form sample data, dividing the sample data into training samples and test samples according to a ratio, and inputting the training samples into the Bert subject model to form a feature vector; wherein the sentiment analysis annotation includes at least sentiment analysis words;

[0076] S23: inputting the feature vector into a preset self-attention part for loop processing to form a coding vector;

[0077] S24: performing dimensionality reduction processing on the encoding vector to form a preset number of target vectors;

[0078] S25: performing cross entropy calculation based on the target vector and the test sample to obtain an accuracy rate;

[0079] S26: Feedback adjustment is performed on the Bert main model according to the accuracy rate to repeatedly train the Bert main model until the accuracy rate of the Bert main model reaches a preset analysis accuracy threshold.

[0080] Performing cross entropy calculation on the target vector and the test sample to obtain an accuracy rate includes:

[0081] According to a preset cycle round, in each cycle round, the target vector is compared with the test sample to obtain precision and recall, and a cross entropy calculation is performed on the target vector and the test sample to form a cross entropy loss;

[0082] The accuracy of the trained BERT subject model is calculated based on the entropy loss, the precision and the recall.

[0083] Specifically, in one embodiment, the annotated corpus is designed as follows: 0 represents neutral, 1 represents positive, and 2 represents negative;

[0084] {"text":"[CLS]XXX Enterprise [SEP]XXX Enterprise achieved very good results in 2021, XXX platform achieved very poor results, and XXX company achieved average results.","label":"1"};

[0085] {,"text":"[CLS]XXX platform [SEP]XXX enterprise achieved very good results in 2021, XXX platform achieved very poor results, and XXX company achieved average results.","label":"2"};

[0086] {"text":"[CLS] XXXX Company [SEP] XXXX Enterprise achieved very good results in 2021, XXXX Platform achieved very poor results, and XXXX Company achieved average results.","label":"0"};

[0087] The specific process of training the Bert main model is:

[0088] Use the corpus of the subject to annotate the subject-based sentiment analysis corpus;

[0089] Expand the corpus, that is, to make the corpus balanced. Let the model learn that different subjects have different emotions in the same article. We hope that there will be more corpora with different emotions in the same article. Therefore, articles of the same category (such as stocks) with different emotions can be randomly spliced. The specific examples are as follows:

[0090] Article 1

[0091] A certain company's net profit in the first quarter of fiscal year 2022 was US$34.63 billion, a year-on-year increase of 20%. By region, the company's revenue in the Americas in the first quarter was US$51.496 billion, a year-on-year increase of 11%; the European department's revenue was US$29.749 billion, a year-on-year increase of 9%; the Greater China region's revenue was US$25.783 billion, a year-on-year increase of 21%; the revenue of other Asia-Pacific regions was US$9.81 billion, a year-on-year increase of 19%. By product, the company's revenue from iPhone in the first quarter was US$71.628 billion, a year-on-year increase of 9%; the revenue from Mac was US$10.852 billion, a year-on-year increase of 25%;

[0092] Article 2

[0093] Fubon Property & Casualty Insurance was fined 200,000 yuan for refusing and delaying the insurance of vehicles. On February 8, a certain platform published a public administrative penalty information table showing that a certain company was fined 150,000 yuan for refusing and delaying the insurance of vehicles. The Insurance Regulatory Bureau of a certain platform imposed a warning and a fine of 50,000 yuan on ×× for refusing and delaying the insurance of vehicles. The company and individuals were fined 200,000 yuan in total. (Editor: XXX)

[0094] After splicing:

[0095] A certain company's net profit in the first quarter of fiscal year 2022 was US$34.63 billion, a year-on-year increase of 20%. By region, the company's revenue in the Americas in the first quarter was US$51.496 billion, a year-on-year increase of 11%; the European department's revenue was US$29.749 billion, a year-on-year increase of 9%; the Greater China region's revenue was US$25.783 billion, a year-on-year increase of 21%; the revenue of other Asia-Pacific regions was US$9.81 billion, a year-on-year increase of 19%. By product, the company's revenue from Phone in the first quarter was US$71.628 billion, a year-on-year increase of 9%; the revenue from tablets was US$10.852 billion, a year-on-year increase of 25%; Fubon Property & Casualty Insurance was fined a total of 200,000 yuan for refusing and delaying the underwriting of compulsory motor vehicle traffic insurance. On February 8, a certain platform published the Xiamen Banking and Insurance Regulatory Bureau's administrative penalty information disclosure table, showing that a certain company (hereinafter referred to as "Fubon Property and Casualty Insurance") was fined 150,000 yuan for refusing and delaying the insurance of compulsory traffic insurance for vehicles. The platform imposed a warning and a fine of 50,000 yuan on ×× in accordance with Articles 161 and 171 of the Insurance Law of the People's Republic of China. The company and individuals were fined a total of 200,000 yuan. (Editor: XXX)

[0096] Among them, the main sentiment of a certain company is positive 1. The main sentiment of a certain limited company is 2.

[0097] More specifically, when training the BERT main model, it is first divided into training samples, verification samples, and test samples at a ratio of 8:1:1, where the neutral, positive, and negative data between each sample are kept as 1:1:1 as possible; then the length of the BERT input is limited to 512; where the SegmentEmbeddings main segment is 0, and the news segment is 1, so that the model can distinguish which input data is the main segment and which is the news. Then in a specific embodiment, the input feature vector is obtained and cyclic self-attention is performed to obtain a coding vector of 512, and then the coding vector of [CLS] is removed, and a fully connected layer is performed. The coding vector of BERT is 768-dimensional. In order to convert it into a 3-classification problem, the 768 dimension is reduced to 3 dimensions; that is, the coding vector of [CLS] is reduced to 3 dimensions; it is converted into a 3-classification probability problem through softmax; and then the loss is calculated according to the label through cross entropy, where the data is verified once every 100 cycles through the verification set to obtain the accuracy, precision, recall rate, and The loss of the validation set is recorded, and the model parameters with the lowest loss of each validation set are retained every 100 rounds; after the training is completed, the performance, accuracy, precision, recall rate, and generalization ability of the model are tested through the test set; if the model does not meet the standards, first analyze and judge the wrong corpus, such as adding corpus of a certain category, etc., and then train the model through the corpus, and repeat the training until the accuracy of the Bert subject model reaches the preset analysis accuracy threshold, and the Bert subject model updated by the last training is used as the subject analysis model; then the subject analysis model is connected with the subject extraction model to form a complete subject sentiment analysis model.

[0098] exist Figure 1 In the illustrated embodiment, step S3 is a process of crawling news articles through a preset crawler software, performing data cleaning on the news articles to obtain target data, inputting the target data into a subject sentiment analysis model to perform subject extraction operation on the target data through a subject extraction model to obtain a news subject, and inputting the news subject into the subject sentiment analysis model to obtain sentiment analysis data corresponding to the news subject; wherein crawling news articles through a preset crawler software, performing data cleaning on the news articles to obtain target data, includes:

[0099] S31: crawling news articles on a news client, a web page, and a media server through a preset crawler software;

[0100] S32: performing data cleaning on the news release to obtain target data; wherein the data cleaning to obtain target data includes:

[0101] S33: performing expression elimination on the news article to remove links, tabs, emoticons and unwritten character codes to form clean data;

[0102] S34: Convert all the clean data into Chinese characters to obtain target data.

[0103] The specific form of the crawler is not limited and can be any component or plug-in with crawler function.

[0104] In the process of inputting the target data into the subject sentiment analysis model to perform subject extraction operation on the target data through the subject extraction model to obtain the news subject, and inputting the news subject into the subject sentiment analysis model to obtain sentiment analysis data corresponding to the news subject, the subject sentiment analysis model is a combination of the subject extraction model and the subject analysis model, and the news subject is the noun keywords, mood keywords, sentence patterns and grammar in the target data;

[0105] The sentiment analysis data corresponding to the news subject includes sentiment summary keywords and sentiment analysis sentences; the sentiment summary keywords are the main sentiments of the target data; the sentiment summary keywords are, for example, "positive", "negative", and "neutral", and the sentiment analysis sentences are the sentiment introduction of the target data, such as a descriptive text, a certain company has positive public opinion... In this way, the public opinion of the company or the other company can be grasped conveniently, accurately, and quickly.

[0106] In this embodiment, the server can be an independent server or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDN), and big data and artificial intelligence platforms.

[0107] As described above, the intelligent news topic sentiment analysis method provided by the embodiment of the present invention first uses a preset extraction and annotation method to repeatedly train the preset Bert / Xlnet+CRF subject model through the pre-collected annotation corpus until the accuracy of the Bert / Xlnet+CRF subject model reaches the preset extraction accuracy threshold, and the Bert / Xlnet+CRF subject extraction model updated by the last training is used as the subject extraction model; then the preset analysis and annotation method is used to repeatedly train the preset Bert subject model through the sentiment terms of the annotation corpus until the accuracy of the Bert subject model reaches the preset analysis accuracy threshold , the Bert subject model updated by the last training is used as the subject analysis model, and the subject analysis model is linked to the subject extraction model to form a subject sentiment analysis model; then the news articles are crawled through the preset crawler software, and the news articles are cleaned to obtain the target data; the target data is then input into the subject sentiment analysis model to perform subject extraction operation on the target data through the subject extraction model to obtain the news subject, and the news subject is input into the subject sentiment analysis model to obtain the sentiment analysis data corresponding to the news subject. In this way, the theme emotion and subject emotion of the news can be easily obtained, and then the public opinion of the target enterprise can be obtained according to the entries in various types of news.

[0108] like Figure 2 As shown, the present invention provides an intelligent news topic sentiment analysis device 100, which can be installed in an electronic device. According to the functions to be implemented, the intelligent news topic sentiment analysis device 100 may include an extraction model building unit 101, an analysis model building unit 102, a data acquisition unit 103, and a sentiment analysis unit 104. The module described in the present invention can also be referred to as a unit, which refers to a series of computer program segments that can be executed by an electronic device processor and can complete fixed functions, which are stored in the memory of the electronic device.

[0109] In this embodiment, the functions of each module / unit are as follows:

[0110] The extraction model building unit 101 is used to repeatedly train the preset Bert / Xlnet+CRF subject model through the pre-collected annotation corpus using a preset extraction and annotation method until the accuracy of the Bert / Xlnet+CRF subject model reaches a preset extraction accuracy threshold, and the Bert / Xlnet+CRF subject extraction model updated by the last training is used as the subject extraction model;

[0111] The analysis model establishment unit 102 is used to link the subject extraction model with the pre-trained subject analysis model to form a subject sentiment analysis model; wherein the training process of the subject analysis model includes: repeatedly training the preset Bert subject model through the sentiment terms of the annotated corpus using a preset analysis annotation method until the accuracy of the Bert subject model reaches a preset analysis accuracy threshold, and using the Bert subject model updated by the last training as the subject analysis model;

[0112] The data acquisition unit 103 is used to crawl news articles through a preset crawler software, and perform data cleaning on the news articles to obtain target data;

[0113] The sentiment analysis unit 104 is used to input the target data into the subject sentiment analysis model to perform a subject extraction operation on the target data through the subject extraction model to obtain a news subject, and input the news subject into the subject sentiment analysis model to obtain sentiment analysis data corresponding to the news subject.

[0114] The extraction model building unit 101 uses a preset extraction and annotation method to repeatedly train the preset Bert / Xlnet+CRF subject model through the pre-collected annotation corpus until the accuracy of the Bert / Xlnet+CRF subject model reaches a preset extraction accuracy threshold, and the Bert / Xlnet+CRF subject extraction model updated by the last training is used as the subject extraction model;

[0115] The preset extraction and annotation method is used to repeatedly train the preset Bert / Xlnet+CRF main model through the pre-collected annotated corpus, including:

[0116] Pre-built Bert / Xlnet+CRF main model;

[0117] The length of the pre-collected annotated corpus is counted, the annotated corpus after statistics is cleaned to obtain clean corpus, and the clean corpus is annotated by a preset extraction and annotation method to obtain annotated corpus; the annotated corpus is divided into a training data set and a validation data set according to a proportion; wherein the training data set is used to input into the Bert / Xlnet+CRF subject model, so that the Bert / Xlnet+CRF subject model automatically extracts the subject from the training set to obtain the training news subject; the validation set is used to compare with the training news subject to obtain the accuracy and recall rate of the Bert / Xlnet+CRF subject model;

[0118] The Bert / Xlnet+CRF main model is adjusted according to the accuracy and the recall rate to perform continuous and repeated training.

[0119] The analysis model building unit 102 is used to repeatedly train the preset Bert subject model through the sentiment terms of the annotated corpus using a preset analysis annotation method until the accuracy of the Bert subject model reaches a preset analysis accuracy threshold, and use the Bert subject model updated by the last training as the subject analysis model, and link the subject analysis model with the subject extraction model to form a subject sentiment analysis model;

[0120] The preset analysis and annotation method is used to repeatedly train the preset Bert subject model through the sentiment terms of the annotated corpus until the accuracy of the Bert subject model reaches a preset analysis accuracy threshold, including:

[0121] Pre-build a Bert architecture, limit the Bert input length in the Bert architecture within a limit threshold, and define news parameters and subject parameters of the SegmentEmbeddings subject in the Bert architecture to form a Bert subject model;

[0122] Using a preset analysis and annotation method to perform sentiment analysis annotation on the annotated corpus to form sample data, dividing the sample data into training samples and test samples according to a ratio, and inputting the training samples into the Bert subject model to form a feature vector; wherein the sentiment analysis annotation includes at least sentiment analysis words;

[0123] Input the feature vector into a preset self-attention part for loop processing to form a coding vector;

[0124] Performing dimensionality reduction processing on the encoding vector to form a preset number of target vectors;

[0125] Performing cross entropy calculation on the target vector and the test sample to obtain an accuracy rate;

[0126] Feedback adjustment is performed on the Bert main model according to the accuracy rate to repeatedly train the Bert main model until the accuracy rate of the Bert main model reaches a preset analysis accuracy threshold.

[0127] The data acquisition unit 103 crawls news articles through the preset crawler software and performs data cleaning on the news articles to obtain target data;

[0128] Crawling news articles through the preset crawler software, and performing data cleaning on the news articles to obtain target data, including:

[0129] Crawl news articles on news clients, web pages, and media servers through preset crawler software;

[0130] Performing data cleaning on the news release to obtain target data; wherein the performing data cleaning to obtain target data includes:

[0131] Perform expression elimination on the news release to remove links, tabs, emoticons and unwritten character codes to form clean data;

[0132] The cleaned data are all converted into Chinese characters to obtain target data.

[0133] The sentiment analysis unit 104 inputs the target data into the subject sentiment analysis model to perform a subject extraction operation on the target data through the subject extraction model to obtain a news subject, and inputs the news subject into the subject sentiment analysis model to obtain sentiment analysis data corresponding to the news subject;

[0134] The news body is the noun keywords, tone keywords, sentence patterns and grammar in the target data;

[0135] The sentiment analysis data corresponding to the news subject includes sentiment summary keywords and sentiment analysis sentences; the sentiment summary keywords are the subject sentiments of the target data; and the sentiment analysis sentences are the sentiment introductions of the target data.

[0136] As described above, the intelligent news topic sentiment analysis device 100 provided by the present invention first uses the extraction model building unit 101 to repeatedly train the preset Bert / Xlnet+CRF subject model through the pre-collected annotation corpus using the preset extraction and annotation method until the accuracy of the Bert / Xlnet+CRF subject model reaches the preset extraction accuracy threshold, and the Bert / Xlnet+CRF subject extraction model updated by the last training is used as the subject extraction model; then the analysis model building unit 102 uses the preset analysis and annotation method to repeatedly train the preset Bert subject model through the sentiment terms of the annotation corpus until the accuracy of the Bert subject model reaches the preset analysis accuracy threshold. Threshold, the Bert subject model updated by the last training is used as the subject analysis model, and the subject analysis model is linked to the subject extraction model to form a subject sentiment analysis model; then the data acquisition unit 103 is used to crawl news articles through the preset crawler software, and the news articles are cleaned to obtain the target data; the sentiment analysis unit 104 is used to input the target data into the subject sentiment analysis model to perform subject extraction operation on the target data through the subject extraction model to obtain the news subject, and the news subject is input into the subject sentiment analysis model to obtain the sentiment analysis data corresponding to the news subject. In this way, the theme emotion and subject emotion of the news can be easily obtained, and then the public opinion of the target enterprise can be obtained according to the entries in various types of news.

[0137] like Figure 3 As shown, the present invention provides an electronic device 1 for an intelligent news topic sentiment analysis method.

[0138] The electronic device 1 may include a processor 10, a memory 11 and a bus, and may also include a computer program stored in the memory 11 and executable on the processor 10, such as an intelligent news topic sentiment analysis program 12.

[0139] Among them, the memory 11 includes at least one type of readable storage medium, and the readable storage medium includes flash memory, mobile hard disk, multimedia card, card-type memory (for example: SD or DX memory, etc.), magnetic memory, disk, optical disk, etc. The memory 11 can be an internal storage unit of the electronic device 1 in some embodiments, such as a mobile hard disk of the electronic device 1. The memory 11 can also be an external storage device of the electronic device 1 in other embodiments, such as a plug-in mobile hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (SecureDigital, SD) card, a flash card (Flash Card), etc. equipped on the electronic device 1. Further, the memory 11 can also include both an internal storage unit of the electronic device 1 and an external storage device. The memory 11 can not only be used to store application software and various types of data installed in the electronic device 1, such as the code of intelligent news topic sentiment analysis, etc., but also can be used to temporarily store data that has been output or is to be output.

[0140] The processor 10 may be composed of an integrated circuit in some embodiments, for example, a single packaged integrated circuit, or a plurality of packaged integrated circuits with the same or different functions, including one or more central processing units (CPUs), microprocessors, digital processing chips, graphics processors, and combinations of various control chips, etc. The processor 10 is the control core (Control Unit) of the electronic device, and uses various interfaces and lines to connect various components of the entire electronic device, and executes or executes programs or modules (such as intelligent news topic sentiment analysis programs, etc.) stored in the memory 11, and calls data stored in the memory 11 to execute various functions of the electronic device 1 and process data.

[0141] The bus may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. The bus is configured to realize connection and communication between the memory 11 and at least one processor 10, etc.

[0142] Figure 3 Only an electronic device with components is shown, and those skilled in the art will understand that Figure 3 The structure shown does not constitute a limitation on the electronic device 1, and may include fewer or more components than shown in the figure, or combine certain components, or arrange the components differently.

[0143] For example, although not shown, the electronic device 1 may also include a power source (such as a battery) for supplying power to each component. Preferably, the power source may be logically connected to the at least one processor 10 through a power management device, so that the power management device can realize functions such as charging management, discharging management, and power consumption management. The power source may also include any components such as one or more DC or AC power sources, recharging devices, power failure detection circuits, power converters or inverters, power status indicators, etc. The electronic device 1 may also include a variety of sensors, Bluetooth modules, Wi-Fi modules, etc., which will not be repeated here.

[0144] Furthermore, the electronic device 1 may also include a network interface. Optionally, the network interface may include a wired interface and / or a wireless interface (such as a WI-FI interface, a Bluetooth interface, etc.), which is generally used to establish a communication connection between the electronic device 1 and other electronic devices.

[0145] Optionally, the electronic device 1 may further include a user interface, which may be a display, an input unit (such as a keyboard), or a standard wired interface or a wireless interface. Optionally, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, and an OLED (Organic Light-Emitting Diode) touch device. The display may also be appropriately referred to as a display screen or a display unit, which is used to display information processed in the electronic device 1 and to display a visual user interface.

[0146] It should be understood that the embodiment is for illustration only and the scope of the patent application is not limited to this structure.

[0147] The intelligent news topic sentiment analysis program 12 stored in the memory 11 in the electronic device 1 is a combination of multiple instructions. When running in the processor 10, it can achieve:

[0148] The preset extraction and annotation method is used to repeatedly train the preset Bert / Xlnet+CRF subject model through the pre-collected annotated corpus until the accuracy of the Bert / Xlnet+CRF subject model reaches the preset extraction accuracy threshold, and the Bert / Xlnet+CRF subject extraction model updated by the last training is used as the subject extraction model;

[0149] The preset Bert subject model is repeatedly trained by using the sentiment terms of the annotated corpus using a preset analysis and annotation method until the accuracy of the Bert subject model reaches a preset analysis accuracy threshold, the Bert subject model updated by the last training is used as the subject analysis model, and the subject analysis model is linked to the subject extraction model to form a subject sentiment analysis model;

[0150] Crawl news articles through preset crawler software, and perform data cleaning on the news articles to obtain target data;

[0151] The target data is input into the subject sentiment analysis model to perform a subject extraction operation on the target data through the subject extraction model to obtain a news subject, and the news subject is input into the subject sentiment analysis model to obtain sentiment analysis data corresponding to the news subject.

[0152] It should be emphasized that in order to further ensure the privacy and security of the above-mentioned intelligent news topic sentiment analysis, the data of the above-mentioned intelligent news topic sentiment analysis is stored in the node of the blockchain where this server cluster is located.

[0153] The server can be a stand-alone server or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDN), as well as big data and artificial intelligence platforms.

[0154] Furthermore, if the module / unit integrated in the electronic device 1 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. The computer-readable medium may include: any entity or device capable of carrying the computer program code, a recording medium, a USB flash drive, a mobile hard disk, a magnetic disk, an optical disk, a computer memory, and a read-only memory (ROM).

[0155] An embodiment of the present invention further provides a computer-readable storage medium, which may be non-volatile or volatile, and stores a computer program, which, when executed by a processor, implements:

[0156] The preset extraction and annotation method is used to repeatedly train the preset Bert / Xlnet+CRF subject model through the pre-collected annotated corpus until the accuracy of the Bert / Xlnet+CRF subject model reaches the preset extraction accuracy threshold, and the Bert / Xlnet+CRF subject extraction model updated by the last training is used as the subject extraction model;

[0157] The preset Bert subject model is repeatedly trained by using the sentiment terms of the annotated corpus using a preset analysis and annotation method until the accuracy of the Bert subject model reaches a preset analysis accuracy threshold, the Bert subject model updated by the last training is used as the subject analysis model, and the subject analysis model is linked to the subject extraction model to form a subject sentiment analysis model;

[0158] Crawl news articles through preset crawler software, and perform data cleaning on the news articles to obtain target data;

[0159] The target data is input into the subject sentiment analysis model to perform a subject extraction operation on the target data through the subject extraction model to obtain a news subject, and the news subject is input into the subject sentiment analysis model to obtain sentiment analysis data corresponding to the news subject.

[0160] Specifically, the specific implementation method when the computer program is executed by the processor can refer to the description of the relevant steps in the intelligent news topic sentiment analysis method in the embodiment, which will not be repeated here.

[0161] In the several embodiments provided by the present invention, it should be understood that the disclosed devices, apparatuses and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of the modules is only a logical function division, and there may be other division methods in actual implementation.

[0162] The modules described as separate components may or may not be physically separated, and the components shown as modules 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 modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0163] In addition, each functional module in each embodiment of the present invention may be integrated into one processing unit, 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 hardware plus software functional modules.

[0164] It is obvious to those skilled in the art that the present invention is not limited to the details of the above exemplary embodiments, and that the present invention can be implemented in other specific forms without departing from the spirit or essential characteristics of the present invention.

[0165] Therefore, no matter from which point of view, the embodiments should be regarded as illustrative and non-restrictive, and the scope of the present invention is limited by the appended claims rather than the above description, so it is intended that all changes falling within the meaning and scope of the equivalent elements of the claims are included in the present invention. Any attached figure mark in the claims should not be regarded as limiting the claims involved.

[0166] The blockchain referred to in this invention is a new application mode of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanism, encryption algorithm, etc. Blockchain is essentially a decentralized database, a string of data blocks generated by cryptographic methods. Each data block contains a batch of network transaction information, which is used to verify the validity of its information (anti-counterfeiting) and generate the next block. Blockchain can include the underlying blockchain platform, platform product service layer, and application service layer.

[0167] In addition, it is clear that the word "comprising" does not exclude other units or steps, and the singular does not exclude the plural. Multiple units or devices stated in the system claim can also be implemented by one unit or device through software or hardware. The second and other words are used to indicate names, but not to indicate any particular order.

[0168] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solution of the present invention can be modified or replaced by equivalents without departing from the spirit and scope of the technical solution of the present invention.

Claims

1. An intelligent news topic sentiment analysis method, characterized in that: include: The preset Bert / Xlnet+CRF subject model is repeatedly trained by using the pre-collected annotated corpus using the preset extraction and annotation method until the accuracy of the Bert / Xlnet+CRF subject model reaches the preset extraction accuracy threshold, and the Bert / Xlnet+CRF subject extraction model updated by the last training is used as the subject extraction model; wherein the preset extraction and annotation method is used to repeatedly train the preset Bert / Xlnet+CRF subject model by using the pre-collected annotated corpus, including: Pre-built Bert / Xlnet+CRF main model; Performing length statistics on the pre-collected annotated corpus, performing data cleaning on the annotated corpus after statistics to obtain clean corpus, and annotating the clean corpus using a preset extraction and annotation method to obtain annotated corpus; dividing the annotated corpus into a training data set and a validation data set according to a ratio; Input the training data set into a pre-built Bert / Xlnet+CRF subject model, so that the Bert / Xlnet+CRF subject model automatically extracts the subject of the training data set to obtain the training news subject; Compare the validation data set with the training news body to obtain the accuracy and recall of the Bert / Xlnet+CRF body model; Adjusting the Bert / Xlnet+CRF main model according to the accuracy and the recall rate to perform continuous and repeated training; The subject extraction model is linked to the pre-trained subject analysis model to form a subject sentiment analysis model; wherein the training process of the subject analysis model includes: repeatedly training the preset Bert subject model through the sentiment terms of the annotated corpus using a preset analysis annotation method until the accuracy of the Bert subject model reaches a preset analysis accuracy threshold, and using the Bert subject model updated by the last training as the subject analysis model; News articles are crawled by a preset crawler software, and data cleaning is performed on the news articles to obtain target data; the target data is input into the subject sentiment analysis model, and a subject extraction operation is performed on the target data through the subject extraction model to obtain the news subject, and the news subject is input into the subject sentiment analysis model to obtain sentiment analysis data corresponding to the news subject.

2. The intelligent news topic sentiment analysis method according to claim 1, characterized in that: The step of performing data cleaning on the statistically annotated corpus to obtain clean corpus includes: Performing expression elimination on the statistically annotated corpus to remove links, tabs, emoticons and unwritten character codes to form clean text; The clean texts are all converted into Chinese characters to obtain clean corpus.

3. The intelligent news topic sentiment analysis method according to claim 2, characterized in that: The method of repeatedly training the preset Bert subject model by using the sentiment terms of the annotated corpus using the preset analysis and annotation method until the accuracy of the Bert subject model reaches a preset analysis accuracy threshold includes: Pre-build a Bert architecture, limit the Bert input length in the Bert architecture within a limit threshold, and define news parameters and subject parameters of the SegmentEmbeddings subject in the Bert architecture to form a Bert subject model; Inputting the training sample into the Bert subject model to form a feature vector; Inputting the feature vector into a preset self-attention part for loop processing to form a coding vector; Performing dimensionality reduction processing on the encoding vector to form a preset number of target vectors; Performing cross entropy calculation on the target vector and the test sample to obtain the accuracy; Feedback adjustment is performed on the Bert main model according to the accuracy rate to repeatedly train the Bert main model until the accuracy rate of the Bert main model reaches a preset analysis accuracy threshold.

4. The intelligent news topic sentiment analysis method according to claim 3, characterized in that: The step of performing cross entropy calculation on the target vector and the test sample to obtain the accuracy rate includes: According to a preset cycle round, in each cycle round, the target vector is compared with the test sample to obtain precision and recall, and a cross entropy calculation is performed on the target vector and the test sample to form a cross entropy loss; The accuracy of the trained BERT subject model is calculated based on the entropy loss, the precision and the recall.

5. The intelligent news topic sentiment analysis method according to claim 4, characterized in that: The method of crawling news articles by using a preset crawler software and performing data cleaning on the news articles to obtain target data includes: Crawl news articles on news clients, web pages, and media servers through preset crawler software; Performing data cleaning on the news release to obtain target data; wherein the performing data cleaning to obtain target data includes: Perform expression elimination on the news release to remove links, tabs, emoticons and unwritten character codes to form clean data; The cleaned data are all converted into Chinese characters to obtain target data.

6. The intelligent news topic sentiment analysis method according to claim 5, characterized in that: The news body is the noun keywords, tone keywords, sentence patterns and grammar in the target data; The sentiment analysis data corresponding to the news body includes sentiment summary keywords and sentiment analysis sentences; the sentiment summary keywords are the main sentiments of the target data; and the sentiment analysis sentences are the sentiment introductions of the target data.

7. An intelligent news topic sentiment analysis device, characterized in that: The device comprises: The extraction model establishment unit is used to repeatedly train the preset Bert / Xlnet+CRF subject model through the pre-collected annotated corpus using the preset extraction and annotation method until the accuracy of the Bert / Xlnet+CRF subject model reaches the preset extraction accuracy threshold, and the Bert / Xlnet+CRF subject extraction model updated by the last training is used as the subject extraction model; wherein the repeatedly training the preset Bert / Xlnet+CRF subject model through the pre-collected annotated corpus using the preset extraction and annotation method includes: Pre-built Bert / Xlnet+CRF main model; Performing length statistics on the pre-collected annotated corpus, performing data cleaning on the annotated corpus after statistics to obtain clean corpus, and annotating the clean corpus using a preset extraction and annotation method to obtain annotated corpus; dividing the annotated corpus into a training data set and a validation data set according to a ratio; Input the training data set into a pre-built Bert / Xlnet+CRF subject model, so that the Bert / Xlnet+CRF subject model automatically extracts the subject of the training data set to obtain the training news subject; Compare the validation data set with the training news body to obtain the accuracy and recall of the Bert / Xlnet+CRF body model; Adjusting the Bert / Xlnet+CRF main model according to the accuracy and the recall rate to perform continuous and repeated training; The analysis model establishment unit is used to link the subject extraction model with the pre-trained subject analysis model to form a subject sentiment analysis model; wherein the training process of the subject analysis model includes: repeatedly training the preset Bert subject model through the sentiment terms of the annotated corpus using a preset analysis annotation method until the accuracy of the Bert subject model reaches a preset analysis accuracy threshold, and using the Bert subject model updated by the last training as the subject analysis model; A data acquisition unit, used to crawl news articles through a preset crawler software, and perform data cleaning on the news articles to obtain target data; The sentiment analysis unit is used to input the target data into the subject sentiment analysis model to perform a subject extraction operation on the target data through the subject extraction model to obtain a news subject, and input the news subject into the subject sentiment analysis model to obtain sentiment analysis data corresponding to the news subject.

8. An electronic device, characterized in that: The electronic device comprises: at least one processor; and, a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program that can be executed by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the steps in the intelligent news topic sentiment analysis method as described in any one of claims 1 to 6.

9. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the intelligent news topic sentiment analysis method as described in any one of claims 1 to 6 is implemented.

Citation Information

Patent Citations

  • Event sentiment analysis method and device, server and storage medium

    CN111414754A

  • Comment target emotion analysis based on BERT fine adjustment model

    CN111950296A

  • Text sentiment analyzing method, apparatus and storage medium

    WO2019214145A1