A Chinese news text summarization method combining contrastive learning and pre-training techniques

By combining contrastive learning and pre-training technology, back-translation and entity replacement are used to construct input data, and BERT and MT5 models are used to generate summaries, which solves the problem of low summary quality in the existing technology and achieves Chinese news that is more faithful to the original text and of high quality. Text summary.

CN114880461BActive Publication Date: 2024-10-15DALIAN UNIV OF TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210623480.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-06-02
Publication Date
2024-10-15
Estimated Expiration
2042-06-02

AI Technical Summary

Technical Problem

Existing Chinese news text summarization methods have problems such as poor quality summary results, easy generation of duplicate content and false content, inability to effectively utilize the semantic information of Chinese news text, and lack of interpretability and application value.

Method used

Using a method that combines contrastive learning and pre-training technology, the contrastive learning input data is constructed through back translation and entity replacement, the fine-tuned BERT and MT5 models are used to obtain context vector representation and generate summary results, and the AECLoss loss function is used to implement extraction and generation End-to-end training of the model.

Benefits of technology

The generated summary results are more faithful to the original text, improve the interpretability and summary effect of the model, can more effectively focus on the key content in the news text, and improve the continuity and readability of the summary results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114880461B_ABST
    Figure CN114880461B_ABST
Patent Text Reader

Abstract

The present invention proposes a Chinese news text summarization method combining contrastive learning and pre-training technology, including (1) constructing contrastive learning input data; (2) using the BERT pre-training model fine-tuned with Chinese news corpus to obtain the context vector representation of the news text, classifying and scoring the sentences in the text, extracting candidate sentences containing key information to obtain a candidate sentence set; (3) inputting the candidate sentence set into the MT5 model fine-tuned with Chinese news corpus to generate a summary result; (4) combining the AECLoss loss function to realize end-to-end training of the extractive model and the generative model. The present invention can combine contrastive learning to obtain a summary result that is more faithful to the original content; by combining external knowledge, the semantic representation ability of the pre-training model on the news text is improved; by using the summary method of first extracting and then generating, the model fully pays attention to the key content in the news text, effectively improving the interpretability of the model and the continuity and readability of the summary result.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the field of natural language processing, and relates to a Chinese news text summarization method based on a neural network, and in particular to a Chinese news text summarization method combining contrastive learning and pre-training technology. Background Art

[0002] In the field of natural language processing, text summarization technology has become a hot research direction for scholars at home and abroad. Research on text summarization technology based on Chinese news corpus has become an important part of summarization research. With the rapid development of social media networks such as Weibo and Toutiao, a large number of news texts have appeared on social media networks in the form of original links. Therefore, it is very important to propose an effective Chinese news summary method. The use of text automatic summarization technology can avoid the situation where manual news text summarization requires a lot of human resources, help people free themselves from the ocean of information, improve text reading efficiency, and help people adapt to the fast-paced life in the era of information explosion.

[0003] At present, most Chinese summary datasets use news texts, mainly because news has distinct text features, such as language standardization, news key content is mainly concentrated at the beginning and end of the news, and the title contains key content. Compared with general field texts, more standard news texts are more conducive to model generation of summaries. Common Chinese news summary datasets include: NLPCC2015 evaluation task 4 summary dataset, data from Sina Weibo; NLPCC2017 evaluation task 3 summary dataset, data from Toutiao; LCSTS summary dataset, collected by Harbin Institute of Technology Shenzhen Graduate School using Weibo crawler.

[0004] So far, there are three common text summarization methods: extractive summarization method, generative summarization method and hybrid summarization method. The extractive summarization method directly extracts words and sentences from the original text as the summary result, and often uses machine learning models and deep learning models to score and sort the original text to screen the summary results containing key content. For example, extracting summaries based on unsupervised iterative graph-based ranking algorithms; using artificial features to score the importance of sentences and words; such as summary extraction methods based on nested trees and pre-trained language models. The generative summarization method generates summary results that are not completely derived from the original text by performing a series of operations such as paraphrasing and replacing the input text. For example, the summary result generation based on the sequence-to-sequence model; such as combining the sequence-to-sequence model and the attention mechanism to solve the long-distance dependency problem; such as the pointer generator network model combining the copy mechanism and the coverage mechanism. The hybrid summary method combines the extractive summary method and the generative summary method by extracting first and then generating. For example, using reinforcement learning to train the extractive model and the generative model at the same time; such as using the consistency loss function to train the two models end-to-end. However, the above three summarization methods have the problems of poor summary quality, easy generation of duplicate content, and easy generation of false content, and cannot be implemented in the field of Chinese news summarization.

[0005] To sum up, how to make full use of the semantic information of Chinese news text, generate summary results with less repetitive content, make the summary content of Chinese news more faithful to the original text, build a Chinese news text summary model with strong interpretability and good summary effect, and make it have high application value in the field of Chinese news is the problem that needs to be solved at this stage. Summary of the invention

[0006] In order to overcome the shortcomings of existing summary technologies, the present invention provides a Chinese news text summary method that combines contrastive learning and pre-training technology. The method first uses back translation and entity replacement to construct contrastive learning input data; secondly, the BERT pre-training model fine-tuned with Chinese news corpus is used to obtain the context vector representation of the news text, classify and score the sentences in the text, extract candidate sentences containing key information to obtain a candidate sentence set; then the obtained candidate sentence set is input into the MT5 model fine-tuned with Chinese news corpus to generate a summary result; finally, the AECLoss loss function proposed in the present invention is combined to realize end-to-end training of the extractive model and the generative model.

[0007] The technical solution adopted by the present invention is: a Chinese news text summarization method combining contrastive learning and pre-training technology, comprising the following steps:

[0008] Construct contrastive learning input data using back translation and entity replacement;

[0009] Use the BERT pre-trained model fine-tuned with Chinese news corpus to obtain the context vector representation of the news text, classify the sentences in the text, and extract a set of candidate sentences;

[0010] The extracted candidate sentence set is input into the MT5 pre-trained model fine-tuned with Chinese news corpus to generate summary results;

[0011] Combined with the proposed AECLoss loss function, end-to-end training of extractive models and generative models is achieved.

[0012] Furthermore, in step (1), constructing contrastive learning input data by back-translation and entity replacement includes:

[0013] Use translation software to translate Chinese news into English, and then use the translation software again to translate the translated English text back into Chinese, and get the back-translated Chinese news text as positive data; use SWAPENT to randomly replace entities in the news text, and use the Chinese news text after replacing the entity as negative data.

[0014] Furthermore, in step (2), adjusting the BERT pre-training model in combination with the Chinese news corpus includes:

[0015] Adjust the pre-trained model BERT by crawling various news websites to obtain Chinese news or finding open source Chinese news corpus.

[0016] Furthermore, in step (2), the context vector representation of the news text obtained using the BERT pre-trained model is as follows:

[0017] (a) The BERT model is mainly based on a dictionary C of size M generated based on the WordPiece method. M}, extract the Chinese news text sequence W = {w1,w2,…,w N}, the word vector corresponding to each word in the sentence is:

[0018] V i = {v i1 ,v i2 ,…,v ip} (1)

[0019] Where V i represents the i-th word in the sentence, p is the word vector dimension in the dictionary, and v ip Represents the p-th dimensional vector of the i-th word in the sentence;

[0020] (b) The BERT pre-training model needs to obtain the vector matrix D, position matrix P and context matrix F of the input text sequence, which respectively record the word vector, the position of the word in the dictionary, and whether the sentence to which the word belongs is the context of the original sentence; the three vector matrices are combined to obtain the input vector matrix Z of the BERT model. 0 , the specific calculation formula is:

[0021] Z 0 =D+P+F (2)

[0022] (c) The BERT model is composed of multiple identical Transformer encoder modules stacked together to transform the input vector matrix Z 0 Input to the self-attention sublayer and the fully connected sublayer in the encoder module to obtain the output vector matrix Z 1 , the specific calculation formula in the self-attention sublayer is:

[0023] Q R =Z R-1 P 1 +b 1 (3)

[0024] K R =Z R-1 P 2 +b 2 (4)

[0025] V R =Z R-1 P 3 +b 3 (5)

[0026]

[0027] Where P 1 , P 2 , P 3 、b 1 、b 2 、b 3 is the weight parameter of the attention mechanism obtained through training, Q R , K R 、V R are the values ​​of Q, K, and V calculated in the Rth vector output matrix, respectively. R is the output matrix calculated by the self-attention sublayer after the softmax normalization operation in the Rth vector output matrix;

[0028] (d) The output matrix O of the Rth self-attention sub-layer R As input, after passing through the fully connected sublayer, the context vector representation of the text is calculated; the specific calculation formula of the fully connected sublayer that introduces the GELUs activation function is:

[0029] Y R = gelu(O R P 4 +b 4 ) (7)

[0030] Where P 4 、b 4 is the weight parameter of the attention mechanism obtained through training.

[0031] Furthermore, the classification of sentences in the text in step (2) is specifically represented as follows:

[0032] (a) The context vector h obtained by using the BERT pre-training model is input into the Bi-LSTM to further extract the semantic information of the context. The specific calculation formula is:

[0033]

[0034]

[0035]

[0036] and represents the hidden state vector of the forward GRU and the reverse GRU at time t, which is respectively composed of the input vector x at the current time t and the hidden state vector h at the current direction at the previous moment t-1 、h t+1 get; will and After splicing, we get the current hidden state vector h t ;h t Contains hidden layer states in two directions;

[0037] (b) After using Bi-LSTM to further obtain higher-dimensional semantic information from the text, the sentence vector set is sent to the fully connected layer to determine whether the current sentence is a candidate sentence; the model combines contrastive learning and uses the loss function L ext-CL As the loss function of the extractive summarization model, the specific calculation formula is as follows:

[0038]

[0039] in Calculate positive pairs Negative Example , τ is the temperature coefficient, which determines the degree of attention paid by the contrast loss to difficult negative samples.

[0040] Furthermore, in step (3), adjusting the MT5 pre-training model in combination with the Chinese news corpus includes:

[0041] Get Chinese news from news websites or find open source Chinese news corpus to adjust the MT5 pre-trained model so that the model can obtain better semantic representation of Chinese news.

[0042] Furthermore, in step (3), when generating the summary result using the MT5 pre-trained model, the model uses the extracted candidate sentence set as the input of the MT5 pre-trained model, and obtains the final text summary result by encoding and decoding the news text;

[0043] The MT5 pre-trained model uses relative position embeddings instead of absolute position embeddings, and introduces relative encoding information in the model's Attention calculation process to solve the problem that the model is insensitive to the position of words in the text and help the model distinguish words in different positions.

[0044] Furthermore, in step (3), when using the MT5 pre-trained model to generate the summary result, the model decoding part introduces a copy mechanism, which allows the model to directly copy words from the original text or directly generate new words from the vocabulary, including:

[0045] (a) Given an input text sequence W = {w1,w2,…,w N}, introduce the attention distribution a at time t t Adjust the distribution weight. The specific calculation formula is:

[0046] p ti =z T tanh(H1h i +H2s t +v1) (12)

[0047] a t =softmax(p ti ) (13)

[0048] Among them, z, H1, H2, and v1 are hyperparameters for calculating attention weights, and h i It is the hidden state sequence obtained after the words in the news text are passed into the encoder framework in the order of appearance;

[0049] (b) Using attention distribution a t Calculate the text information that needs attention at time t, combined with h i Get the weighted context vector h′ t , the specific calculation formula is:

[0050] h′ t =∑ i a ti hi (14)

[0051] (c) The context vector h′ t and the decoding state sequence s at time t t The concatenated result is input into the linear mapping to obtain the distribution result P of the prediction result at time t on the dictionary voc , the specific calculation formula is:

[0052] P voc =softmax(H3(H4[s t ,h′ t ]+v2)+v3) (15)

[0053] Among them, H1, H2, v2, and v3 are the hyperparameters obtained from model training. t ,h′ t ] represents the context vector h′ t and the decoding state sequence s at the current time t t The concatenation result of

[0054] (d) The model generates the probability P by calculating gen , to determine whether the model at time t needs to copy words from the original text or generate new words from the vocabulary that do not exist in the original text. The specific calculation formula is:

[0055]

[0056] Among them, m1, m2, m3, and v4 are hyperparameters obtained during model training, σ represents the sigmoid function, and w Nt is the input sequence in the decoder frame at the current time t.

[0057] Furthermore, in step (3), when using the MT5 pre-trained model to generate summary results, the model decoding part introduces a coverage mechanism to avoid generating too much redundant text content and improve the quality of the model's summary results, including:

[0058] (a) The model introduces the tracking vector c at time t t , track the generated words, add penalty coefficients to the generated words, and avoid generating too much redundant text content. The specific calculation formula is:

[0059] c t =∑ t‘ a t‘ (17)

[0060] (b) After the model combines the tracking vector, the new attention weight distribution a_new t The calculation formula is:

[0061] p_new ti =z T tanh(H5h i +H6s t +H7catch t +v5) (18)

[0062] a_new t =softmax(p_new ti ) (19)

[0063] Among them, z, H5, H6, H7, and v5 are hyperparameters for calculating attention weights;

[0064] (c) The target loss of the generative summary model and the coverage mechanism loss function are calculated as follows:

[0065]

[0066]

[0067] P(y|x1,x2,…,x n ) means that in x1,x2,…,x n The probability of generating y under the conditions that have already occurred; T already represents all moments, min(a t ,c t ) is used to obtain the attention weight a at time t t and the coverage mechanism score c at time t t The smaller value of .

[0068] Furthermore, in step (4), the proposed AECLoss loss function is combined to realize end-to-end training of the extractive model and the generative model; specifically, it includes:

[0069] Combined with the extractive model loss function L in formula (11) ext-CL , the generative model loss function L in formula (20) abs and the coverage mechanism loss function L in formula (21) cov Calculate the AECLoss loss function;

[0070] AECLoss = α1L ext-CL +α2L abs +α3L cov (twenty two)

[0071] α1, α2, and α3 are parameters obtained through model training.

[0072] The beneficial effect of the present invention is: a Chinese news text summarization method combining contrastive learning and pre-training technology, comprising the following steps: (1) constructing contrastive learning input data by back-translation and entity replacement, (2) using the BERT pre-training model fine-tuned with Chinese news corpus to obtain the context vector representation of the news text, classifying and scoring the sentences in the text, extracting candidate sentences containing key information to obtain a candidate sentence set; (3) inputting the obtained candidate sentence set into the MT5 model fine-tuned with Chinese news corpus to generate a summary result; (4) combining the AECLoss loss function proposed by the present invention to realize end-to-end training of the extractive model and the generative model. Compared with the existing technology, the present invention has the following advantages: it can combine contrastive learning to obtain a summary result that is more faithful to the original content; by combining external knowledge, the semantic representation ability of the pre-training model on the news text is improved; by using the summary method of extracting first and then generating, the model pays full attention to the key content in the news text, effectively improving the interpretability of the model and the continuity and readability of the summary result. BRIEF DESCRIPTION OF THE DRAWINGS

[0073] Figure 1 It is a flow chart of the steps of the method of the present invention.

[0074] Figure 2 This is a framework diagram of the Chinese news text summary model proposed by the present invention. DETAILED DESCRIPTION

[0075] The present invention will be further described below in conjunction with the accompanying drawings.

[0076] Example 1: Figure 1 As shown, the Chinese news text summarization method combining contrastive learning and pre-training technology includes the following steps:

[0077] Step 1: Based on the official training data, use back-translation and entity replacement to construct contrastive learning input data to achieve data enhancement:

[0078] (a) Use Google Translate to translate Chinese news into English, then use Google Translate to translate the English text back into Chinese, and obtain the back-translated Chinese news text as positive example data.

[0079] (b) Use SWAPENT to randomly replace entities in news texts. It can randomly replace different types of entities such as names and locations in the text, and use the Chinese news text after replacing the entities as negative example data.

[0080] Step 2: Use the BERT pre-trained model fine-tuned with Chinese news corpus to obtain the context vector representation of the news text, classify the sentences in the text, and extract a set of candidate sentences:

[0081] The present invention fine-tunes the BERT pre-trained model in combination with Chinese news corpus. By crawling news websites such as Sina Weibo and Toutiao to obtain Chinese news or finding open source Chinese news corpus, the pre-trained model BERT is fine-tuned, so that the model can obtain better semantic representation of Chinese news.

[0082] Use the BERT pre-trained model to obtain the context vector of the news text:

[0083] (a) The BERT model is mainly based on a dictionary C of size M generated based on the WordPiece method. M +, extract the Chinese news text sequence W of length N = {w1,w2,…,w N}, the word vector corresponding to each word in the sentence is specifically expressed as formula (1).

[0084] (b) The BERT pre-training model needs to obtain the vector matrix D, position matrix P and context matrix F of the input text sequence, which respectively record the word vector, the position of the word in the dictionary, and whether the sentence to which the word belongs is the context of the original sentence. Combining the three vector matrices, we can get the input vector matrix Z of the BERT model. 0 , specifically, the calculation formula (2).

[0085] (c) The BERT model is composed of multiple identical Transformer encoder modules stacked together to transform the input vector matrix Z 0 Input to the self-attention sublayer and the fully connected sublayer in the encoder module to obtain the output vector matrix Z 1 , the specific calculation formulas in the self-attention sub-layer are (3)~(6).

[0086] (d) The output matrix O of the Rth self-attention sub-layer R As input, after passing through the fully connected sub-layer, the context vector representation of the text is calculated. The specific calculation formula of the fully connected sub-layer that introduces the GELUs activation function is (7).

[0087] Classify sentences in a text:

[0088] (a) The context vector h obtained by using the BERT pre-training model is input into the Bi-LSTM to further extract the semantic information of the context, specifically as follows:

[0089] (b) After using Bi-LSTM to further extract higher-dimensional semantic information from the text, the sentence vector set is sent to the fully connected layer to determine whether the current sentence is a candidate sentence. The model combines contrastive learning and uses the loss function L ext-CLAs the loss function of the extractive summary model, it is calculated as formula (11)

[0090] Step 3: Input the obtained candidate sentence set into the MT5 model fine-tuned with Chinese news corpus to generate summary results:

[0091] When generating summary results using the MT5 pre-trained model, the model uses the extracted candidate sentence set as the input of the MT5 pre-trained model, and obtains the final text summary result by encoding and decoding the news text.

[0092] The MT5 pre-trained model uses relative position embeddings instead of absolute position embeddings, and introduces relative encoding information in the model's Attention calculation process to solve the problem that the model is insensitive to the position of words in the text and help the model distinguish words in different positions.

[0093] When using the MT5 pre-trained model to generate summary results, the model decoding part introduces a copy mechanism, allowing the model to directly copy words from the original text or generate new words directly from the vocabulary:

[0094] (a) Given an input text sequence W = {w1,w2,…,w N}, introduce the attention distribution a at time t t Adjust the distribution weights, specifically by calculating formulas (12) and (13).

[0095] (b) Using attention distribution a t Calculate the text information that needs attention at time t, combined with h i Get the weighted context vector h′ t , specifically, the calculation formula (14).

[0096] (c) The context vector h′ t and the decoding state sequence s at time t t The concatenated result is input into the linear mapping to obtain the distribution result P of the prediction result at time t on the dictionary voc , specifically, the calculation formula (15).

[0097] (d) The model generates the probability P by calculating gen , to determine whether the model at time t needs to copy words from the original text or generate new words from the vocabulary that do not exist in the original text. The specific calculation formula is (16).

[0098] When using the MT5 pre-trained model to generate summary results, the coverage mechanism is introduced in the model decoding part to avoid generating too much redundant text content and improve the quality of the model's summary results:

[0099] (a) The model introduces the tracking vector c at time t t , track the generated words, add penalty coefficients to the generated words, and avoid generating too much redundant text content, specifically as calculation formula (17);

[0100] (b) After the model combines the tracking vector, the new attention weight distribution a_new t The calculation formulas are (18) and (19).

[0101] (c) The calculation method of the target loss of the generative summary model and the coverage mechanism loss function is as shown in formulas (20) and (21).

[0102] Step 4: Combine the proposed AECLoss loss function to implement end-to-end training of the extractive model and the generative model. Specifically include:

[0103] In order to achieve end-to-end training of the extractive summary model and the generative summary model, a new AECLoss loss function is defined in the present invention, combined with the extractive model loss function L in formula (11): ext-CL , the generative model loss function L in formula (20) abs and the coverage mechanism loss function L in formula (21) cov The calculation method is as shown in formula (22).

[0104] AECLoss = α1L ext-CL +α2L abs +α3L cov (twenty two)

[0105] α1, α2, and α3 are parameters obtained from model training, and are specifically set to α1=3, α2=α3=1.

[0106] The method of the present invention adopts ROUGE-based automated evaluation index to evaluate the quality of the summary. In order to verify the effectiveness of the model proposed by the present invention, the present invention conducts experiments on the Weibo Chinese news summary dataset of NLPCC2015task4. According to the requirements of the evaluation official, a summary of no more than 60 Chinese characters is generated. The data examples in the dataset are shown in Table 1.

[0107] Table 1

[0108]

[0109] The ROUGE index of the model results proposed in the present invention is compared with the ROUGE index of the results of the commonly used generative summary models (GPT, UniLM) and hybrid summary models (Ext-Abs-RL, Ext-Abs-Inconsistency Loss) to prove the improvement in accuracy. In the generative summary model, the GPT model is a pre-trained model proposed in 2018 that uses a unidirectional Transformer (Dncoder) model structure for text generation; the UniLM model is a pre-trained model proposed in 2019 that uses a sequence-to-sequence pre-training method for training, which can be used for generation tasks. In the hybrid summary model, the Ext-Abs-RL model is a hybrid summary model proposed in 2018 that combines reinforcement learning training, and uses the ROUGE score of the generated summary as feedback to encourage the model to extract better candidate summary sentences; the Ext-Abs-Inconsistency Loss model is a hybrid summary model proposed in 2018 that combines Inconsistency Loss, which generates better summary results by reducing the inconsistency between word-level attention and sentence-level attention introduced by the model. The experimental results are shown in Table 2.

[0110] Table 2

[0111]

[0112] From the experimental results in Table 2, it can be seen that the model proposed in the present invention can obtain higher ROUGE indicators in the Chinese news summarization task compared with the common generative summarization model and the hybrid summarization model, indicating that the summary content generated by the proposed model contains more key information and is more consistent with the standard summary; compared with the summary effect of the existing hybrid summarization model, it can be shown that the model proposed in the present invention combines pre-training technology and contrastive learning, can capture the characteristics of news texts and obtain semantic representations of different semantic subspaces, and effectively improve the summary generation results of the model.

[0113] The method of the present invention has the following advantages: it can combine contrastive learning to obtain summary results that are more faithful to the original content; by combining external knowledge, the semantic representation ability of the pre-trained model on the news text is improved; by using the summary method of first extracting and then generating, the model can fully focus on the key content in the news text, effectively improving the interpretability of the model and the continuity and readability of the summary results.

Claims

1. A Chinese news text summarization method combining contrastive learning and pre-training techniques, It is characterized in that The following steps are involved: (1) Use back-translation and entity replacement to construct contrastive learning input data; (2) Using the BERT pre-trained model adjusted with Chinese news corpus to obtain the context vector representation of the news text, classify the sentences in the text, and extract a set of candidate sentences; the classification of the sentences in the text is specifically as follows: (a) The context vector h obtained by using the BERT pre-training model is input into the Bi-LSTM to further extract the semantic information of the context. The specific calculation formula is: and represents the hidden state vector of the forward GRU and the reverse GRU at time t, which is respectively composed of the input vector x at the current time t and the hidden state vector h at the current direction at the previous moment t-1 、h t+1 get; will and After concatenation, we get the hidden state vector h at the current moment t ;h t Contains hidden layer states in two directions; (b) After using Bi-LSTM to further obtain higher-dimensional semantic information from the text, the sentence vector set is sent to the fully connected layer to determine whether the current sentence is a candidate sentence; the model combines contrastive learning and uses the loss function L ext-CL As the loss function of the extractive summarization model, the specific calculation formula is as follows: in Calculate positive pairs Negative Example , τ is the temperature coefficient, which determines the degree of attention paid by the contrast loss to difficult negative samples; (3) The extracted candidate sentence set is input into the MT5 pre-trained model adjusted with Chinese news corpus to generate summary results; in the generation of summary results, the model decoding part introduces a coverage mechanism, which specifically includes: (a) The model introduces the tracking vector c at time t t , track the generated words, add penalty coefficients to the generated words, and avoid generating too much redundant text content. The specific calculation formula is: c t =∑ t‘ a t‘ (17) (b) After the model combines the tracking vector, the new attention weight distribution a_new t The calculation formula is: p_new ti =z T tanh(H 5 h i +H 6 s t +H 7 catch t +v 5 ) (18) a_new t =soiftmax(p_new ti ) (19) Among them, z, H 5 , H 6 , H 7 、v 5 is a hyperparameter when calculating the attention weight; (c) The target loss of the generative summary model and the coverage mechanism loss function are calculated as follows: P(y|x 1 ,x 2 ,…,x n ) means that in x 1 ,x 2 ,…,x n The probability of generating y under the conditions that have already occurred; T already represents all moments, min(a t ,c t ) is used to obtain the attention weight a at time t t and the coverage mechanism score c at time t t The smaller value of (4) Combine the proposed AECLoss loss function to achieve end-to-end training of extractive and generative models; specifically: Combined with the extractive model loss function L in formula (11) ext-CL , the generative model loss function L in formula (20) abs and the coverage mechanism loss function L in formula (21) cov Calculate the AECLoss loss function; AECLoss=α 1 L ext-CL +α 2 L abs +α 3 L cov (22)α 1 , α 2 , α 3 The parameters obtained by model training.

2. The Chinese news text summarization method combining contrastive learning and pre-training technology as claimed in claim 1, It is characterized in that In step (1), the contrastive learning input data is constructed by back-translation and entity replacement, including: Use translation software to translate Chinese news into English, and then use the translation software again to translate the translated English text back into Chinese, and get the back-translated Chinese news text as positive data; use SWAPENT to randomly replace entities in the news text, and use the Chinese news text after replacing the entity as negative data.

3. The Chinese news text summarization method combining contrastive learning and pre-training technology as claimed in claim 1, It is characterized in that In step (2), adjusting the BERT pre-training model based on the Chinese news corpus includes: Adjust the pre-trained model BERT by crawling various news websites to obtain Chinese news or finding open source Chinese news corpus.

4. The Chinese news text summarization method combining contrastive learning and pre-training technology as claimed in claim 1, It is characterized in that In step (2), the context vector representation of the news text obtained using the BERT pre-trained model is as follows: (a) The BERT model is based on a dictionary C of size M generated based on the WordPiece method. 1 ,c 2 ,…,c M }, extract the Chinese news text sequence W of length N = {w 1 ,w 2 ,…,w N }, the word vector corresponding to each word in the sentence is: V i ={v i1 ,v i2 ,…,v ip } (1) Where V i represents the i-th word in the sentence, p is the word vector dimension in the dictionary, and v ip Represents the p-th dimensional vector of the i-th word in the sentence; (b) The BERT pre-training model needs to obtain the vector matrix D, position matrix P and context matrix F of the input text sequence, which respectively record the word vector, the position of the word in the dictionary, and whether the sentence to which the word belongs is the context of the original sentence; the three vector matrices are combined to obtain the input vector matrix Z of the BERT model. 0 , the specific calculation formula is: Z 0 =D+P+F (2) (c) The BERT model is composed of multiple identical Transformer encoder modules stacked together to transform the input vector matrix Z 0 Input to the self-attention sublayer and the fully connected sublayer in the encoder module to obtain the output vector matrix Z 1 , the specific calculation formula in the self-attention sublayer is: Q R =Z R-1 P 1 +b 1 (3) K R =Z R-1 P 2 +b 2 (4) V R =Z R-1 P 3 +b 3 (5) Where P 1 , P 2 , P 3 、b 1 、b 2 、b 3 is the weight parameter of the attention mechanism obtained through training, Q R , K R 、V R are the values ​​of Q, K, and V calculated in the Rth vector output matrix, respectively. R is the output matrix calculated by the self-attention sublayer after the softmax normalization operation in the Rth vector output matrix; (d) The output matrix O of the Rth self-attention sub-layer R As input, after passing through the fully connected sublayer, the context vector representation of the text is calculated; the specific calculation formula of the fully connected sublayer that introduces the GELUs activation function is: Y R =gel(O R Q 4 +b 4 ) (7) Where P 4 、b 4 is the weight parameter of the attention mechanism obtained through training.

5. The Chinese news text summarization method combining contrastive learning and pre-training technology as claimed in claim 1, It is characterized in that In step (3), the MT5 pre-training model is adjusted based on the Chinese news corpus, including: Get Chinese news from news websites or find open source Chinese news corpus to adjust the MT5 pre-trained model so that the model can obtain better semantic representation of Chinese news.

6. The Chinese news text summarization method combining contrastive learning and pre-training technology as claimed in claim 1, It is characterized in that In step (3), when the MT5 pre-trained model is used to generate the summary result, the model uses the extracted candidate sentence set as the input of the MT5 pre-trained model, and obtains the final text summary result by encoding and decoding the news text; The MT5 pre-trained model uses relative position embedding instead of absolute position embedding, and introduces relative encoding information in the model's Attention calculation process.

7. The Chinese news text summarization method combining contrastive learning and pre-training technology as claimed in claim 1, It is characterized in that In step (3), when using the MT5 pre-trained model to generate summary results, the model decoding part introduces a copy mechanism, which allows the model to directly copy words from the original text or directly generate new words from the vocabulary, including: (a) Given an input text sequence W of length N, 1 ,w 2 ,…,w N }, introduce the attention distribution a at time t t Adjust the distribution weight. The specific calculation formula is: p ti =z T fishy 1 h i +H 2 S t +v 1 ) (12) a t =softmax(p ti ) (13) Among them, z, H 1 , H 2 、v 1 is a hyperparameter for calculating attention weights, h i It is the hidden state sequence obtained after the words in the news text are passed into the encoder framework in the order of appearance; (b) Using attention distribution a t Calculate the text information that needs attention at time t, combined with h i Get the weighted context vector h' t , the specific calculation formula is: h' t =∑ i a ti h i (14) (c) The context vector h' t and the decoding state sequence s at time t t The concatenated result is input into the linear mapping to obtain the distribution result P of the prediction result at time t on the dictionary voc , the specific calculation formula is: P voc =softmax(H 3 (H 4 [s t ,h' t ]+v 2 )+v 3 ) (15) Among them, H 3 , H 4 、v 2 、v 3 is the hyperparameter obtained from model training, [s t ,h' t ] represents the context vector h' t and the decoding state sequence s at the current time t t The concatenation result of (d) The model generates the probability P by calculating gen , to determine whether the model at time t needs to copy words from the original text or generate new words from the vocabulary that do not exist in the original text. The specific calculation formula is: Where m 1 、m 2 、m 3 、v 4 is a hyperparameter obtained during model training, σ represents the sigmoid function, and w Nt is the input sequence in the decoder frame at the current time t.