Chinese text summarization method and device based on BERT pre-training model

By combining the BERT pre-training model and the LDA topic model, the sentence vector weight is calculated and corrected, which solves the problem of insufficient semantic understanding in Chinese text summary extraction and improves the quality and accuracy of text summarization.

CN114428852BActive Publication Date: 2024-09-13BEIJING UNIV OF POSTS & TELECOMM
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210032641.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-01-12
Publication Date
2024-09-13
Estimated Expiration
2042-01-12

AI Technical Summary

Technical Problem

Chinese text summary extraction methods in the prior art have insufficient semantic understanding, are unable to capture the contextual semantics of long texts, and ignore keywords in sentences, resulting in low quality text summarization.

Method used

Using the Chinese text summary extraction method based on the BERT pre-training model, by obtaining the keywords of the text to be extracted and inputting them into the BERT pre-training language model, a fixed-dimensional sentence vector is generated, and the LDA topic model and LexRank algorithm are combined to calculate the sentence vector weights and corrections to produce high-quality text summaries.

Benefits of technology

It improves the quality of text summary, can better reflect the contextual semantics of the text, enhances the semantic relationship between keywords and text, and improves the generality and accuracy of the summary.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114428852B
    Figure CN114428852B
Patent Text Reader

Abstract

The present invention provides a Chinese text summary extraction method and device based on a BERT pre-training model, the method comprising: obtaining a text to be extracted and extracting keywords of the text to be extracted based on an LDA fusion algorithm; inputting the text to be extracted into a BERT pre-training language model to obtain a sentence vector of a fixed dimension of the text to be extracted; wherein the BERT pre-training language model is obtained by training a plurality of text samples and corresponding sample sentence vector generation results; performing weight calculation on the sentence vector and performing weight correction based on the keywords to obtain a text summary of the text to be extracted. The present invention can reflect the contextual semantics of the text through keywords, thereby improving the quality of the text summary.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of text summary extraction, and in particular to a Chinese text summary extraction method and device based on a BERT pre-training model. Background Art

[0002] In recent years, with the rapid development of the Internet and the advancement of information technology, text data has grown exponentially. Faced with massive amounts of text data, the traditional reading method requires people to first read the entire article, then summarize the article and summarize the core content of the article. The entire process has high labor costs and low efficiency. Therefore, in the case of long texts, in order to quickly obtain article summaries and save labor costs, automatic abstracting technology came into being.

[0003] There are two main research directions for automatic summarization: extractive summarization and generative summarization. However, the existing methods for summarizing Chinese text still have problems such as insufficient understanding of the semantics of sentences, inability to capture the contextual semantics of long texts, and ignoring the keywords of sentences.

[0004] Therefore, how to extract keywords from articles and improve the semantic relationship between keywords and text, thereby improving the quality of extracted text summaries, is a technical problem that needs to be solved urgently in the current subject. Summary of the invention

[0005] The present invention provides a Chinese text summary extraction method and device based on a BERT pre-training model, which are used to solve the defect of low quality of extracted text summaries in the prior art and improve the quality of extracted text summaries.

[0006] The present invention provides a Chinese text summarization method based on a BERT pre-training model, comprising:

[0007] Obtain the text to be extracted and extract the keywords of the text to be extracted based on the LDA fusion algorithm;

[0008] Input the text to be extracted into the BERT pre-trained language model to obtain a sentence vector of a fixed dimension of the text to be extracted;

[0009] The BERT pre-trained language model is obtained by training multiple text samples and corresponding sample sentence vector generation results;

[0010] The sentence vector is weighted and weighted based on the keywords to obtain a text summary of the text to be extracted.

[0011] According to a Chinese text summary extraction method based on a BERT pre-training model provided by the present invention, keywords of the text to be extracted based on the LDA fusion algorithm specifically include:

[0012] Input the text to be extracted into the LDA topic model to obtain keywords of the text to be extracted;

[0013] The LDA topic model is generated by performing unsupervised training on multiple text sample data sets.

[0014] According to a Chinese text summary extraction method based on a BERT pre-training model provided by the present invention, the weight calculation of the sentence vector and the weight correction based on the keywords to obtain the text summary of the text to be extracted specifically include:

[0015] Obtaining the cosine similarity between any target sentence and other sentences in the sentence vector;

[0016] Calculating the weight of each sentence vector based on the cosine similarity;

[0017] The weight of the sentence vector is modified based on the sentence keywords, sentence position and sentence length, the weight modification result of the sentence vector is output, and a text summary of the text to be extracted is obtained based on the weight modification result.

[0018] According to a Chinese text summary extraction method based on a BERT pre-training model provided by the present invention, the weight of each sentence vector is obtained based on the cosine similarity calculation, which is implemented by the following formula:

[0019]

[0020] The cosine similarity is achieved by the following formula:

[0021]

[0022] Among them, v i 、v j and v k are different sentences, d is the damping coefficient, w ji and w jk The sentences v i and sentence v j The cosine similarity between the two and the sentence v k and sentence v j The cosine similarity between WS(v i ) and WS(v j ) are sentences v i and v j The weight of A and B is the weight of sentence v i 、v j The corresponding sentence vector.

[0023] According to a Chinese text summarization method based on a BERT pre-training model provided by the present invention, the weight of the sentence vector is modified based on the sentence keywords, sentence position and sentence length, including:

[0024] The sentence vector is judged based on the sentence keywords, and if the sentence corresponding to the sentence vector includes the keywords, the weight of the sentence vector is increased;

[0025] The sentence vector is judged based on the sentence position, and if the sentence corresponding to the sentence vector is located at the first sentence of the text to be extracted, the weight of the sentence vector is increased;

[0026] The sentence vector is judged based on the sentence length. If the length of the sentence vector is less than the target length, the weight of the sentence vector is reduced.

[0027] According to a Chinese text summary extraction method based on a BERT pre-trained model provided by the present invention, the BERT pre-trained language model includes: an embedding layer, an encoding layer and an average pooling layer;

[0028] The step of inputting the text to be extracted and the keywords into the BERT pre-trained language model to obtain a sentence vector of a fixed dimension of the text to be extracted specifically includes:

[0029] Based on the embedding layer, converting the text to be extracted and the corresponding keywords into sentence vectors;

[0030] Inputting the sentence vector into the encoding layer, and outputting representation information of the sentence vector in multiple dimensions;

[0031] The representation information of the sentence vectors of multiple dimensions is input into the average pooling layer, and the representation information of the sentence vectors of multiple dimensions is processed to generate sentence vectors of fixed dimensions.

[0032] The present invention also provides a Chinese text summarization extraction device based on a BERT pre-training model, comprising:

[0033] The text and keyword acquisition module is used to obtain the text to be extracted and the keywords of the text to be extracted based on the LDA fusion algorithm;

[0034] A sentence vector acquisition module, used to input the text to be extracted into the BERT pre-trained language model to obtain a sentence vector of a fixed dimension of the text to be extracted;

[0035] The BERT pre-trained language model is obtained by training multiple text samples, keyword samples, and corresponding sample sentence vector generation results;

[0036] The text summary acquisition module is used to calculate the weight of the sentence vector and modify the weight based on the keywords to obtain the text summary of the text to be extracted.

[0037] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the steps of the method for extracting a Chinese text summary based on the BERT pre-training model as described above are implemented.

[0038] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of a method for extracting Chinese text summarization based on a BERT pre-trained model as described in any one of the above.

[0039] The present invention also provides a computer program product, including a computer program, which, when executed by a processor, implements the steps of any of the above-mentioned Chinese text summary extraction methods based on the BERT pre-training model.

[0040] The Chinese text summary extraction method and device based on the BERT pre-training model provided by the present invention obtains the text to be extracted and extracts keywords from the text to be extracted, obtains a sentence vector of fixed dimension based on the BERT pre-training language model, and then performs weight calculation and weight correction on the sentence vector to obtain a text summary of the text to be extracted. The text summary obtained by the present invention obtains keywords based on the text to be extracted, so that the contextual semantics of the text can be reflected through keywords, thereby improving the quality of the text summary. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0042] Figure 1 This is one of the flow charts of the Chinese text summarization method based on the BERT pre-training model provided by the present invention;

[0043] Figure 2 This is the second flow chart of the Chinese text summary extraction method based on the BERT pre-training model provided by the present invention;

[0044] Figure 3 It is a structural schematic diagram of a Chinese text summarization extraction device based on a BERT pre-training model provided by the present invention;

[0045] Figure 4 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION

[0046] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0047] Combine the following Figure 1-Figure 2 The present invention describes a Chinese text summary extraction method based on a BERT pre-training model.

[0048] The present invention provides a Chinese text summarization method based on a BERT pre-training model, including but not limited to the following steps:

[0049] Step 110: Obtain the text to be extracted and extract keywords of the text to be extracted based on the LDA fusion algorithm;

[0050] Specifically, the text to be extracted in this embodiment is a long Chinese text. Since the long Chinese text has the characteristic of broad expression, it is necessary to extract keywords from the text to be extracted. This embodiment extracts keywords from the text to be extracted by utilizing the association between the topic and the article, and the topic and the vocabulary, so that the keywords and the text to be extracted have a more semantic relationship.

[0051] Step 120: inputting the text to be extracted and the keywords into the BERT pre-trained language model to obtain a sentence vector of a fixed dimension of the text to be extracted;

[0052] The BERT pre-trained language model is obtained by training multiple text samples, keyword samples, and corresponding sample sentence vector generation results;

[0053] Specifically, in this embodiment, the acquired text to be extracted and its keywords are passed through the BERT pre-trained language model to generate a sentence vector corresponding to the text to be extracted. Among them, the sentence vector has a fixed dimension, and the sentence of the text to be extracted corresponding to the generated sentence vector includes keywords. Therefore, the sentence vector in this embodiment is generated based on keywords and has a certain semantic relevance.

[0054] The BERT pre-trained language model in this embodiment is used to extract text samples and keyword samples, and then obtain sentence vectors for text samples. During the training process, the sentence vector results output by the BERT pre-trained language model may generate error values, and the model parameters of the BERT pre-trained language model can be adjusted according to the error values. When the target accuracy reaches the expected value, the BERT pre-trained language model at this time is maintained. Among them, the target accuracy reaches the expected value means that the BERT pre-trained language model converges, which is specifically manifested as follows: the error value of the generated sentence vector is less than the preset threshold, which means that the BERT pre-trained language model training is completed.

[0055] Step 130: Calculate the weight of the sentence vector and modify the weight based on the keywords to obtain a text summary of the text to be extracted.

[0056] Specifically, based on the sentence vector generated by the BERT pre-trained language model, the weight of the sentence vector is first calculated, and then the influence of physical characteristics such as the part of speech of the sentence keyword corresponding to the sentence vector, the position of the sentence, and the length of the sentence on the sentence weight is comprehensively considered, so that the generated summary is more generalized and the quality of the text summary is improved.

[0057] The Chinese text summary extraction method based on the BERT pre-training model provided by the present invention obtains the text to be extracted and extracts keywords from the text to be extracted, obtains a sentence vector of fixed dimension based on the BERT pre-training language model, and then performs weight calculation and weight correction on the sentence vector to obtain a text summary of the text to be extracted. The text summary obtained by the present invention obtains keywords based on the text to be extracted, so that the contextual semantics of the text can be reflected through keywords, thereby improving the quality of the text summary.

[0058] Based on the above embodiment, the keywords of the text to be extracted based on the LDA fusion algorithm specifically include:

[0059] Input the text to be extracted into the LDA topic model to obtain keywords of the text to be extracted;

[0060] The LDA topic model is generated by performing unsupervised training on multiple text sample data sets.

[0061] Specifically, in this embodiment, keywords are generated by extracting text based on the LDA topic model. First, the article needs to be divided into sentences according to Chinese punctuation marks, and then each sentence needs to be segmented into Chinese words. At the same time, stop words need to be filtered, and finally the keywords of the article are obtained through the trained LDA topic model. The method of the LDA topic model is based on semantic features, and the extracted keywords have a more semantic relationship with the article.

[0062] In this embodiment, the joint distribution probability of the trained LDA topic model is:

[0063]

[0064] Among them, z is the article topic, θ is the topic vector, and w is the vocabulary under the topic. Then the topic-word distribution model of the model is calculated, so that the vocabulary with higher probability value is used as the keyword of the current article.

[0065] Based on the above embodiment, the weight calculation of the sentence vector and the weight correction based on the keywords to obtain the text summary of the text to be extracted specifically include:

[0066] Obtaining the cosine similarity between any target sentence and other sentences in the sentence vector;

[0067] Calculating the weight of each sentence vector based on the cosine similarity;

[0068] The weight of the sentence vector is modified based on the sentence keywords, sentence position and sentence length, the weight modification result of the sentence vector is output, and a text summary of the text to be extracted is obtained based on the weight modification result.

[0069] Specifically, this implementation is based on the graph model LexRank algorithm, which calculates and corrects the weights of sentence vectors in turn to obtain a text summary of the text to be extracted.

[0070] The LexRank algorithm is a method of calculating the weight of sentences in an article under a graph model. If a sentence is similar to many other sentences, then this sentence is considered to be more important, and the sentence weight score is also higher. The similarity calculation between sentences in the LexRank algorithm is often calculated by using a vector space model to find the cosine similarity between sentence pairs.

[0071] The weight of each sentence vector is obtained based on the cosine similarity calculation, which is implemented by the following formula:

[0072]

[0073] The cosine similarity is achieved by the following formula:

[0074]

[0075] Among them, v i 、v j and v k are different sentences, d is the damping coefficient, w ji and w jk The sentences v iand sentence v j The cosine similarity between the two and the sentence v k and sentence v j The cosine similarity between WS(v i ) and WS(v j ) are sentences v i and v j The weight of A and B is the weight of sentence v i 、v j The corresponding sentence vector.

[0076] This embodiment calculates the weight value of each sentence to select TOPK sentences as summaries, that is, the sentences are sorted according to the weights, and then K sentences with the highest weight scores are selected.

[0077] Based on the above embodiment, the weight of the sentence vector is modified based on the sentence keywords, sentence position and sentence length, including:

[0078] The sentence vector is judged based on the sentence keywords, and if the sentence corresponding to the sentence vector includes the keywords, the weight of the sentence vector is increased;

[0079] The sentence vector is judged based on the sentence position, and if the sentence corresponding to the sentence vector is located at the first sentence of the text to be extracted, the weight of the sentence vector is increased;

[0080] The sentence vector is judged based on the sentence length. If the length of the sentence vector is less than the target length, the weight of the sentence vector is reduced.

[0081] Specifically, in order to obtain a more accurate summary, this embodiment needs to take the above-mentioned features of the sentence into account when calculating the LexRank weight. The steps for correcting the sentence weight are as follows:

[0082] Remember the sentence i The weight calculated by LexRank is WS(v i ):

[0083] 1. Does the sentence include keywords?

[0084] Keywords often represent the main content of an article. If a sentence contains keywords, the weight of the sentence should be increased. In addition, the composition of sentences in long Chinese texts is relatively complex, and for article summaries, nouns, gerunds and other noun-like words should be given higher weights.

[0085]

[0086] 2. Sentence position:

[0087] Usually, the first sentence of an article often contains a large amount of information, so consider giving the first sentence of the article a higher weight, and the weights of sentences in other positions remain unchanged.

[0088]

[0089] 3. Sentence length:

[0090] Due to the complexity of the Chinese context, there may be shorter sentences in the text, which often contain lower information. By screening out shorter sentences, the quality of the summary can be effectively guaranteed.

[0091]

[0092] In this embodiment, by correcting sentence keywords, sentence positions and sentence lengths based on the LexRank algorithm, a more accurate summary of the text to be extracted can be obtained.

[0093] Based on the above embodiments, the BERT pre-trained language model includes: an embedding layer, an encoding layer, and an average pooling layer;

[0094] The step of inputting the text to be extracted and the keywords into the BERT pre-trained language model to obtain a sentence vector of a fixed dimension of the text to be extracted specifically includes:

[0095] Based on the embedding layer, converting the text to be extracted and the corresponding keywords into sentence vectors;

[0096] Inputting the sentence vector into the encoding layer, and outputting representation information of the sentence vector in multiple dimensions;

[0097] The representation information of the sentence vectors of multiple dimensions is input into the average pooling layer, and the representation information of the sentence vectors of multiple dimensions is processed to generate sentence vectors of fixed dimensions.

[0098] Specifically, the sentence vector corresponding to the text to be extracted is shown in the following formula:

[0099]

[0100] Among them, S i Represents the sentence vector corresponding to the sentence, i represents the i-th sentence in the article, Represents the word vector of the jth word in the i-th sentence of the article.

[0101]

[0102] Among them, position j Indicates the position of a word in a sentence, segment i It is the sentence segmentation mark.

[0103]

[0104] Among them, position j Indicates the position of a word in a sentence, segment i is the segmentation mark of the sentence. Since there is only one sentence in this algorithm, it is set to 0. The sentence is embedded in the BERT pre-trained model to obtain S′ i As the input of the encoding layer.

[0105] The encoding layer is composed of multiple layers of transformer encoders. Each time the sentence vector passes through a layer of transformer encoder, a hidden sentence vector representation is output. Therefore, the sentence can be represented as follows after the encoding layer:

[0106]

[0107] Finally, in order to ensure that the sentence vectors have the same dimension and can fully understand the contextual semantics, an average pooling layer is used. The final sentence vector can be expressed as:

[0108] S=MEAN(S″ i ) (11)

[0109] This formula refers to averaging the dimensions of the sentence vectors output by the encoding layer to obtain a sentence vector of fixed dimension.

[0110] Reference Figure 2 The steps of the Chinese text summary extraction method based on the BERT pre-training model provided by the present invention include:

[0111] The text data is preprocessed, including keyword extraction from the text data, and then the preprocessed data is input into the embedding layer.

[0112] In this embodiment, the embedding layer includes: a Token embedding layer, a Segment embedding layer and a Position embedding layer.

[0113] The token embedding layer is used to convert the text data in this embodiment into sentence vectors;

[0114] The Segment embedding layer is used to segment the sentence vector into multiple word vectors;

[0115] The Position embedding layer is used to confirm the word vector and output the sentence vector;

[0116] The sentence vector output by the embedding layer passes through the BERT layer, that is, the encoding layer for encoding and then passes through the average pooling layer to obtain a sentence vector of fixed dimension.

[0117] Then the sentence vector is weighted based on the LexRank algorithm, the sentence length is filtered, and finally the text summary corresponding to the text data is obtained.

[0118] The Chinese text summary extraction device based on the BERT pre-training model provided by the present invention is described below. The Chinese text summary extraction device based on the BERT pre-training model described below and the Chinese text summary extraction method based on the BERT pre-training model described above can refer to each other.

[0119] Reference Figure 3 The present invention provides a Chinese text summarization extraction device based on a BERT pre-training model, comprising the following modules:

[0120] A text and keyword acquisition module 310 is used to acquire the text to be extracted and to extract keywords of the text to be extracted based on the LDA fusion algorithm;

[0121] A sentence vector acquisition module 320 is used to input the text to be extracted into the BERT pre-trained language model to obtain a sentence vector of a fixed dimension of the text to be extracted;

[0122] The BERT pre-trained language model is obtained by training multiple text samples, keyword samples, and corresponding sample sentence vector generation results;

[0123] The text summary acquisition module 330 is used to calculate the weight of the sentence vector and modify the weight based on the keyword to obtain the text summary of the text to be extracted.

[0124] The Chinese text summary extraction device based on the BERT pre-training model provided by the present invention obtains the text to be extracted and extracts keywords from the text to be extracted, obtains a fixed-dimensional sentence vector based on the BERT pre-training language model for the text to be extracted and the corresponding keywords, and then performs weight calculation and weight correction on the sentence vector to obtain a text summary of the text to be extracted. The text summary obtained by the present invention obtains keywords based on the text to be extracted, so that the contextual semantics of the text can be reflected through keywords, thereby improving the quality of the text summary.

[0125] Based on the above embodiments, the text and keyword acquisition module is specifically used for:

[0126] Input the text to be extracted into the LDA topic model to obtain keywords of the text to be extracted;

[0127] The LDA topic model is generated by performing unsupervised training on multiple text sample data sets.

[0128] Based on the above embodiments, the text summary acquisition module is specifically used for:

[0129] Obtaining the cosine similarity between any target sentence and other sentences in the sentence vector;

[0130] Calculating the weight of each sentence vector based on the cosine similarity;

[0131] The weight of the sentence vector is modified based on the sentence keywords, sentence position and sentence length, the weight modification result of the sentence vector is output, and a text summary of the text to be extracted is obtained based on the weight modification result.

[0132] Based on the above embodiment, the text summary acquisition module is used to calculate the weight of each sentence vector based on the cosine similarity, which is implemented by the following formula:

[0133]

[0134] The cosine similarity is achieved by the following formula:

[0135]

[0136] Among them, v i 、v j and v k are different sentences, d is the damping coefficient, w ji and w jk The sentences v i and sentence v j The cosine similarity between the two and the sentence v k and sentence v j The cosine similarity between WS(v i ) and WS(v j ) are sentences v i and v j The weight of A and B is the weight of sentence v i 、v j The corresponding sentence vector.

[0137] Based on the above embodiments, the text summary acquisition module is specifically used for:

[0138] The sentence vector is judged based on the sentence keywords, and if the sentence corresponding to the sentence vector includes the keywords, the weight of the sentence vector is increased;

[0139] The sentence vector is judged based on the sentence position, and if the sentence corresponding to the sentence vector is located at the first sentence of the text to be extracted, the weight of the sentence vector is increased;

[0140] The sentence vector is judged based on the sentence length. If the length of the sentence vector is less than the target length, the weight of the sentence vector is reduced.

[0141] Based on the above embodiments, the BERT pre-trained language model includes: an embedding layer, an encoding layer, and an average pooling layer;

[0142] The sentence vector acquisition module is specifically used for:

[0143] Based on the embedding layer, converting the text to be extracted and the corresponding keywords into sentence vectors;

[0144] Inputting the sentence vector into the encoding layer, and outputting representation information of the sentence vector in multiple dimensions;

[0145] The representation information of the sentence vectors of multiple dimensions is input into the average pooling layer, and the representation information of the sentence vectors of multiple dimensions is processed to generate sentence vectors of fixed dimensions.

[0146] Figure 4 An example of a physical structure diagram of an electronic device is shown in FIG. Figure 4 As shown, the electronic device may include: a processor 410, a communication interface 420, a memory 430 and a communication bus 440, wherein the processor 410, the communication interface 420 and the memory 430 communicate with each other through the communication bus 440. The processor 410 may call the logic instructions in the memory 430 to execute the Chinese text summary extraction method based on the BERT pre-training model, and the method includes:

[0147] Obtain the text to be extracted and extract the keywords of the text to be extracted based on the LDA fusion algorithm;

[0148] Input the text to be extracted into the BERT pre-trained language model to obtain a sentence vector of a fixed dimension of the text to be extracted;

[0149] The BERT pre-trained language model is obtained by training multiple text samples and corresponding sample sentence vector generation results;

[0150] The sentence vector is weighted and weighted based on the keywords to obtain a text summary of the text to be extracted.

[0151] In addition, the logic instructions in the above-mentioned memory 430 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.

[0152] On the other hand, the present invention further provides a computer program product, the computer program product comprising a computer program, the computer program can be stored on a non-transitory computer-readable storage medium, and when the computer program is executed by a processor, the computer can execute the Chinese text summarization method based on the BERT pre-training model provided by the above methods, the method comprising:

[0153] Obtain the text to be extracted and extract the keywords of the text to be extracted based on the LDA fusion algorithm;

[0154] Input the text to be extracted into the BERT pre-trained language model to obtain a sentence vector of a fixed dimension of the text to be extracted;

[0155] The BERT pre-trained language model is obtained by training multiple text samples and corresponding sample sentence vector generation results;

[0156] The sentence vector is weighted and weighted based on the keywords to obtain a text summary of the text to be extracted.

[0157] In another aspect, the present invention further provides a non-transitory computer-readable storage medium having a computer program stored thereon, which is implemented when the computer program is executed by a processor to execute the Chinese text summarization method based on the BERT pre-training model provided by the above methods, the method comprising:

[0158] Obtain the text to be extracted and extract the keywords of the text to be extracted based on the LDA fusion algorithm;

[0159] Input the text to be extracted into the BERT pre-trained language model to obtain a sentence vector of a fixed dimension of the text to be extracted;

[0160] The BERT pre-trained language model is obtained by training multiple text samples and corresponding sample sentence vector generation results;

[0161] The sentence vector is weighted and weighted based on the keywords to obtain a text summary of the text to be extracted.

[0162] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.

[0163] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0164] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A Chinese text summarization method based on the BERT pre-training model, It is characterized in that include: Obtain the text to be extracted and extract the keywords of the text to be extracted based on the LDA fusion algorithm; Input the text to be extracted into the BERT pre-trained language model to obtain a sentence vector of a fixed dimension of the text to be extracted; The BERT pre-trained language model is obtained by training multiple text samples and corresponding sample sentence vector generation results; Calculating the weight of the sentence vector and modifying the weight based on the keywords to obtain a text summary of the text to be extracted; The weight calculation of the sentence vector and weight correction based on the keywords to obtain a text summary of the text to be extracted specifically includes: Obtaining the cosine similarity between any target sentence and other sentences in the sentence vector; Calculating the weight of each sentence vector based on the cosine similarity; The weight of the sentence vector is modified based on the sentence keywords, sentence position and sentence length, the weight modification result of the sentence vector is output, and a text summary of the text to be extracted is obtained based on the weight modification result; The weight of the sentence vector is modified based on the sentence keywords, sentence position and sentence length, including: The sentence vector is judged based on the sentence keywords, and if the sentence corresponding to the sentence vector includes the keywords, the weight of the sentence vector is increased; The sentence vector is judged based on the sentence position, and if the sentence corresponding to the sentence vector is located at the first sentence of the text to be extracted, the weight of the sentence vector is increased; The sentence vector is judged based on the sentence length. If the length of the sentence vector is less than the target length, the weight of the sentence vector is reduced.

2. According to the Chinese text summarization method based on the BERT pre-training model according to claim 1, It is characterized in that Keywords of the text to be extracted based on the LDA fusion algorithm include: Input the text to be extracted into the LDA topic model to obtain keywords of the text to be extracted; The LDA topic model is generated by performing unsupervised training on multiple text sample data sets.

3. The Chinese text summarization method based on the BERT pre-training model according to claim 1, It is characterized in that The weight of each sentence vector is obtained based on the cosine similarity calculation, which is implemented by the following formula: ; The cosine similarity is achieved by the following formula: ; in, , and For different sentences, is the damping coefficient, and Separate sentences and sentences The cosine similarity between the sentences and sentences The cosine similarity between and Separate sentences and The weight of , It is a sentence , The corresponding sentence vector.

4. The Chinese text summarization method based on the BERT pre-training model according to claim 1, It is characterized in that The BERT pre-trained language model includes: an embedding layer, an encoding layer, and an average pooling layer; The step of inputting the text to be extracted into the BERT pre-trained language model to obtain a sentence vector of a fixed dimension of the text to be extracted specifically includes: Based on the embedding layer, converting the text to be extracted into a sentence vector; Inputting the sentence vector into the encoding layer, and outputting representation information of the sentence vector in multiple dimensions; The representation information of the sentence vectors of multiple dimensions is input into the average pooling layer, and the representation information of the sentence vectors of multiple dimensions is processed to generate sentence vectors of fixed dimensions.

5. A Chinese text summarization device based on the BERT pre-training model, It is characterized in that include: The text and keyword acquisition module is used to obtain the text to be extracted and the keywords of the text to be extracted based on the LDA fusion algorithm; A sentence vector acquisition module, used to input the text to be extracted into the BERT pre-trained language model to obtain a sentence vector of a fixed dimension of the text to be extracted; The BERT pre-trained language model is obtained by training multiple text samples, keyword samples, and corresponding sample sentence vector generation results; A text summary acquisition module, used to calculate the weight of the sentence vector and modify the weight based on the keywords to obtain a text summary of the text to be extracted; The text summary acquisition module is specifically used for: Obtaining the cosine similarity between any target sentence and other sentences in the sentence vector; Calculating the weight of each sentence vector based on the cosine similarity; The weight of the sentence vector is modified based on the sentence keywords, sentence position and sentence length, the weight modification result of the sentence vector is output, and a text summary of the text to be extracted is obtained based on the weight modification result; The text summary acquisition module is specifically used for: The sentence vector is judged based on the sentence keywords, and if the sentence corresponding to the sentence vector includes the keywords, the weight of the sentence vector is increased; The sentence vector is judged based on the sentence position, and if the sentence corresponding to the sentence vector is located at the first sentence of the text to be extracted, the weight of the sentence vector is increased; The sentence vector is judged based on the sentence length. If the length of the sentence vector is less than the target length, the weight of the sentence vector is reduced.

6. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, It is characterized in that When the processor executes the program, the steps of the Chinese text summary extraction method based on the BERT pre-training model as described in any one of claims 1 to 4 are implemented.

7. A non-transitory computer-readable storage medium having a computer program stored thereon, It is characterized in that When the computer program is executed by a processor, the steps of the Chinese text summarization method based on the BERT pre-training model as described in any one of claims 1 to 4 are implemented.

8. A computer program product comprising a computer program, It is characterized in that When the computer program is executed by a processor, the steps of the Chinese text summarization method based on the BERT pre-training model as described in any one of claims 1 to 4 are implemented.