A content abstract generation method based on discourse structure analysis

By using in-depth analysis of text structure features and semantic adversarial training, the problems of logical incoherence and information redundancy in existing text summarization technologies are solved, generating logically coherent and informationally complete text summaries.

CN121350241BActive Publication Date: 2026-04-24MAIGET INFORMATION TECH (BEIJING) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
MAIGET INFORMATION TECH (BEIJING) CO LTD
Filing Date
2025-10-21
Publication Date
2026-04-24

AI Technical Summary

Technical Problem

Existing text summarization technologies fail to deeply integrate with discourse structure analysis, resulting in incoherent summarization logic, missing key logical relationships, and redundant information, making it impossible to guarantee that the generated content is consistent with the logic of the original discourse.

Method used

By preprocessing the original text and deeply analyzing its structural features, we enhance the recognition of implicit text relationships using pre-trained language models and semantic adversarial training. Combined with a dual-path scoring mechanism and a greedy algorithm, we select target sentences that conform to the logical coherence of the text and generate high-quality summaries.

Benefits of technology

It enables the generation of high-quality summaries in texts of different chapter types, ensuring logical coherence and information integrity, and is suitable for various text scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121350241B_ABST
    Figure CN121350241B_ABST
Patent Text Reader

Abstract

The application discloses a content abstract generation method based on chapter structure analysis and belongs to the technical field of natural language processing. The method first carries out preprocessing on original text, then carries out deep analysis on chapter structure, including identifying chapter types of the text and extracting explicit / implicit chapter relations, wherein the implicit chapter relation extraction introduces special symbols to strengthen logical semantics through the Prompt paradigm; then, a double-path scoring mechanism is adopted to score sentences by combining a deep neural network model of chapter structure features and an optimized text ranking algorithm, and scores are fused through a logistic regression model; then, target sentences are screened based on a chapter relation weighted submodular function and a greedy algorithm, and finally, an abstract is generated through post-processing. The application solves the problems of illogicality, information redundancy or missing key relations in existing abstract generation by deeply utilizing chapter structure logic, and improves the semantic coherence and information integrity of the abstract.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of natural language processing technology, and specifically to a content summary generation method based on discourse structure analysis. Background Technology

[0002] With the explosive growth of text information on the internet, automatic text summarization technology has become a key means for users to quickly obtain core information. Existing text summarization technologies are mainly divided into two categories: extractive and generative.

[0003] Extractive summarization technology generates summaries by scoring sentences and selecting target sentences. However, it only performs basic text structure analysis (excluding dialogues, atlases, and lists) and does not make in-depth use of text types and inter-sentence text relationships (such as cause and effect, and transition). This may result in selected sentences that violate the logical order of the text, leading to problems such as incoherent summaries and missing key logical relationships.

[0004] Generative summarization technology relies on deep neural networks to generate text, but it is prone to semantic bias and does not take into account the structural features of the text, making it difficult to ensure that the generated content is consistent with the logic of the original text.

[0005] While existing discourse relation analysis techniques can improve the accuracy of implicit discourse relation recognition through semantic enhancement, they only focus on discourse relation analysis and are not integrated with the summary generation process, thus failing to incorporate discourse structure logic into the summary generation process.

[0006] In summary, existing technologies suffer from a technical deficiency of "disconnect between text structure analysis and summary generation," resulting in insufficient logical coherence and information completeness in the summaries. There is an urgent need for a method that can deeply utilize text structure features to optimize summary generation. Summary of the Invention

[0007] To address the shortcomings of existing technologies, the purpose of this invention is to solve the technical problems in existing summary generation technologies, such as incoherent summary logic, missing key text relationships, and information redundancy, caused by the lack of deep integration of text structure analysis (text type, inter-sentence text relationships).

[0008] According to one aspect of this application, a content summary generation method based on discourse structure analysis includes the following steps:

[0009] S1: Receive the original text, preprocess the original text to obtain standardized text content, the preprocessing includes at least one of web page character escaping, full-width character to half-width character conversion, segmentation operation, sentence segmentation operation and word segmentation operation;

[0010] S2: Perform in-depth analysis of the standardized text content to obtain text structure features, which include text type labels and a text relationship matrix, wherein:

[0011] S21: Identify the text type of the standardized text content by extracting paragraph keywords and matching syntactic patterns. The text type includes narrative, expository, and argumentative texts.

[0012] S22: Introduce special symbols [Explicit] representing explicit discourse relations and [Implicit] representing implicit discourse relations, and insert the special symbols into the sentence positions of the standardized text content to construct the Prompt input sentence;

[0013] S23: Encode the Prompt input sentence using a pre-trained language model to obtain semantic vectors of [Explicit] and [Implicit], and strengthen implicit discourse relationship recognition by combining semantic adversarial training to generate a discourse relationship matrix covering causal, adversarial, and parallel relationships between sentences;

[0014] S3: A dual-path scoring mechanism is used to score each sentence in the standardized text content:

[0015] S31: Construct a deep neural network model that integrates discourse structure features. Input the word vectors of sentences into the model after concatenating them with the corresponding discourse relation matrix features, and output the first score of each sentence.

[0016] S32: A text ranking algorithm that incorporates text type weights is adopted, which sets differentiated weights for sentences of different text types and outputs the second score for each sentence;

[0017] S4: A pre-trained logistic regression model is used to process the first and second scores of each sentence to obtain a fused score for each sentence;

[0018] S5: Target sentence selection based on a submodular function weighted by discourse relations and a greedy algorithm:

[0019] S51: Introduce a text relation similarity weight in the submodular function, wherein the text relation similarity weight is assigned a value according to the text relation type between sentences;

[0020] S52: The fusion score of each sentence is processed by the submodular function to obtain the processed score, and the processed scores are weighted and summed to obtain the target score;

[0021] S53: Based on the greedy algorithm and the target score, select at least one target sentence that satisfies the logical coherence of the text;

[0022] S6: Generate an initial summary based on the at least one target sentence, and perform post-processing on the initial summary to obtain a final summary. The post-processing includes at least one of watermark removal, deduplication and normalization, and text logic consistency verification.

[0023] Preferably, step S23 combines semantic adversarial training to enhance implicit discourse relation recognition, specifically including:

[0024] S231: Construct a logical semantic enhancement task: extract implicit relation features from [Implicit] semantic vectors, train the model to predict implicit text relation categories, and maximize the prediction probability;

[0025] S232: Construct a general semantic enhancement task: Randomly cover some words in the Prompt input sentence, train the model to predict the covered words, and enhance the general semantic understanding;

[0026] S233: Alternately execute S231 and S232, and use semantic adversarial effects to free implicit discourse relationship features from general semantic interference, thereby improving recognition accuracy.

[0027] Preferably, the deep neural network model that integrates the text structure features in step S31 includes a bidirectional GRNN layer and an attention layer:

[0028] The bidirectional GRNN layer encodes the concatenated vector of the word vectors and the features of the discourse relation matrix to obtain the sentence vector;

[0029] The attention layer calculates the attention weights between the global text vector and the sentence vector, adjusts the importance of the sentence vector based on the attention weights, and outputs the first score.

[0030] Preferably, the text ranking algorithm that introduces document type weights in step S32 is an improved TextRank algorithm:

[0031] For narrative texts, sentences containing time markers should be weighted 1.2-1.5 times.

[0032] For descriptive text, sentences containing definition tags should be given a weight of 1.3-1.6 times.

[0033] For argumentative texts, sentences containing argument markers are given a weight of 1.1-1.4 times.

[0034] Preferably, the submodular function for weighting the chapter relationships in step S51 is specifically:

[0035] Let the set of sentences be S, the candidate sentences be k, and the discourse similarity be Sim(k,S) (Sim(k,S) is assigned a value based on the discourse relationship type between k and the sentences in S: causal relationship Sim=0.8-1.0, contrast relationship Sim=0.6-0.8, and parallel relationship Sim=0.4-0.6). The submodular function is:

[0036] f(S∪{k})=f(S)+α×fusion score(k)×(1-Sim(k,S))

[0037] Where α is the text type adjustment coefficient (narrative type α=1.2, expository type α=1.3, argumentative type α=1.1).

[0038] Preferably, the chapter logical consistency check in step S6 specifically includes:

[0039] S61: Extract the discourse relation sequence of sentences in the initial summary;

[0040] S62: Determine whether the sequence of chapter relationships conforms to the logical rules of the corresponding chapter type;

[0041] S63: If it does not meet the requirements, replace or supplement the sentence so that the sequence of paragraph relationships satisfies the logical rules.

[0042] Preferably, step S6 further includes timeliness optimization processing:

[0043] Determine the timeliness attribute of the abstract based on the type and relationship between the texts:

[0044] In narrative-based events, the expiration time for event-related summaries is set to a preset time period after the event ends.

[0045] In the description category, the technical specification summary should have its expiration date set to the technology update date;

[0046] For opinion summaries in the argument category, the expiration time is set to the time when the opinion is refuted or updated.

[0047] Preferably, the paragraph topic word extraction in step S21 adopts a method combining TF-IDF and TextRank:

[0048] S211: Calculate the TF-IDF values ​​of words in the paragraph and filter the top 20 words;

[0049] S212: Construct a co-occurrence network for the TOP20 words, use the TextRank algorithm to calculate word importance, and select the TOP5 topic words;

[0050] S213: Determine the text type by matching the TOP5 keywords with the preset text type thesaurus.

[0051] The advantages of this application compared with the prior art are as follows: This application proposes a content summary generation method based on text structure analysis, which deeply integrates implicit text relation semantic enhancement with summary generation, solving the problem of incoherent summaries caused by neglecting inter-sentence logic in the prior art; it proposes a text type-differentiated scoring + text relation weighted submodular function, so that the summary retains the core information and conforms to the original text text logic; it can generate high-quality summaries for texts of different text types and has a wide range of applicable scenarios. Attached Figure Description

[0052] Figure 1 This is a flowchart of a content summary generation method based on discourse structure analysis according to an embodiment of this application. Detailed Implementation

[0053] To make the content of this application easier to understand, the technical solutions in the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. It should be noted that the terms "front," "rear," "left," "right," "up," and "down" used in the following description refer to directions in the accompanying drawings, while the terms "inner" and "outer" refer to directions toward or away from the geometric center of a specific component, respectively. Furthermore, the terms "first," "second," etc., are used for descriptive purposes only and should not be construed as indicating or implying relative importance.

[0054] like Figure 1 As shown, a content summarization method based on discourse structure analysis includes the following steps:

[0055] Step S1: Raw text preprocessing to obtain standardized text content. The purpose is to eliminate formatting noise and character anomalies in the raw text, transforming it into a standardized format that facilitates subsequent text analysis and modeling. Processing object: Any raw text; the plain text content must first be extracted using a text parsing tool. Specific processing operations:

[0056] (1) Webpage character escaping: For the text sourced from the webpage, remove or convert HTML / XML tags and special characters:

[0057] Rules: Use regular expressions to match and delete tags such as <[^>]+>; convert HTML entity characters such as spaces, &, and < to ordinary characters according to the standard entity mapping table.

[0058] (2) Full-width character to half-width character conversion: For full-width numbers, letters, and symbols that may exist in Chinese text, convert them to half-width characters to unify character encoding:

[0059] Rules: The Unicode difference between full-width characters and half-width characters is 65248, and the conversion is achieved through character encoding operations; symbols are converted according to a preset mapping table.

[0060] (3) Segmentation operation: Divide the text into paragraphs according to paragraph logic to facilitate subsequent identification of chapter type (the paragraph is the basic unit of chapter structure):

[0061] Rules: Use consecutive newline characters (\n\n) and paragraph separators as segmentation markers; if there are no obvious separators in the text, use "sentence topic similarity" to assist in segmentation (adjacent sentences with topic similarity less than 0.3 are judged as paragraph boundaries, and the similarity calculation uses cosine similarity based on TF-IDF vectors).

[0062] (4) Sentence segmentation breaks down paragraphs into independent sentences, providing basic units for subsequent sentence scoring and discourse relationship analysis:

[0063] Rules: Use Chinese sentence-ending punctuation (“.”, “!”, “?”, “;”) as clause markers; exclude special scenarios; use clause segmentation tools to assist in implementation, with an accuracy rate of ≥98%.

[0064] (5) Word segmentation breaks down sentences into words, providing a foundation for subsequent word vector generation and topic extraction:

[0065] Rules: Use the jieba word segmentation tool, load a custom domain thesaurus to improve word segmentation accuracy; remove stop words; retain keywords.

[0066] Output: Standardized text content, containing a three-level structure of "paragraph-sentence-word", with no formatting noise and uniform characters, which can be directly used for subsequent text structure analysis.

[0067] Step S2: In-depth analysis of text structure to obtain text structure features. The purpose of this step is to break through the limitation of existing technology that "only excludes texts that do not fit the text type", to deeply explore the text's logical features, and to provide a "logical basis" for subsequent scoring and screening. The core outputs are "text type labels" (narrative / explanatory / argumentative) and "text relationship matrix" (explicit / implicit relationships between sentences).

[0068] Step S21: Text type identification (narrative / explanatory / argumentative)

[0069] Principle: Accurate text type classification is achieved through a two-dimensional matching process combining "topic feature + syntactic pattern feature". Specific operation:

[0070] (1) Paragraph topic word extraction (TF-IDF + TextRank combination) Extract the core topic words of each paragraph to reflect the core content of the paragraph: ① TF-IDF calculation: Formula: TF(t,d) = number of times word t appears in paragraph d / total number of words in paragraph d; IDF(t) = log(total number of paragraphs / (number of paragraphs containing word t + 1)); TF-IDF(t,d) = TF(t,d) × IDF(t). Operation: Calculate the TF-IDF value for all words in the standardized text, and filter the TOP20 high TF-IDF words of each paragraph (excluding stop words) to obtain the "paragraph candidate topic word set". ② TextRank Optimization: Construct a co-occurrence network of candidate keywords (window size is 5, i.e., 5 adjacent words form a co-occurrence relationship), with nodes representing candidate words and edge weights representing the number of co-occurrences; use the TextRank algorithm to calculate word importance (iterative formula: WS(t)=(1-d)+d×Σ(WS(t') / Out(t')), where d is the damping coefficient of 0.85 and Out(t') is the out-degree of word t'); select the top 5 important words for each paragraph as "paragraph keywords". ③ Text Keywords Aggregation: Remove duplicates from the top 5 keywords of all paragraphs to obtain a "global text keyword set" (reflecting the core content of the text).

[0071] (2) Syntactic pattern matching identifies typical syntactic structures in the text to assist in determining the text type:

[0072] Narrative texts: containing adverbs of time, verbs of action, and causal sentences;

[0073] Explanatory text: includes definition sentences, feature descriptions, and data descriptions;

[0074] Argumentative texts: include argument markers, evidence markers, and transition / progressive sentence structures.

[0075] Operation: Use syntactic analysis tools to extract the dependency syntax structure of sentences, match the above patterns, and count the frequency of occurrence of each pattern.

[0076] (3) Text type determination: Constructing a "preset text type thesaurus" and using topic word matching and syntactic pattern frequency weighted voting:

[0077] Preset vocabulary:

[0078] Narrative elements: Time words ("date", "moment", "first"), Event words ("event", "occurred", "handled");

[0079] Explanatory terms: definition words ("definition", "refers to", "includes"), characteristic words ("characteristics", "function", "parameter");

[0080] Argumentative arguments: thesis statements ("viewpoint", "belief", "conclusion") and supporting evidence ("evidence", "for example", "research").

[0081] Judgment rules:

[0082] ① Topic matching score: The matching rate between the global topic keywords of the text and a certain type of thesaurus (number of matched words / total number of topic keywords) × 0.6;

[0083] ② Syntactic pattern score: Frequency percentage of a certain type of syntactic pattern (frequency of that type / total pattern frequency) × 0.4;

[0084] ③ The overall score = matching score + pattern score, and the type with the highest overall score is taken as the "text type label".

[0085] Output: Text type label (narrative / descriptive / argumentative).

[0086] Step S22: Construct the Prompt input sentence (introducing the special symbols [Explicit] and [Implicit])

[0087] Principle: By introducing special symbols through the Prompt paradigm, this provides pre-trained language models with anchor points for recognizing explicit / implicit discourse relationships, solving the problem that existing models struggle to distinguish between logical relationships with and without conjunctions. Specific operation:

[0088] (1) Definition of special symbols

[0089] [Explicit]: Marks "explicit discourse relations", that is, there are explicit conjunctions between sentences;

[0090] [Implicit]: Marks "implicit discourse relations", that is, there are no explicit conjunctions between sentences, but there is a logical relationship between them.

[0091] (2) Special symbol insertion rules: For adjacent sentence pairs (sentence i and sentence i+1) in standardized text, first determine the relationship type, and then insert the corresponding symbol:

[0092] Explicit relation determination: Match using the "connector dictionary" (causal connectors: because, therefore, leading to; adversative connectors: but, however, yet; coordinating connectors: at the same time, in addition, on the one hand...on the other hand). If a connector is present at the end of sentence i or at the beginning of sentence i+1, it is determined to be an explicit relation, and [Explicit] is inserted.

[0093] Implicit relation determination: If no connector is matched, the relationship is determined by the auxiliary judgment of "sentence semantic similarity + logical keywords" and [Implicit] is inserted;

[0094] Insertion position: Insert a symbol between adjacent sentence pairs, in the format "sentence i [symbol] sentence i+1".

[0095] (3) Prompt input sentence construction: All sentences after inserting special symbols are concatenated to form a complete Prompt input sentence, while preserving the paragraph structure (paragraphs are separated by [Paragraph] to facilitate the model to distinguish paragraph boundaries).

[0096] Output: Prompt input sentences containing the [Explicit] / [Implicit] symbols, providing input for subsequent pre-trained model encoding.

[0097] Step S23: Encode the pre-trained model + perform semantic adversarial training to generate a discourse relation matrix.

[0098] Principle: This method leverages the contextual modeling capabilities of a pre-trained language model to extract symbolic semantic vectors. Implicit relation recognition is strengthened through "semantic adversarial training" (addressing the issue of implicit relations being susceptible to interference from general semantics), ultimately generating a discourse relation matrix covering "inter-sentence relation type + confidence level." Specific operations:

[0099] (1) The pre-trained language model encoding uses BERT-base-Chinese as the base model (adapted to Chinese text, the pre-training data contains a large amount of Chinese corpus, and has strong semantic modeling capabilities). The encoding process is as follows: ① Input format processing: [CLS] (sentence beginning marker) and [SEP] (sentence end marker) are added to the beginning and end of the Prompt input sentence respectively, which meets the BERT input requirements; for texts exceeding the maximum sequence length of the model (512 tokens), a "sliding window" is used for truncation (window size 512, step size 256, to ensure that the relationship between sentences is not broken). ② Semantic vector extraction: The processed input sentence is input into the BERT model to obtain the hidden layer vectors (i.e., semantic vectors) corresponding to the [Explicit] and [Implicit] symbols, with a dimension of 768 (BERT-base hidden layer dimension); this vector contains the contextual logical information of the sentences before and after the symbol, which can reflect the relationship features between sentences.

[0100] (2) Semantic adversarial training (enhancing implicit discourse relation recognition): Two alternating training tasks, "logical semantic enhancement" and "general semantic enhancement", are designed to improve recognition accuracy by utilizing the semantic adversarial effect (enhancing one semantic while interfering with the other, forcing implicit logical semantics to be independent of general semantics). The specific tasks are as follows:

[0101] Task 1: Logical Semantic Enhancement (S231) Objective: To enable the model to focus on the logical features of implicit relationships and accurately predict implicit relationship categories (causal, contrastive, and parallel, covering mainstream text relationship types). ① Introduce special symbols for relationship categories: Add three symbols to the model vocabulary: [Rel-Cause] (causal), [Rel-Contrast] (contrast), and [Rel-Parallel] (parallel), representing three implicit relationship categories. ② Feature extraction and prediction: Extract the semantic vector e_Implicit of [Implicit] from the BERT output, map it to the logits of the three relationship categories through a linear layer (weight matrix W_rel, dimension 768×3), and then calculate the probability of each category using the softmax function: Formula: p_i=exp(W_rel_i×e_Implicit) / Σ(exp(W_rel_j×e_Implicit)) (i=1,2,3, corresponding to the three relationships). ③ Training objective: Minimize the "cross-entropy loss between predicted probability and true label" (true labels are determined by manually labeled inter-sentence relationships), maximizing the model's prediction probability for the correct relationship category. ④ Training parameters: learning rate 2e-5, batch size 16, 10 training epochs, using the AdamW optimizer.

[0102] Task 2: General Semantic Enhancement (S232) Objective: To enable the model to learn the general semantics of text, providing a "benchmark" for logical semantics and strengthening the adversarial effect. ① Text Masking: Randomly mask 15% of the non-symbolic words in the Prompt input sentence (following the BERT pre-training masking strategy: 80% replaced with [MASK], 10% replaced with random words, and 10% retained). ② Mask Prediction: Input the masked text into the BERT model, extract the semantic vector e_General of [G] (general semantic symbols, pre-added to the vocabulary), map it to logits of the vocabulary dimension through a linear layer, and predict the masked words. ③ Training Objective: Minimize the "cross-entropy loss between predicted words and original words," enabling the model to master general semantic rules. ④ Training Parameters: Consistent with Task 1, ensuring training stability.

[0103] Alternating Training and Adversarial Effect (S233) ① Training Process: After training one round of Task 1 (logic semantics), immediately follow with one round of Task 2 (general semantics), alternating for 20 rounds. Due to shared model parameters, the representation of general semantics will be interfered with during training Task 1; the representation of logical semantics will be interfered with during training Task 2, forming "semantic adversarial". ② Recognition Accuracy Verification: Every 5 rounds, the F1 score of implicit relation recognition is tested on the validation set (manually annotated inter-sentence relation dataset, containing 1000 sentence pairs). Training is stopped when the F1 score no longer improves for 3 consecutive rounds (fluctuation ≤ 0.5%). Finally, the implicit relation recognition F1 score is ≥ 85%, meeting the logical analysis requirements for summary generation.

[0104] (3) Definition of the generation matrix of the text relation matrix: Suppose the text contains N sentences, the matrix dimension is N×N, and the element M[i][j]=(R_ij,C_ij), where:

[0105] R_ij: The discourse relationship type between sentence i and sentence j (explicit causality / explicit contrast / explicit coordination / implicit causality / implicit contrast / implicit coordination / no relationship);

[0106] C_ij: Confidence level of the relation type (0-1, determined by the model's prediction probability; for example, if the prediction probability of implicit causality is 0.92, then C_ij = 0.92).

[0107] Matrix construction rules:

[0108] ① Only calculate the relationship between adjacent sentence pairs (i and i+1) (the relationship between non-adjacent sentences has little impact on the summary generation and can reduce the amount of computation), and set R_ij for non-adjacent sentence pairs to "no relationship" and C_ij=0;

[0109] ② Set C_ij for explicit relations to 1.0 (the connective is explicit and no model prediction is needed), and C_ij for implicit relations to be the model prediction probability;

[0110] Output: The discourse relation matrix (including inter-sentence relation types and confidence levels), together with the "discourse type labels" from step S21, constitutes the "discourse structure features".

[0111] Step S3: Dual-path scoring mechanism, output the first score and second score of the sentence.

[0112] Objective: To overcome the limitations of existing technologies that rely on "single-dimensional scoring," a dual-path scoring system combining "semantics and logic" is designed: Path 1 (deep neural network) focuses on "sentence semantic importance + discourse suitability," while Path 2 (improved TextRank) focuses on "sentence logical importance + discourse type matching," providing a comprehensive basis for subsequent score fusion.

[0113] Step S31: A deep neural network that integrates textual structure features outputs the first score.

[0114] Principle: The semantic features (word vectors) of a sentence are concatenated with the discourse features (discourse relation matrix features). A bidirectional GRNN captures sequence information, and an attention layer highlights important sentences. The final output is a first score reflecting both semantic and discourse fit. Specific operations:

[0115] (1) Input Feature Construction ① Sentence Word Vector Generation: The Word2Vec tool (pre-trained based on Chinese Wikipedia corpus, vector dimension 300) is used to map the word segmentation results of sentences into word vector sequences; for sentences with less than 10 words, "zero vector padding" is used; for sentences with more than 30 words, "truncation" is used, and the sentence length is uniformly set to 30, and the word vector sequence dimension is 30×300. ② Text Relationship Matrix Feature Extraction: For each sentence i, the features of the i-th row in the text relationship matrix (reflecting the relationship between sentence i and other sentences) are extracted, specifically:

[0116] Relation type encoding: Convert R_ij (implicit causality / implicit transition / implicit parallelism / explicit relation / no relation) into a One-Hot vector (dimension 5);

[0117] Confidence sequence: Extract the numerical sequence of C_ij (only keep the confidence of adjacent sentences, set non-adjacent sentences to 0), with a length of 3 (confidence of sentences i with i-1, i, i+1, padded with 0 if none).

[0118] Matrix eigenvector: The One-Hot vector is concatenated with the confidence sequence, with a dimension of 5+3=8.

[0119] ③ Input feature concatenation: The sentence word vector sequence (30×300) and the matrix feature vector (8-dimensional, expanded to 30×8 by repetition) are concatenated in the feature dimension to obtain the final input feature with a dimension of 30×308.

[0120] (2) Bidirectional GRNN layer encoding: Bidirectional GRNN (Generalized Regressive Neural Network) is used to capture the sequence dependencies between the contextual semantics of sentences and the discourse relationship (such as time series of narratives, definition-feature sequences of descriptives):

[0121] Structural design: The hidden layer has a dimension of 128, divided into a forward GRNN (processing the sequence from left to right) and a backward GRNN (processing the sequence from right to left); the activation function used is Tanh (to alleviate gradient vanishing and adapt to sequence modeling).

[0122] Encoding process: Input features (30×308) are input into forward and backward GRNNs respectively to obtain hidden layer outputs in two directions (30×128 each); the outputs in the two directions are concatenated in the hidden layer dimension to obtain the bidirectional GRNN encoding result with a dimension of 30×256.

[0123] Sentence vector generation: Average pooling (preserving global information) is performed on the bidirectional GRNN encoding results to obtain the sentence vector with a dimension of 256.

[0124] (3) Calculation of the first score by the attention layer: The attention layer is used to highlight sentences that are "more relevant to the global theme of the text and have higher text adaptation": ① Generation of global text vector: Calculate the average of all sentence vectors to obtain the global text vector (dimension 256), which reflects the overall theme and text logic of the text. ② Calculation of attention weight: The similarity between the sentence vector of each sentence and the global vector is calculated using "scaled dot product attention" as the attention weight: Formula: AttentionWeight(i)=(sentence vector i×global vector^T) / sqrt(256) (sqrt(dimension) is used for scaling to avoid gradient explosion); The weights are normalized by softmax to ensure that the sum of the weights is 1. ③ Output of the first score: The normalized attention weights are used as the first score (between 0 and 1). The higher the weight, the stronger the semantic importance and text adaptation of the sentence.

[0125] Output: The first score for each sentence (semantic importance + discourse fit, 0-1).

[0126] Step S32: Introduce an improved TextRank with document type weighting and output the second score.

[0127] Principle: Traditional TextRank scores sentences based solely on similarity, ignoring text type differences. This step adjusts sentence importance through "text type weighting" (e.g., highlighting time-marked sentences in narrative texts and definition-marked sentences in descriptive texts), and optimizes the calculation of inter-sentence relevance by combining text relationship similarity, outputting a second score reflecting "logical importance." Specific operations:

[0128] (1) Traditional TextRank Basics Traditional TextRank treats sentences as nodes in a graph, and the similarity between sentences as the weights of edges. It calculates the importance of nodes iteratively:

[0129] Iterative formula: WS(i)=(1-d)+d×Σ(WS(j)×Sim(i,j) / Σ(Sim(k,j))), where d=0.85 (damping coefficient), Sim(i,j) is the similarity between sentences i and j, and WS(i) is the importance score of sentence i.

[0130] (2) Adjusting the weight of text type: Based on the text type labels in step S21, set differentiated weights for sentences of different types and adjust the initial importance of sentences:

[0131] Narrative text: For sentences containing "time markers", the initial weight is set to 1.2-1.5 (time sequence is the core logic of narrative text, and the weight increases as the marker appears later).

[0132] Explanatory text: For sentences containing "definition markers", the initial weight is set to 1.3-1.6;

[0133] Argumentative texts: For sentences containing "argument markers", the initial weight is set to 1.1-1.4;

[0134] Weighting: The initial weights are multiplied by the results of the traditional TextRank iterations to obtain the adjusted intermediate scores.

[0135] (3) Optimization of text relation similarity: Traditional TextRank's sentence similarity is based solely on word vectors, ignoring text relations; this step combines the text relation matrix to optimize similarity calculation:

[0136] Similarity formula: Sim(i,j)=0.7×WordSim(i,j)+0.3×RelSim(i,j), where:

[0137] WordSim(i,j): Based on the cosine similarity (0-1) of word vectors, it reflects the similarity at the word level;

[0138] RelSim(i,j): Based on the similarity of textual relationships (causal relationship → 0.9, adversative relationship → 0.7, parallel relationship → 0.5, no relationship → 0.1), it reflects the degree of logical relevance;

[0139] Optimization effect: If sentences i and j have a causal relationship, even if the word vector similarity is low (0.4), Sim(i,j)=0.7×0.4+0.3×0.9=0.55, it can still reflect the logical connection.

[0140] (4) The second score output normalizes the adjusted intermediate score (between 0 and 1) to obtain the second score. The higher the score, the stronger the logical importance of the sentence (such as narrative time marker sentences and explanatory definition sentences).

[0141] Output: The second score for each sentence (logical importance, 0-1).

[0142] Step S4: The logistic regression model is used to fuse scores, outputting the fusion score for each sentence.

[0143] Objective: To address the limitations of a single score by using a logistic regression model to weight and fuse the "first score (semantic + discourse fit)" and the "second score (logical importance)," thereby obtaining a fused score that reflects "comprehensive importance" (providing a unique basis for subsequent sentence selection). Specific steps:

[0144] (1) Logistic regression model training model essence: binary classification logistic regression (label 1 means "sentence should be included in the summary", 0 means "sentence should not be included"), but here it is used for "score fusion" (output probability as fusion score, between 0 and 1).

[0145] Training data construction:

[0146] ①Data source: 100 texts of each of the three types (narrative / explanatory / argumentative) were selected. Each text was manually labeled with the "abstract importance tag" (1 / 0) of the sentences, for a total of 300 texts × 20 sentences = 6000 samples;

[0147] ②Features and Labels: Features are "First Score" and "Second Score" (both normalized to 0-1); Labels are manually labeled 1 / 0;

[0148] ③ Data partitioning: The data was partitioned into a training set (4200 samples), a validation set (1200 samples), and a test set (600 samples) in a ratio of 7:2:1.

[0149] Model training:

[0150] ①Loss function: Log loss (LogLoss), formula: Loss=-Σ(y_i×log(p_i)+(1-y_i)×log(1-p_i)), where y_i is the true label and p_i is the model prediction probability;

[0151] ② Optimizer: SGD (Stochastic Gradient Descent) is used, with a learning rate of 0.01 and a momentum of 0.9 (to accelerate convergence);

[0152] ③ Regularization: Add L2 regularization (to prevent overfitting), with a regularization coefficient λ=0.001;

[0153] ④ Training termination condition: The log loss of the validation set no longer decreases for 5 consecutive rounds (fluctuation ≤ 0.001), or the training rounds reach 50 rounds.

[0154] (2) After training, the logistic regression model learns the weights of the two features (w1 is the first score weight, w2 is the second score weight, w1+w2=1), and the fusion score formula is:

[0155] The fusion score (i) = σ(w1 × first score (i) + w2 × second score (i) + b), where σ is the sigmoid function (maps the result to 0-1) and b is the model bias term (learned through training).

[0156] Weight explanation: Through cross-validation optimization, the final weights are usually w1=0.6 (semantics is more important) and w2=0.4 (logic is auxiliary), ensuring that the fusion score takes into account both semantics and logic.

[0157] (3) Verification of fusion score: Verify the effectiveness of fusion score on the test set: Calculate the "Pearson correlation coefficient between fusion score and manually labeled label" (to measure correlation), and require the correlation coefficient to be ≥0.85 to ensure that the fusion score can accurately reflect the overall importance of the sentence.

[0158] Output: The fusion score (overall importance, 0-1) for each sentence. The higher the score, the more likely the sentence should be selected as the target sentence.

[0159] Step S5: Filter target sentences based on a submodular function weighted by discourse relations and a greedy algorithm.

[0160] Objective: To address the problem that existing greedy algorithms, which filter solely by score, can lead to information redundancy or logical breaks, we will use a submodular function that weights sentences based on discourse relationships to ensure that the selected sentences balance "high importance" and "low redundancy" while also conforming to the logical coherence of the discourse.

[0161] Step S51: Design the submodular function for weighted chapter relationships

[0162] Principle: The submodular function has the characteristic of "diminishing marginal returns" (the gain of a new sentence decreases as the number of selected sentences increases), naturally adapting to the need for "redundancy removal"; the introduction of discourse similarity weights further ensures the logical coherence between new sentences and selected sentences (e.g., if a "cause sentence" is selected, a "result sentence" is preferred over another "cause sentence"). Specific submodular function form: Let S be the set of selected sentences, k be the sentences to be selected, and f(S) be the submodular function value of set S (reflecting a comprehensive index of the set's "importance-redundancy"). The submodular function is defined as:

[0163] f(S∪{k})=f(S)+α×fusion score(k)×(1-Sim(k,S)) Explanation of parameters:

[0164] α: Text type adjustment coefficient (narrative type α=1.2, expository type α=1.3, argumentative type α=1.1), determined by the logical importance of the text type (expository type requires stricter logic, so α is higher).

[0165] Fusion score (k): The fusion score of candidate sentence k (higher scores contribute higher gains);

[0166] Sim(k,S): The similarity in textual relations between the candidate sentence k and the selected set S (reflecting redundancy), calculated as follows:

[0167] If S is empty, Sim(k,S)=0 (no redundancy);

[0168] If S is not empty, Sim(k,S) = average(Sim(k,j)forjinS), where Sim(k,j) is the discourse similarity between sentences k and j (causal relationship Sim=0.8-1.0, contrast relationship Sim=0.6-0.8, parallel relationship Sim=0.4-0.6, no relationship Sim=0.2).

[0169] Function meaning: The gain of the new sentence k = α × importance of k × (1 - redundancy), ensuring that sentences with high importance and low redundancy are selected first.

[0170] Step S52: Calculate the processed score and the target score

[0171] Objective: To obtain the target score by weighted summation of the scores processed by the submodular function, providing a selection criterion for the greedy algorithm. Specific steps:

[0172] (1) Design of multi-dimensional submodular functions

[0173] To improve the redundancy removal effect, two submodular functions are designed to cover different dimensions:

[0174] Function 1: Weighted modulo function for textual relations;

[0175] Function 2: Semantic similarity weighted submodular function (replacing Sim(k,S) with "semantic similarity between sentence k and S", based on sentence vector cosine similarity, focusing on semantic redundancy).

[0176] (2) Calculation of score after processing

[0177] Each sentence k is input into two submodular functions to obtain two processed scores (f1(k,S) and f2(k,S)).

[0178] (3) Weighted sum of target scores

[0179] Weights are assigned to the two processed scores (w_f1=0.7, focusing on logic; w_f2=0.3, focusing on semantics), with the target score formula as follows:

[0180] Target score (k,S) = w_f1×f1(k,S) + w_f2×f2(k,S)

[0181] Output: The target score for each candidate sentence (reflecting the combined effect of gain and redundancy).

[0182] Step S53: Greedy algorithm to select target sentences

[0183] Principle: The greedy algorithm achieves global approximation through "local optimal selection" (the submodular function guarantees that the approximation ratio of the greedy selection is ≥1-1 / e≈0.63), selecting target sentences that "have high target scores and conform to the logical coherence of the passage." Specific operation:

[0184] (1) Filtering initialization

[0185] Initialize the set of selected sentences S = empty set, and the set of sentences to be selected K = all sentences;

[0186] Set a summary length threshold: This is determined based on the total number of sentences in the text, usually 20%-30% of the total number of sentences, or a fixed length.

[0187] (2) Greedy selection iterative loop executes the following steps until the size of S reaches the summary length threshold: ① For each sentence k in K, calculate the target score target score (k, S); ② Select the sentence k_max with the highest target score and add it to S; ③ Delete k_max from K (to avoid duplicate selection); ④ Check logical coherence: If the chapter relation sequence of S violates the logical rules of the corresponding type after adding k_max, then abandon k_max, select the sentence with the second highest score, and re-check.

[0188] (3) After the target sentence output iteration terminates, S is the set of selected target sentences, arranged in the order of sentences in the original text (ensuring that the logical order of the summary is consistent with the original text).

[0189] Output: A set of target sentences arranged in the original text order.

[0190] Step S6: Post-processing to generate the final summary

[0191] Objective: To eliminate format noise, semantic redundancy, and logical conflicts in the target sentence combination, optimize the readability and timeliness of the abstract, and generate a high-quality final abstract. Specific processing steps:

[0192] (1) Generate an initial summary: Connect the target sentences directly in the order of the original text to form an initial summary (preserve the original punctuation and expression of the sentences, do not rewrite them, and avoid semantic deviation).

[0193] Example: Target sentence set = {sentence 2, sentence 4, sentence 5} → Initial summary: "First, the heavy rainfall brought by Typhoon Haiyan caused severe flooding in some areas; subsequently, the local emergency management department activated the emergency response and organized the evacuation of people; finally, as of August 12, the floodwaters had basically receded and power was gradually restored."

[0194] (2) Watermark Removal Processing: Remove watermark information that may exist in the initial digest.

[0195] Recognition rules: Use regular expressions to match common watermark formats;

[0196] Processing method: Directly delete the matched watermark text; if the watermark is embedded in the middle of the sentence, delete the watermark part and retain the core content.

[0197] (3) Deduplication and normalization eliminate semantically repetitive sentences in the initial summary to ensure concise information:

[0198] Duplicate detection: Calculate the semantic similarity between sentences (based on sentence vector cosine similarity). If the similarity is ≥0.8 (the threshold is optimized through the validation set), it is determined to be duplicate.

[0199] Processing method: Keep the sentence with the higher integration score among repeated sentences and delete other repeated sentences; if the scores are similar, keep the sentence that appears earlier in the text (to conform to the logic of the original text).

[0200] (4) Chapter Logical Consistency Verification (Core Post-Processing Step): Ensures that the chapter relation sequence of the final summary conforms to the logical rules of the corresponding chapter type, and solves the problem of "logical breaks that may still exist after target sentence screening" (supplement to step S53):

[0201] Step S61: Extract the chapter relation sequence of the initial summary

[0202] For adjacent sentence pairs in the initial summary, extract R_ij from the discourse relation matrix to form a discourse relation sequence.

[0203] Step S62: Logical rule matching

[0204] Pre-defined logical rules for each text type (based on linguistic principles and human summarization):

[0205] Narrative: Must conform to "chronological order" or "causal order", "reverse chronological order" and "reversed causality" are prohibited;

[0206] Explanatory text: Must conform to "definition → characteristics → application" or "general overview → specific details", and "characteristics → definition" or "specific details → general overview" are prohibited (unless there is an explicit summary marker);

[0207] Argumentative essays must conform to the format of "argument → evidence 1 → evidence 2 → conclusion" or "evidence → argument". The format of "conclusion → evidence → argument" is prohibited (as it is logically inconsistent).

[0208] Judgment: If the sequence of chapter relationships conforms to the rules, the verification passes; otherwise, it is judged as a logical conflict.

[0209] Step S63: Conflict Correction

[0210] If logical conflicts exist, use "sentence replacement" or "sentence supplementation" to correct them:

[0211] Sentence replacement: Select the sentence that is logically coherent with the selected sentence and has the second highest integration score from the candidate sentence set K, and replace the conflicting sentence;

[0212] Sentence supplementation: If key logical links are missing, select corresponding sentences from the original text to supplement them (they must meet the requirement of a fusion score ≥ 0.5, and avoid introducing low-importance sentences).

[0213] Example: The initial summary relation sequence is "implicit causality → implicit transition" (narrative type, should be causal / chronological order) → conflict. The transition sentence is replaced with a causal sentence, and the corrected sequence is "implicit causality → implicit causality", which passes the validation.

[0214] (5) Timeliness optimization: Set reasonable expiration times for abstracts of different article types (to solve the problem of existing abstracts "lacking timeliness labeling and misleading users with outdated information")

[0215] Narrative (Event-Related): Extracts the event end time from the text, and sets the expiration time to a preset time period after the event ends;

[0216] Description (Technology-related): Extracts the technology version / update time, and sets the expiration time to the technology update time;

[0217] Argumentative (opinion-related): Monitors subsequent related texts. If the opinion is refuted or updated, the expiration time is set to the refutation / update time.

[0218] Timeliness annotation: Add a timeliness annotation at the end of the final summary.

[0219] Output: A final summary that is watermark-free, non-redundant, logically coherent, and includes timeliness annotations, which can be directly used by users for reading.

[0220] The above embodiments are only used to illustrate the technical solutions of the embodiments of this application, and are not intended to limit them. Although the embodiments of this application have been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features, without departing from the spirit and scope defined by the claims of this application.

Claims

1. A content summary generation method based on discourse structure analysis, characterized in that, Includes the following steps: S1: Receive the original text, preprocess the original text to obtain standardized text content, the preprocessing includes at least one of web page character escaping, full-width character to half-width character conversion, segmentation operation, sentence segmentation operation and word segmentation operation; S2: Perform in-depth analysis of the standardized text content to obtain text structure features, which include text type labels and a text relationship matrix, wherein: S21: Identify the text type of the standardized text content by extracting paragraph keywords and matching syntactic patterns. The text type includes narrative, expository, and argumentative texts. S22: Introduce special symbols [Explicit] representing explicit discourse relations and [Implicit] representing implicit discourse relations, and insert the special symbols into the sentence positions of the standardized text content to construct the Prompt input sentence; S23: Encode the Prompt input sentence using a pre-trained language model to obtain semantic vectors of [Explicit] and [Implicit], and strengthen implicit discourse relationship recognition by combining semantic adversarial training to generate a discourse relationship matrix covering causal, adversarial, and parallel relationships between sentences; S3: A dual-path scoring mechanism is used to score each sentence in the standardized text content: S31: Construct a deep neural network model that integrates discourse structure features. Input the word vectors of sentences into the model after concatenating them with the corresponding discourse relation matrix features, and output the first score of each sentence. S32: A text ranking algorithm that incorporates text type weights is adopted, which sets differentiated weights for sentences of different text types and outputs the second score for each sentence; S4: A pre-trained logistic regression model is used to process the first and second scores of each sentence to obtain a fused score for each sentence; S5: Target sentence selection based on a submodular function weighted by discourse relations and a greedy algorithm: S51: Introduce a text relation similarity weight in the submodular function, wherein the text relation similarity weight is assigned a value according to the text relation type between sentences; S52: The fusion score of each sentence is processed by the submodular function to obtain the processed score, and the processed scores are weighted and summed to obtain the target score; S53: Based on the greedy algorithm and the target score, select at least one target sentence that satisfies the logical coherence of the text; S6: Generate an initial summary based on the at least one target sentence, and perform post-processing on the initial summary to obtain a final summary. The post-processing includes at least one of watermark removal, deduplication and normalization, and text logic consistency verification.

2. The content summary generation method based on text structure analysis according to claim 1, characterized in that, Step S23 combines semantic adversarial training to enhance implicit discourse relation recognition, specifically including: S231: Construct a logical semantic enhancement task: extract implicit relation features from [Implicit] semantic vectors, train the model to predict implicit text relation categories, and maximize the prediction probability; S232: Construct a general semantic enhancement task: Randomly cover some words in the Prompt input sentence, train the model to predict the covered words, and enhance the general semantic understanding; S233: Alternately execute S231 and S232, and use semantic adversarial effects to free implicit discourse relationship features from general semantic interference, thereby improving recognition accuracy.

3. The content summary generation method based on text structure analysis according to claim 1, characterized in that, The deep neural network model that integrates textual structure features in step S31 includes a bidirectional GRNN layer and an attention layer: The bidirectional GRNN layer encodes the concatenated vector of the word vectors and the features of the discourse relation matrix to obtain the sentence vector; The attention layer calculates the attention weights between the global text vector and the sentence vector, adjusts the importance of the sentence vector based on the attention weights, and outputs the first score.

4. The content summary generation method based on text structure analysis according to claim 1, characterized in that, The text ranking algorithm that introduces document type weights in step S32 is an improved TextRank algorithm: For narrative texts, sentences containing time markers should be weighted 1.2-1.5 times. For descriptive text, sentences containing definition tags should be given a weight of 1.3-1.6 times. For argumentative texts, sentences containing argument markers are given a weight of 1.1-1.4 times.

5. The content summary generation method based on discourse structure analysis according to claim 1, characterized in that, The submodular function for weighted text relation in step S51 is as follows: Let the set of sentences be S, the candidate sentences be k, and the discourse similarity be Sim(k,S) (Sim(k,S) is assigned a value based on the discourse relationship type between k and the sentences in S: causal relationship Sim=0.8-1.0, contrast relationship Sim=0.6-0.8, and parallel relationship Sim=0.4-0.6). The submodular function is: f(S∪{k})=f(S)+α×fusion score(k)×(1-Sim(k,S)) Where α is the text type adjustment coefficient (narrative type α=1.2, expository type α=1.3, argumentative type α=1.1).

6. The content summary generation method based on discourse structure analysis according to claim 1, characterized in that, Step S6, the chapter logic consistency check, specifically includes: S61: Extract the discourse relation sequence of sentences in the initial summary; S62: Determine whether the sequence of chapter relationships conforms to the logical rules of the corresponding chapter type; S63: If it does not meet the requirements, replace or supplement the sentence so that the sequence of paragraph relationships satisfies the logical rules.

7. The content summarization method based on discourse structure analysis according to claim 1, characterized in that, Step S6 also includes timeliness optimization processing: Determine the timeliness attribute of the abstract based on the type and relationship between the texts: In narrative-based events, the expiration time for event-related summaries is set to a preset time period after the event ends. In the description category, the technical specification summary should have its expiration date set to the technology update date; For opinion summaries in the argument category, the expiration time is set to the time when the opinion is refuted or updated.

8. The content summary generation method based on discourse structure analysis according to claim 1, characterized in that, In step S21, the paragraph topic word extraction uses a combination of TF-IDF and TextRank. S211: Calculate the TF-IDF values ​​of words in the paragraph and filter the top 20 words; S212: Construct a co-occurrence network for the TOP20 words, use the TextRank algorithm to calculate word importance, and select the TOP5 topic words; S213: Determine the text type by matching the TOP5 keywords with the preset text type thesaurus.

Citation Information

Patent Citations

  • Long-text structured text abstract extraction method

    CN110781290A

  • Document template automatic generation method and system based on recurrent neural network language model

    CN112541337A