Polarity detection method for bad news text based on hierarchical network

Through the polarity detection method of bad news text based on hierarchical network, the problems of insufficient control of sentence units and implicit bad tendencies in external knowledge in the existing technology are solved, and the accurate detection of polarity tendencies of news texts is achieved, and the news dissemination effect and national image shaping are optimized.

CN119557451AActive Publication Date: 2025-03-04GUANGZHOU DINGHANG INTELLECTUAL PROPERTY SERVICES CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202411802712.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-09
Publication Date
2025-03-04
Estimated Expiration
2044-12-09

AI Technical Summary

Technical Problem

Existing news bad tendency text detection algorithms lack control over sentence units, and external knowledge itself implies bad tendencies, making it difficult to effectively detect bad tendencies in long texts.

Method used

The polarity detection method of bad news text based on hierarchical network is adopted, and the multi-level network structure and feature fusion strategy is used to realize multi-faceted feature analysis and importance sorting of news texts, thereby detecting the polarity tendency of news texts.

Benefits of technology

This method can effectively judge the polarity tendency of news texts, optimize the news dissemination effect, help control the release of bad news texts, and improve the effect of national image shaping.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119557451A_ABST
    Figure CN119557451A_ABST
Patent Text Reader

Abstract

The invention discloses a bad news text polarity detection method based on a hierarchical network, and relates to the field of bad news text detection, and the method comprises the following operation steps: S1, collecting news texts of a plurality of channels to form a data set; s2, data preprocessing; s3, text embedding; s4, inputting the embedded text feature vector into a sentence scoring module; s5, inputting the new text feature vector and the sentence score into a tree hierarchical structure module; s6, inputting the news of the tree-type hierarchical structure into a feature fusion module; and S7, inputting the fused high-dimensional feature vector of the tree-type hierarchical structure into a text content tendency detection module. The bad news text polarity detection method based on the hierarchical network provided by the invention can be used for detecting and screening the content tendency of the news text in news text release, is helpful for managing and controlling the release of the bad news text, optimizing the news transmission effect, optimizing the national image shaping and the like, and has important significance.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of bad news text detection, and in particular to a bad news text polarity detection method based on a hierarchical network. Background Art

[0002] In order to optimize the effect of news dissemination and achieve accurate dissemination, it is often necessary to detect the negative tendencies implicit in news texts. However, the existing algorithms for detecting negative tendencies in news texts still have many shortcomings. For example, most of them perform contextual understanding and text analysis on the full text but lack control over sentence units; external knowledge is injected with the purpose of enriching text features but the external knowledge itself contains negative tendencies; long texts are truncated and embedded but the full text features are missing.

[0003] Therefore, it is necessary to propose a hierarchical network-based method for detecting the polarity of bad news text to solve the above problems. Summary of the invention

[0004] The main purpose of the present invention is to provide a method for detecting the polarity of bad news text based on a hierarchical network, which can effectively solve the problems in the background technology.

[0005] To achieve the above object, the technical solution adopted by the present invention is: A method for detecting polarity of bad news text based on hierarchical network includes the following steps: S1: Collect news texts from multiple channels to form a data set, clean the data set, and form a text data set containing two elements: title and text. Professionals will mark the news as neutral, left-leaning, or right-leaning based on the tendency polarity contained in the news text. Based on the optimization model training effect, the three types of texts are controlled to be the same in number and include multiple news media; S2: Data preprocessing: by setting the sentence division symbols and features in advance, each news text is divided into sentences to form a news sentence list, and the news is stored in the data loader in units of news articles and the data is shuffled, where each news article contains its own sentence list and title; S3: Text embedding, which embeds the text in the data loader through a pre-trained model and converts the text into a rich high-dimensional feature vector to capture its deep semantics and learn contextual information; S4: includes a sentence scoring module. The embedded text feature vector is input into the sentence scoring module. This module is used to assign a score to the sentence. Through the multi-feature fusion strategy, this module comprehensively analyzes the various features of the sentence and effectively obtains the sentence score. The sentence score is multiplied by the embedded text feature vector to obtain a new text feature vector, thereby achieving an accurate summary of the text theme. S5: including a tree hierarchy module, which inputs the new text feature vector and sentence score into the tree hierarchy module, and the module is used to evaluate and sort the importance of sentences in the news text, so as to construct a tree representation with a hierarchical structure; S6: including a feature fusion module, the news in the tree hierarchy structure is input into the feature fusion module, and the module is used to effectively fuse the high-dimensional feature vector into a low-dimensional representation; S7: includes a text content tendency detection module. After the fused tree-type hierarchical high-dimensional feature vector is input into the text content tendency detection module, feature conversion is performed through a fully connected layer to extract potential text tendency information.

[0006] Preferably, the S1 specifically includes the following steps: S101: Obtain news on multiple topics within a specified time range from multiple news websites and perform data cleaning to standardize the format and fields of news text data, so that the model can learn the morphological features of adverse tendencies rather than the website writing features, and form a text data set; S102: Professional personnel annotate the polarity of the tendency contained in the acquired news texts, aiming to classify news of multiple topics and contents into three categories, namely, left-leaning, neutral, and right-leaning, corresponding to the left, neutral, and right in the tendency.

[0007] Preferably, the S2 specifically includes the following steps: S201: New data set formed in step S1 In Sentences are processed as units to get a list of sentences Indicates A list of sentences consisting of sentences in a news text; S202: List the sentences Replace the new dataset described in step S1 and input it into the data loader In , set the batch size and shuffle the order.

[0008] Preferably, S3 specifically includes the following steps: S301: Use the pre-trained model language model to embed the dataset, aiming to convert the text into a high-dimensional feature vector, learn contextual information and capture the deep semantics of the sentence; S302: Use the bidirectional model to embed the sentence list Processing is performed to capture contextual information between sentences and deeply learn their mutual relationships in the text structure, where the text structure includes linear structure, general-specific structure, specific-general structure, and parallel structure, and its relationships include causal relationship, transition relationship, and progressive relationship. First, the parts of speech and sentence components of the sentence are analyzed to determine the grammatical structure of the sentence. The word vector model technology is used to determine the semantic meaning of the words in the sentence, and then the overall semantics of the sentence is analyzed to find the logical connectors between the sentences, so as to infer the logical relationship between the sentences and extract their features. Establish a relationship model. Based on the extracted features, use a deep learning model to build a sentence relationship classification model. Use a part of the labeled data set to evaluate the model. Measure the performance of the model through accuracy, recall rate, and F1 value. Optimize the model according to the evaluation results, adjust the model parameters and improve the feature extraction method.

[0009] Preferably, the S4 specifically includes the following steps: S401: Assign a length score to each sentence, quantifying its number of characters and words through the tool. The sentence length score is used to capture the importance of the sentence in terms of length, thereby measuring its contribution to the overall text; S402: assigning a similarity score to each sentence, and calculating the semantic similarity score between the sentence and the title to measure the degree of fit between the sentence content and the title theme, thereby identifying sentences that are highly related to the core theme, reflecting their importance to the entire text; S403: Measure the relative importance of the position of a sentence in a text and define a sentence position score. The score evaluates the relative weight of a sentence by considering its specific position in the document and its role in the overall structure, and is used to reflect the potential contribution of the sentence in expressing the central idea. S404: The sentence length score, the sentence-title similarity score, and the sentence position score are integrated, and a learnable parameter is assigned to each of them and normalized.

[0010] Preferably, the S5 specifically includes the following steps: S501: Realize the primary and secondary structure of text sentences and use the calculated sentence scores As a standard, the sentences are divided into central sentences and supporting sentences corresponding to the central sentences to form sentence sets, and the entire article is divided into multiple sentence sets; S502: Realize the primary and secondary structure of the entire text, and use the obtained sentence set , forming a tree-like hierarchical structure for the entire article.

[0011] Preferably, the S6 specifically includes the following steps: S601: The text is subjected to feature fusion in the tree-type hierarchical structure, and the fusion is performed step by step in a bottom-up manner, and the sentence set is The central sentence in and supporting sentences Perform feature fusion to support sentences Arrange in the natural order of the text to ensure that the structure and logic of the text are preserved; S602: Use the same method to group the sentences Perform feature fusion, sentence set Central Sentence Arrange in the natural order of the text; S603: In the same way, the text part Perform feature fusion with the title feature vector.

[0012] Preferably, the S7 specifically includes the following steps: S701: Set the quantity to The news feature vectors are concatenated; S702: Input the concatenated news feature vector into the classifier.

[0013] Compared with the prior art, the present invention provides a method for detecting the polarity of bad news text based on a hierarchical network, which has the following beneficial effects: 1. This hierarchical network-based method for detecting the polarity of negative news text can determine whether the text content of a piece of news is left-leaning, right-leaning, or neutral. It can be used to detect and screen the tendency of text content before the news text is released, which helps to control the release of negative news texts, optimize the effect of news dissemination, and optimize the effect of national image building.

[0014] 2. The hierarchical network-based method for detecting the polarity of negative news texts uses a hierarchical analysis method to accurately organize the importance levels of sentences, thereby amplifying the central features of the news and effectively weakening and removing secondary features to achieve structured extraction of news texts. The feature fusion module uses a multi-head self-attention mechanism to integrate high-dimensional feature vectors in the tree hierarchy in a bottom-up manner, thereby extracting important information and enhancing the expressive power of features. The text content tendency detection module uses a deep learning algorithm to analyze and classify features, thereby achieving accurate and effective detection of the text tendency of news texts. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] Figure 1 It is a flow chart of the method for detecting the tendency of international communication news text based on hierarchical network of the present invention; Figure 2It is a schematic diagram of the present invention obtaining the central sentence by integrating various features of the sentence as the importance of the sentence; Figure 3 It is a schematic diagram of the present invention that the central sentence and the supporting sentences corresponding to the central sentence are obtained to form a tree-like hierarchical structure, and the text features are integrated in a bottom-up manner. DETAILED DESCRIPTION

[0016] In order to make the technical means, creative features, objectives and effects achieved by the present invention easy to understand, the present invention is further explained below in conjunction with specific implementation methods.

[0017] like Figure 1-Figure 3 As shown, a method for detecting polarity of bad news text based on a hierarchical network includes the following steps: S1: Collect news texts from multiple channels to form a data set, clean the data set, and form a text data set containing two elements: title and text. Professionals will mark the news as neutral, left-leaning, or right-leaning based on the tendency polarity contained in the news text. Based on the optimization model training effect, the three types of texts are controlled to be the same in number and include multiple news media; The specific steps include the following: S101: Obtain news on multiple topics within a specified time range from multiple news websites and perform data cleaning to standardize the format and fields of news text data, so that the model can learn the morphological features of adverse tendencies rather than the website writing features, and form a text data set; Specifically, the text dataset is represented as ,in represents the i-th news in the data set, where ,in Indicates The title of the news, Indicates The main body of the news article; remove non-identical text information in the text, including but not limited to emoticons and multiple languages ​​in the text, to achieve a standardized text format; S102: Professional personnel annotate the polarity of the tendency contained in the acquired news texts, aiming to classify news with multiple topics and contents into three categories, namely, left-leaning, neutral, and right-leaning, corresponding to the left, neutral, and right in the tendency; Specifically, In , The content of the news is handed over to professionals for annotation. Professionals should be familiar with the politics and history of the country described in the news. Marked as ,in ,in Corresponding to the left, middle, and right respectively, Corresponding with and Merge into To form a new data set, in order to facilitate data processing and model training, Appears in the form of numbers 0, 1, 2.

[0018] S2: Data preprocessing: by setting the sentence division symbols and features in advance, each news text is divided into sentences to form a news sentence list, and the news is stored in the data loader in units of news articles and the data is shuffled, where each news article contains its own sentence list and title; The specific steps include the following: S201: New data set formed in step S1 In Sentences are processed as units to get a list of sentences Indicates A list of sentences consisting of sentences in a news text; Specifically, through the set English segmentation symbols And the first letter of the next sentence is capitalized as the standard for each news text Divide into Sentences, forming a sentence list of the news and expressed as ,in Indicates News Sentences; S202: List the sentences Replace the new dataset in step S1 and input it into the data loader In, set the batch size and shuffle the order; Specifically, list the sentences replace In And expressed as , load the data. As an example, you can use Meta's PyTorch built-in data loader , when loading data, you can set the batch size The order of the text in the dataset is shuffled, but the order of the sentences in the text remains unchanged.

[0019] S3: Text embedding, which embeds the text in the data loader through a pre-trained model and converts the text into a rich high-dimensional feature vector to capture its deep semantics and learn contextual information; The specific steps include the following: S301: Use the pre-trained model language model to embed the dataset, aiming to convert the text into a high-dimensional feature vector, learn contextual information and capture the deep semantics of the sentence; Specifically, using pre-trained semantic models For the dataset In as well as Embed it to get the high-dimensional feature vector of the data and express it as , where the sentence list is represented as ,in, Each word is embedded. In order to obtain the feature vector of each sentence, the embedded words need to be averaged and pooled, which is expressed as , where each sentence is represented as ,in Represented as a word in a sentence; S302: Use the bidirectional model to embed the sentence list Processing is performed to capture contextual information between sentences and deeply learn their mutual relationships in the text structure, where the text structure includes linear structure, general-specific structure, specific-general structure, and parallel structure, and its relationships include causal relationship, transition relationship, and progressive relationship. First, the parts of speech and sentence components of the sentence are analyzed to determine the grammatical structure of the sentence. The word vector model technology is used to determine the semantic meaning of the words in the sentence, and then the overall semantics of the sentence is analyzed to find the logical connectors between the sentences, so as to infer the logical relationship between the sentences and extract their features. Specifically, as an embodiment, using The bidirectional nature of the model will embed the sentence list enter The model can not only obtain the forward and backward dependencies of each sentence, but also extract a more comprehensive feature representation. The output sentence list is represented as ,in, The method of obtaining is as follows: ; Establish a relationship model. Based on the extracted features, use a deep learning model to build a sentence relationship classification model. Use a part of the labeled data set to evaluate the model. Measure the performance of the model through accuracy, recall rate, and F1 value. Optimize the model according to the evaluation results, adjust the model parameters and improve the feature extraction method.

[0020] S4: includes a sentence scoring module. The embedded text feature vector is input into the sentence scoring module. This module is used to assign a score to the sentence. Through the multi-feature fusion strategy, this module comprehensively analyzes the various features of the sentence and effectively obtains the sentence score. The sentence score is multiplied by the embedded text feature vector to obtain a new text feature vector, thereby achieving an accurate summary of the text theme. S4 specifically includes the following steps: S401: Assign a length score to each sentence, quantifying its number of characters and words through the tool. The sentence length score is used to capture the importance of the sentence in terms of length, thereby measuring its contribution to the overall text; Specifically, as an embodiment, the number of words contained in each sentence in the news is obtained using the nltk package ,in Represents the sentence of a news article in the dataset , The size of represents the size of the vocabulary of the sentence. In order to alleviate the score gap caused by the difference in vocabulary size, the length score of each sentence is obtained by normalizing the sentence score, which is expressed as ; Among them, the sentence length score is as follows: ; S402: assigning a similarity score to each sentence, and calculating the semantic similarity score between the sentence and the title to measure the degree of fit between the sentence content and the title theme, thereby identifying sentences that are highly related to the core theme, reflecting their importance to the entire text; Specifically, through the pre-training model The embedded feature vector represents the semantic features of each sentence. Every word in Embed with title Perform cosine similarity calculation to get the similarity score between the sentence and the title , in order to evaluate the fit of each sentence to the main idea of ​​the article, similarly, Perform normalization processing; Among them, the similarity scores between sentences and titles are as follows: ; ; S403: Measure the relative importance of the position of a sentence in a text and define a sentence position score. The score evaluates the relative weight of a sentence by considering its specific position in the document and its role in the overall structure, and is used to reflect the potential contribution of the sentence in expressing the central idea. Specifically, a learnable relative position parameter is set with an initial value of 1, and the number of relative positions is set to , maps the absolute position of the sentence in the text to the relative position, and analyzes the importance of different positions in the text by the size of the parameter, which is expressed as , and use this to judge the contribution of the sentence to the article. Similarly, Perform normalization processing; Specifically, the sentence position scores are as follows: ; in, The absolute position of the sentence in the text, Represents the total number of sentences in the text, A quantity indicating a relative position; S404: integrating the sentence length score, the sentence-title similarity score, and the sentence position score, assigning a learnable parameter to each of them and normalizing them; Specifically, the sentence length score , sentence and title similarity score , sentence position score Assign a parameter respectively, expressed as , in the initial state , and after Normalization processing to get the sentence score ; Specifically, the sentence scores are as follows: ; S405: weighted multiplication of the sentence score and its embedded feature vector to enhance the influence of the sentence in the overall semantic representation; Specifically, The corresponding sentence feature vector Perform element-by-element multiplication to obtain a new eigenvector , so that the weight of each sentence in the overall text representation is dynamically adjusted; Specifically, the new sentence feature vector as follows: .

[0021] S5: including a tree hierarchy module, which inputs the new text feature vector and sentence score into the tree hierarchy module, and the module is used to evaluate and sort the importance of sentences in the news text, so as to construct a tree representation with a hierarchical structure; The specific steps include the following: S501: Realize the primary and secondary structure of text sentences and use the calculated sentence scores As a standard, the sentences are divided into central sentences and supporting sentences corresponding to the central sentences to form sentence sets, and the entire article is divided into multiple sentence sets; Specifically, select the sentence score The highest M sentences in are taken as the central sentences, expressed as }, which is a feature vector from the sentence list Similarly, the cosine similarity is used to calculate the remaining sentences and each central sentence The similarity of two sentences is selected for pairing to obtain the central sentence. The corresponding supporting sentence And form a sentence set , here Indicates the number of supporting sentences corresponding to the central sentence; Specifically, the correlation between the central sentence and the supporting sentence is as follows: ; in, The calculation method is proposed in step 402; S502: Realize the primary and secondary structure of the entire text, and use the obtained sentence set , the whole article is formed into a tree-like hierarchical structure; Specifically, when constructing the tree structure, the entire article As the root node of the tree, it represents the core idea of ​​the article, followed by the title. and the body of the text As a root node The child nodes of As part of the text The order of the sentence set is the order in which the central sentence appears in the text, followed by the central sentence. The corresponding supporting sentence As a central sentence The child nodes are the leaf nodes of the entire tree, supporting sentences The order is the order in which the supporting sentences appear in the text.

[0022] S6: including a feature fusion module, the news in the tree hierarchy structure is input into the feature fusion module, and the module is used to effectively fuse the high-dimensional feature vector into a low-dimensional representation; The specific steps include the following: S601: The text is feature-fused in a tree-like hierarchical structure, and the fusion is performed step by step from bottom to top. The central sentence in and supporting sentences Perform feature fusion to support sentences Arrange in the natural order of the text to ensure that the structure and logic of the text are preserved; Specifically, each sentence set The feature fusion is performed from the bottom up, and the recursive multi-head self-attention method is used to gradually merge the features upward to form a higher-level semantic expression. In the first step, the central sentence is used as the initial attention representation. ; Specifically, the multi-head self-attention feature fusion method is as follows: ; in, Change the substitution in each recursion, Support sentence and attention representation Splicing; Specifically, The representation is as follows: ; This loop continues until all sentences are traversed. Every sentence in S602: Use the same method to group the sentences Perform feature fusion, sentence set Central Sentence Arrange in the natural order of the text; Specifically, each sentence set The last step of feature fusion As the feature vector of the sentence set, it is fused from bottom to top to form the main text part The feature vector of the text is obtained by using multi-head self-attention to fuse the features and average pooling, which is expressed as ; Specifically, The acquisition algorithm is as follows: ; in is the feature vector set of all sentence sets, The acquisition algorithm is as follows: ; in is the feature vector of the sentence set, is the number of the above central sentences; S603: In the same way, the text part Perform feature fusion with the title feature vector; Specifically, the feature vector of the text part is obtained With the title feature vector After splicing, feature fusion is performed, and the multi-head self-attention method is used and mean pooling is performed to obtain the feature vector of the entire article, which is expressed as ; Specifically, The acquisition algorithm is as follows: ; in is the text feature vector With title The concatenated feature vector is expressed as follows: .

[0023] S7: including a text content tendency detection module, after the fused tree-type hierarchical high-dimensional feature vector is input into the text content tendency detection module, feature conversion is performed through a fully connected layer to extract potential text tendency information; The specific steps include the following: S701: Set the quantity to The news feature vectors are concatenated; Specifically, before step S4 is input, the quantity is The news text is input by traversing each news text in a loop, and after each news text is output in step S6, the news text is spliced ​​to achieve the effect of the same number of input and output news; S702: Input the concatenated news feature vector into a classifier; Specifically, the size after splicing is The news feature vector of is input into the classifier, and the The model is a classifier. Contains two fully connected layers and an activation function And the dimension is reduced by the method of dimensionality reduction, that is, the first fully connected layer reduces the dimension to half of the input, and then passes through the activation function , and finally the second fully connected layer outputs the dimensions into three categories to achieve the purpose of text content tendency detection; if the first dimension is larger among the three dimensions, it means that the tendency of the text is 0, corresponding to the left; if the second dimension is larger among the three dimensions, it means that the tendency of the text is 1, corresponding to neutrality; if the first dimension is larger among the three dimensions, it means that the tendency of the text is 2, corresponding to the right.

[0024] The present invention can determine whether the content of a news article is left-leaning, right-leaning, or neutral, and can be used to detect and screen the content tendency of news text releases, which is of great significance in helping to control the release of negative news texts, optimize news dissemination effects, and optimize the shaping of the national image.

[0025] The above shows and describes the basic principles and main features of the present invention and the advantages of the present invention. It should be understood by those skilled in the art that the present invention is not limited to the above embodiments. The above embodiments and descriptions are only for explaining the principles of the present invention. Without departing from the spirit and scope of the present invention, the present invention may have various changes and improvements, which fall within the scope of the present invention to be protected. The scope of protection of the present invention is defined by the attached claims and their equivalents.

Claims

1. A method for detecting the polarity of bad news text based on a hierarchical network, characterized by: The steps include: S1: Collect news texts from multiple channels to form a data set, clean the data set, and form a text data set containing two elements: title and text. Professionals will mark the news as neutral, left-leaning, or right-leaning based on the tendency polarity contained in the news text. Based on the optimization model training effect, the three types of texts are controlled to be the same in number and include multiple news media; S2: Data preprocessing: by setting the sentence division symbols and features in advance, each news text is divided into sentences to form a news sentence list, and the news is stored in the data loader in units of news articles and the data is shuffled, where each news article contains its own sentence list and title; S3: Text embedding, which embeds the text in the data loader through a pre-trained model and converts the text into a rich high-dimensional feature vector to capture its deep semantics and learn contextual information; S4: includes a sentence scoring module. The embedded text feature vector is input into the sentence scoring module. This module is used to assign a score to the sentence. Through the multi-feature fusion strategy, this module comprehensively analyzes the various features of the sentence and effectively obtains the sentence score. The sentence score is multiplied by the embedded text feature vector to obtain a new text feature vector, thereby achieving an accurate summary of the text theme. S5: including a tree hierarchy module, which inputs the new text feature vector and sentence score into the tree hierarchy module, and the module is used to evaluate and sort the importance of sentences in the news text, so as to construct a tree representation with a hierarchical structure; S6: It includes a feature fusion module, which inputs the news in the tree hierarchy into the feature fusion module, and the module is used to effectively fuse the high-dimensional feature vector into a low-dimensional representation; S7: includes a text content tendency detection module. After the fused tree-type hierarchical high-dimensional feature vector is input into the text content tendency detection module, feature conversion is performed through a fully connected layer to extract potential text tendency information.

2. According to claim 1, a hierarchical network-based method for detecting polarity of bad news texts is characterized by: The S1 specifically includes the following steps: S101: Obtain news on multiple topics within a specified time range from multiple news websites and perform data cleaning to standardize the format and fields of news text data, so that the model can learn the morphological features of adverse tendencies rather than the website writing features, and form a text data set; S102: Professional personnel annotate the polarity of the tendency contained in the acquired news texts, aiming to classify news of multiple topics and contents into three categories, namely, left-leaning, neutral, and right-leaning, corresponding to the left, neutral, and right in the tendency.

3. The method for detecting the polarity of bad news text based on hierarchical network according to claim 1, characterized in that: The S2 specifically includes the following steps: S201: New data set formed in step S1 In Sentences are processed as units to get a list of sentences Indicates A list of sentences consisting of sentences in a news text; S202: List the sentences Replace the new dataset described in step S1 and input it into the data loader In , set the batch size and shuffle the order.

4. The method for detecting the polarity of bad news text based on hierarchical network according to claim 1 is characterized in that: The S3 specifically includes the following steps: S301: Use the pre-trained model language model to embed the dataset, aiming to convert the text into a high-dimensional feature vector, learn contextual information and capture the deep semantics of the sentence; S302: Use the bidirectional model to embed the sentence list Processing is performed to capture contextual information between sentences and deeply learn their mutual relationships in the text structure, where the text structure includes linear structure, general-specific structure, specific-general structure, and parallel structure, and its relationships include causal relationship, transition relationship, and progressive relationship. First, the parts of speech and sentence components of the sentence are analyzed to determine the grammatical structure of the sentence. The word vector model technology is used to determine the semantic meaning of the words in the sentence, and then the overall semantics of the sentence is analyzed to find the logical connectors between the sentences, so as to infer the logical relationship between the sentences and extract their features. Establish a relationship model. Based on the extracted features, use a deep learning model to build a sentence relationship classification model. Use a part of the labeled data set to evaluate the model. Measure the performance of the model through accuracy, recall rate, and F1 value. Optimize the model according to the evaluation results, adjust the model parameters and improve the feature extraction method.

5. The method for detecting polarity of bad news text based on hierarchical network according to claim 1 is characterized in that: The S4 specifically includes the following steps: S401: Assign a length score to each sentence, quantifying its number of characters and words through the tool. The sentence length score is used to capture the importance of the sentence in terms of length, thereby measuring its contribution to the overall text; S402: assigning a similarity score to each sentence, and calculating the semantic similarity score between the sentence and the title to measure the degree of fit between the sentence content and the title theme, thereby identifying sentences that are highly related to the core theme, reflecting their importance to the entire text; S403: Measure the relative importance of the position of a sentence in a text and define a sentence position score. The score evaluates the relative weight of a sentence by considering its specific position in the document and its role in the overall structure, and is used to reflect the potential contribution of the sentence in expressing the central idea. S404: The sentence length score, the sentence-title similarity score, and the sentence position score are integrated, and a learnable parameter is assigned to each of them and normalized.

6. The method for detecting the polarity of bad news text based on hierarchical network according to claim 1 is characterized in that: The S5 specifically includes the following steps: S501: Realize the primary and secondary structure of text sentences and use the calculated sentence scores As a standard, the sentences are divided into central sentences and supporting sentences corresponding to the central sentences to form sentence sets, and the entire article is divided into multiple sentence sets; S502: Realize the primary and secondary structure of the entire text, and use the obtained sentence set , forming a tree-like hierarchical structure for the entire article.

7. The method for detecting the polarity of bad news text based on hierarchical network according to claim 1 is characterized by: The S6 specifically includes the following steps: S601: The text is subjected to feature fusion in the tree-type hierarchical structure, and the fusion is performed step by step from bottom to top. The central sentence in and supporting sentences Perform feature fusion to support sentences Arrange in the natural order of the text to ensure that the structure and logic of the text are preserved; S602: Use the same method to group the sentences Perform feature fusion, sentence set Central Sentence Arrange in the natural order of the text; S603: In the same way, the text part Perform feature fusion with the title feature vector.

8. The method for detecting polarity of bad news text based on hierarchical network according to claim 1 is characterized by: The S7 specifically includes the following steps: S701: Set the quantity to The news feature vectors are concatenated; S702: Input the concatenated news feature vector into the classifier.

Citation Information

Patent Citations

  • False news identification method based on heterogeneous graph convolutional network

    CN115438274A

  • Multi-modal rumor detection method and system based on hierarchical attention network

    CN115712869A

  • Method for improvement accuracy of decision tree based text categorization

    US6253169B1