A polarity detection method for negative news text based on hierarchical network
Through a hierarchical network-based method, a hierarchical structure is constructed to analyze the sentence importance and text tendency of news texts, which solves the problems of lack of control over sentence units and implicit negative tendencies of external knowledge in existing technologies, and realizes accurate polarity detection of news texts and optimizes the dissemination effect.
Patent Information
- Application Number
- CN202411802712.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-09
- Publication Date
- 2025-10-03
- Estimated Expiration
- 2044-12-09
AI Technical Summary
Existing algorithms for detecting negative news text tendencies lack control over sentence units and cannot effectively capture the full-text features. In addition, the injection of external knowledge may imply negative tendencies, resulting in poor detection results.
A hierarchical network-based method is adopted to build a hierarchical structure through data preprocessing, text embedding, sentence scoring module, tree hierarchy module, feature fusion module and text content tendency detection module to accurately analyze the sentence importance and text tendency of news texts.
It has achieved accurate polarity detection of news texts, and can identify left-leaning, right-leaning or neutral content, optimize the news dissemination effect, and enhance the national image.
Smart Images

Figure CN119557451B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of detection of bad news texts, and in particular to a method for detecting the polarity of bad news texts 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 polarity detection method for negative 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:
[0006] A method for detecting the polarity of negative news text based on a hierarchical network includes the following steps:
[0007] S1: Collect news texts from multiple channels to form a data set. This data set is cleaned to form a text data set consisting of two elements: title and text. Professionals will label the news as neutral, left-leaning, or right-leaning based on the polarity of the news texts. Based on the optimization model training results, the three types of texts are controlled to have the same number and include multiple news media;
[0008] S2: Data preprocessing: By setting sentence demarcation symbols and features in advance, each news article is segmented into a news sentence list. The news is stored in the data loader and shuffled. Each news article contains its own sentence list and title.
[0009] S3: Text embedding, which embeds the text in the data loader through a pre-trained model, converting the text into a rich high-dimensional feature vector to capture its deep semantics and learn contextual information;
[0010] S4: includes a sentence scoring module. The embedded text feature vector is input into the sentence scoring module, which is used to assign a score to the sentence. Through a multi-feature fusion strategy, this module comprehensively analyzes the various features of the sentence and effectively obtains a 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 topic.
[0011] S5: includes a tree hierarchy module, which inputs the new text feature vector and sentence score into the tree hierarchy module. The module is used to evaluate and rank the importance of sentences in the news text, thereby constructing a tree representation with a hierarchical structure;
[0012] S6: includes a feature fusion module, which inputs the news in the tree hierarchy into the feature fusion module, which is used to effectively fuse high-dimensional feature vectors into low-dimensional representations;
[0013] S7: includes a text content tendency detection module. After the fused tree-structured 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.
[0014] Preferably, the S1 specifically includes the following steps:
[0015] S101: Receive news on multiple topics within a specified timeframe from multiple news websites and perform data cleaning to standardize the format and fields of news text data. This allows the model to learn features of negative morphological characteristics rather than website writing features, thus forming a text dataset.
[0016] S102: Professional personnel mark 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.
[0017] Preferably, the S2 specifically includes the following steps:
[0018] S201: New data set formed in step S1 in Sentence processing is performed as a unit to obtain a sentence list Indicates the A list of sentences consisting of sentences in a news text;
[0019] 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.
[0020] Preferably, the S3 specifically includes the following steps:
[0021] S301: Use a pre-trained language model to embed the dataset, aiming to convert text into high-dimensional feature vectors, learn contextual information, and capture the deep semantics of sentences;
[0022] S302: Use the bidirectional model to embed the sentence list Processing is performed to capture contextual information between sentences and to deeply learn their mutual relationships in text structures. Text structures include linear structures, general-specific structures, specific-general structures, and parallel structures. Their relationships include causal relationships, transitional relationships, and progressive relationships. First, the sentence parts of speech and sentence components are analyzed to determine the grammatical structure of the sentence. Using word vector model technology, the semantic meaning of the words in the sentence is determined. Then, the overall semantics of the sentence is analyzed, and the logical connectives between sentences are found to infer the logical relationship between the sentences and extract their features.
[0023] 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 based on the evaluation results, adjust the model parameters and improve the feature extraction method.
[0024] Preferably, the S4 specifically includes the following steps:
[0025] S401: Assign a length score to each sentence. The tool quantifies the number of characters and words in the sentence. 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.
[0026] S402: Assigning a similarity score to each sentence with the title. By calculating the semantic similarity score between the sentence and the title, the degree of fit between the sentence content and the title theme is measured, thereby identifying sentences that are highly relevant to the core theme and reflecting their importance to the entire text;
[0027] S403: Measure the relative importance of a sentence's position in the 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. It is used to reflect the sentence's potential contribution to expressing the central idea.
[0028] 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 score and normalized.
[0029] Preferably, the S5 specifically includes the following steps:
[0030] 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;
[0031] 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.
[0032] Preferably, the S6 specifically includes the following steps:
[0033] S601: The text is subjected to feature fusion using 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 and support sentences Arrange the text in its natural order to ensure that its structure and logic are preserved;
[0034] S602: Use the same method to collect sentences Perform feature fusion, sentence set Central sentence Arrange in the natural order of the text;
[0035] S603: In the same way, the main text Perform feature fusion with the title feature vector.
[0036] Preferably, the step S7 specifically includes the following steps:
[0037] S701: Set the quantity to The news feature vectors are spliced;
[0038] S702: Input the concatenated news feature vector into the classifier.
[0039] Compared with the existing technology, the present invention provides a method for detecting the polarity of negative news text based on a hierarchical network, which has the following beneficial effects:
[0040] 1. This hierarchical network-based method for detecting the polarity of negative news text can determine whether the text content of a news article is left-leaning, right-leaning, or neutral. It can be used to detect and screen the text content tendency before the news text is released, helping to control the release of negative news texts, optimize the news dissemination effect, and optimize the effect of national image shaping.
[0041] 2. This hierarchical network-based method for detecting the polarity of negative news text uses a hierarchical tree structure module that uses a hierarchical progressive 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, thereby achieving 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
[0042] Figure 1 It is a flow chart of the method for detecting the tendency of international communication news text based on a hierarchical network of the present invention;
[0043] Figure 2 It is a schematic diagram of the present invention obtaining the central sentence by integrating multiple features of the sentence as the importance of the sentence;
[0044] Figure 3 It is a schematic diagram of the present invention forming a tree-like hierarchical structure by acquiring a central sentence and supporting sentences corresponding to the central sentence, and fusing text features in a bottom-up manner. DETAILED DESCRIPTION
[0045] In order to make the technical means, creative features, objectives and effects achieved by the present invention easier to understand, the present invention is further described below in conjunction with specific implementation methods.
[0046] like Figure 1-Figure 3 As shown in FIG, a method for detecting polarity of negative news text based on a hierarchical network includes the following steps:
[0047] S1: Collect news texts from multiple channels to form a data set. This data set is cleaned to form a text data set consisting of two elements: title and text. Professionals will label the news as neutral, left-leaning, or right-leaning based on the polarity of the news texts. Based on the optimization model training results, the three types of texts are controlled to have the same number and include multiple news media;
[0048] The specific steps include the following:
[0049] S101: Receive news on multiple topics within a specified timeframe from multiple news websites and perform data cleaning to standardize the format and fields of news text data. This allows the model to learn features of negative morphological characteristics rather than website writing features, thus forming a text dataset.
[0050] Specifically, the text dataset is represented as ,in Represents the i-th news in the data set, where ,in Indicates the The title of the news, Indicates the The main text 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;
[0051] S102: Professionals annotate the polarity of the tendency contained in the acquired news texts, aiming to categorize news of multiple topics and contents into three categories: left-leaning, neutral, and right-leaning, corresponding to the left, neutral, and right in the tendency;
[0052] 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.
[0053] S2: Data preprocessing: By setting sentence demarcation symbols and features in advance, each news article is segmented into a news sentence list. The news is stored in the data loader and shuffled. Each news article contains its own sentence list and title.
[0054] The specific steps include the following:
[0055] S201: New data set formed in step S1 in Sentence processing is performed as a unit to obtain a sentence list Indicates the A list of sentences consisting of sentences in a news text;
[0056] Specifically, through the set English punctuation symbols And the first letter of the next sentence is capitalized as standard. Divided into Sentences, forming a sentence list of the news and expressed as ,in Indicates the News a sentence;
[0057] S202: List the sentences Replace the new dataset in step S1 and input it into the data loader In the batch size, set the batch size and shuffle the order;
[0058] 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.
[0059] S3: Text embedding, which embeds the text in the data loader through a pre-trained model, converting the text into a rich high-dimensional feature vector to capture its deep semantics and learn contextual information;
[0060] The specific steps include the following:
[0061] S301: Use a pre-trained language model to embed the dataset, aiming to convert text into high-dimensional feature vectors, learn contextual information, and capture the deep semantics of sentences;
[0062] Specifically, using pre-trained semantic models For the dataset in as well as Embed the data to obtain the high-dimensional feature vector 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;
[0063] S302: Use the bidirectional model to embed the sentence list Processing is performed to capture contextual information between sentences and to deeply learn their mutual relationships in text structures. Text structures include linear structures, general-specific structures, specific-general structures, and parallel structures. Their relationships include causal relationships, transitional relationships, and progressive relationships. First, the sentence parts of speech and sentence components are analyzed to determine the grammatical structure of the sentence. Using word vector model technology, the semantic meaning of the words in the sentence is determined. Then, the overall semantics of the sentence is analyzed, and the logical connectives between sentences are found to infer the logical relationship between the sentences and extract their features.
[0064] 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:
[0065] ;
[0066] 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 based on the evaluation results, adjust the model parameters and improve the feature extraction method.
[0067] S4: includes a sentence scoring module. The embedded text feature vector is input into the sentence scoring module, which is used to assign a score to the sentence. Through a multi-feature fusion strategy, this module comprehensively analyzes the various features of the sentence and effectively obtains a 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 topic.
[0068] S4 specifically includes the following steps:
[0069] S401: Assign a length score to each sentence. The tool quantifies the number of characters and words in the sentence. 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.
[0070] 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 ;
[0071] Among them, the sentence length score is as follows:
[0072] ;
[0073] S402: Assigning a similarity score to each sentence with the title. By calculating the semantic similarity score between the sentence and the title, the degree of fit between the sentence content and the title theme is measured, thereby identifying sentences that are highly relevant to the core theme and reflecting their importance to the entire text;
[0074] 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 theme of the article, similarly, Perform normalization processing;
[0075] Among them, the similarity scores between sentences and titles are as follows:
[0076] ;
[0077] ;
[0078] S403: Measure the relative importance of a sentence's position in the 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. It is used to reflect the sentence's potential contribution to expressing the central idea.
[0079] 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;
[0080] Specifically, the sentence position scores are as follows:
[0081] ;
[0082] in, The absolute position of the sentence in the text, Indicates the total number of sentences in the text, A quantity indicating a relative position;
[0083] S404: Fusion the sentence length score, sentence-title similarity score, and sentence position score, assigning a learnable parameter to each score and normalizing the scores.
[0084] 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 obtain sentence scores ;
[0085] Specifically, the sentence scores are as follows:
[0086] ;
[0087] S405: Perform weighted multiplication of the sentence score and its embedded feature vector to enhance the influence of the sentence in the overall semantic representation;
[0088] 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;
[0089] Specifically, the new sentence feature vector as follows:
[0090] .
[0091] S5: includes a tree hierarchy module, which inputs the new text feature vector and sentence score into the tree hierarchy module. The module is used to evaluate and rank the importance of sentences in the news text, thereby constructing a tree representation with a hierarchical structure;
[0092] The specific steps include the following:
[0093] 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;
[0094] 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 the two sentences is selected for pairing to obtain the central sentence. Corresponding supporting sentences And form a sentence set , here Indicates the number of supporting sentences corresponding to the central sentence;
[0095] Specifically, the correlation between the central sentence and the supporting sentences is as follows:
[0096] ;
[0097] in, The calculation method is proposed in step 402;
[0098] S502: Realize the primary and secondary structure of the entire text, and use the obtained sentence set , form the entire article into a tree-like hierarchical structure;
[0099] 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 main text As a root node The child nodes, then, with the central sentence 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. Corresponding supporting sentences As a central sentence The child nodes are the leaf nodes of the entire tree, supporting sentences The order of the supporting sentences is the order in which they appear in the text.
[0100] S6: includes a feature fusion module, which inputs the news in the tree hierarchy into the feature fusion module, which is used to effectively fuse high-dimensional feature vectors into low-dimensional representations;
[0101] The specific steps include the following:
[0102] S601: Perform feature fusion on texts in a tree-like hierarchical structure, and gradually fuse them in a bottom-up manner. The central sentence in and supporting sentences Perform feature fusion and support sentences Arrange the text in its natural order to ensure that its structure and logic are preserved;
[0103] Specifically, each sentence set The feature fusion is performed from the bottom up, using a recursive multi-head self-attention method. The features are gradually merged upward to form a higher-level semantic expression. In the first step, the central sentence is used as the initial attention representation. ;
[0104] Specifically, the multi-head self-attention feature fusion method is as follows:
[0105] ;
[0106] in, Change the replacement in each recursion, Support sentence and attention representation splicing;
[0107] Specifically, is represented as follows:
[0108] ;
[0109] This loop continues until all sentences are traversed. Every sentence in
[0110] S602: Use the same method to collect sentences Perform feature fusion, sentence set Central sentence Arrange in the natural order of the text;
[0111] 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 perform feature fusion and mean pooling, which is expressed as ;
[0112] Specifically, The acquisition algorithm is as follows:
[0113] ;
[0114] in is the feature vector set of all sentence sets, The acquisition algorithm is as follows:
[0115] ;
[0116] in is the feature vector of the sentence set, is the number of the above-mentioned central sentences;
[0117] S603: In the same way, the main text Perform feature fusion with the title feature vector;
[0118] 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 ;
[0119] Specifically, The acquisition algorithm is as follows:
[0120] ;
[0121] in is the text feature vector With title The concatenated feature vector is expressed as follows:
[0122] .
[0123] S7: includes a text content tendency detection module, which inputs the fused tree-structured high-dimensional feature vector into the text content tendency detection module and then performs feature transformation through a fully connected layer to extract potential text tendency information;
[0124] The specific steps include the following:
[0125] S701: Set the quantity to The news feature vectors are spliced;
[0126] Specifically, before step S4 is input, the quantity is The news text is input by traversing each news text in a circular manner, and after each news text is output in step S6, it is spliced to achieve the effect of the same size of input and output news;
[0127] S702: Input the concatenated news feature vector into the classifier;
[0128] Specifically, the size after splicing is The news feature vector of is input into the classifier, and the The model acts as a classifier, Contains two fully connected layers and an activation function And the dimension is reduced by the dimensionality reduction method, 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 dimension into 3 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 neutral; if the first dimension is larger among the three dimensions, it means that the tendency of the text is 2, corresponding to the right.
[0129] 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 texts when they are published. It is of great significance to help control the release of negative news texts, optimize the news dissemination effect, and optimize the shaping of the national image.
[0130] The basic principles, main features, and advantages of the present invention are shown and described above. Those skilled in the art should understand that the present invention is not limited to the above embodiments. The above embodiments and descriptions are merely illustrative of the principles of the present invention. Various changes and modifications may be made to the present invention without departing from the spirit and scope of the present invention. Such changes and modifications are intended to fall within the scope of the present invention. The scope of protection claimed in the present invention is defined by the appended claims and their equivalents.
Claims
1. A method for detecting the polarity of negative news text based on a hierarchical network, characterized by: The following steps are included: S1: Collect news texts from multiple channels to form a data set. This data set is cleaned to form a text data set consisting of two elements: title and text. Professionals will label the news as neutral, left-leaning, or right-leaning based on the polarity of the news texts. Based on the optimization model training results, the three types of texts are controlled to have the same number and include multiple news media; S2: Data preprocessing: By setting sentence demarcation symbols and features in advance, each news article is segmented into a news sentence list. The news is stored in the data loader and shuffled. 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, converting 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, which is used to assign a score to the sentence. Through a multi-feature fusion strategy, this module comprehensively analyzes the various features of the sentence and effectively obtains a 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 topic. S5: includes a tree hierarchy module, which inputs the new text feature vector and sentence scores into the tree hierarchy module. This module is used to evaluate and rank the importance of sentences in the news text, thereby constructing 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; S502: Realize the primary and secondary structure of the entire text, and use the obtained sentence set , form the entire article into a tree-like hierarchical structure; S6: The feature fusion module includes a tree-structured news input module, which is used to effectively fuse high-dimensional feature vectors into low-dimensional representations. The specific operation steps include the following: S601: The text is subjected to feature fusion using 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 and support sentences Arrange the text in its natural order to ensure that its structure and logic are preserved; S602: Use the same method to collect sentences Perform feature fusion, sentence set Central sentence Arrange in the natural order of the text; S603: In the same way, the main text Perform feature fusion with the title feature vector; S7: includes a text content tendency detection module. After the fused tree-structured 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. The hierarchical network-based method for detecting polarity of negative news text according to claim 1, wherein: The S1 specifically includes the following steps: S101: Receive news on multiple topics within a specified timeframe from multiple news websites and perform data cleaning to standardize the format and fields of news text data. This allows the model to learn features of negative morphological characteristics rather than website writing features, thus forming a text dataset. S102: Professional personnel mark 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 hierarchical network-based method for detecting polarity of negative news text according to claim 1, wherein: The S2 specifically includes the following steps: S201: New data set formed in step S1 in Sentence processing is performed as a unit to obtain a sentence list Indicates the 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 hierarchical network-based method for detecting polarity of negative news text according to claim 1, wherein: The S3 specifically includes the following steps: S301: Use a pre-trained language model to embed the dataset, aiming to convert text into high-dimensional feature vectors, learn contextual information, and capture the deep semantics of sentences; S302: Use the bidirectional model to embed the sentence list Processing is performed to capture contextual information between sentences and to deeply learn their mutual relationships in text structures. Text structures include linear structures, general-specific structures, specific-general structures, and parallel structures. Their relationships include causal relationships, transitional relationships, and progressive relationships. First, the sentence parts of speech and sentence components are analyzed to determine the grammatical structure of the sentence. Using word vector model technology, the semantic meaning of the words in the sentence is determined. Then, the overall semantics of the sentence is analyzed, and the logical connectives between sentences are found 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 based on the evaluation results, adjust the model parameters and improve the feature extraction method.
5. The method for detecting polarity of negative news text based on a hierarchical network according to claim 1, wherein: The S4 specifically includes the following steps: S401: Assign a length score to each sentence. The tool quantifies the number of characters and words in the sentence. 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 with the title. By calculating the semantic similarity score between the sentence and the title, the degree of fit between the sentence content and the title theme is measured, thereby identifying sentences that are highly relevant to the core theme and reflecting their importance to the entire text; S403: Measure the relative importance of a sentence's position in the 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. It is used to reflect the sentence's potential contribution to 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 score and normalized.
6. The hierarchical network-based method for detecting polarity of negative news text according to claim 1, characterized in that: The S7 specifically includes the following steps: S701: Set the quantity to The news feature vectors are spliced; S702: Input the concatenated news feature vector into the classifier.
Citation Information
Patent Citations
Multi-modal rumor detection method and system based on hierarchical attention network
CN115712869A
Method for improvement accuracy of decision tree based text categorization
US6253169B1