A text abstract generation method, device and equipment
By extracting and classifying features from multi-topic texts and combining them with deep learning models to generate text summaries, the problems of redundancy and poor readability in existing technologies are solved, and efficient and highly relevant text summarization is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- CHINA MOBILE (SUZHOU) SOFTWARE TECH CO LTD
- Filing Date
- 2021-09-14
- Publication Date
- 2026-04-10
AI Technical Summary
Existing text summarization methods suffer from redundancy, poor readability, and low performance and complex iteration of traditional classification algorithms, making it difficult to effectively handle the topic relevance and semantic relevance of multi-topic Chinese data.
By obtaining a set of original text corpora and topic keywords for multi-topic texts, binary classification is performed using the XGBoost algorithm. Initial summaries are extracted by combining features such as LDA, cosine similarity, TextRank, sentence length, and positional information. Text summaries are then generated using CNN and GRU models with attention mechanisms. The extraction and generative summarization methods are combined to improve accuracy and readability.
It achieves efficient generation of multi-topic text summaries, improves the topic and semantic relevance of the summaries, reduces redundancy, and enhances the readability and accuracy of the generated summaries.
Smart Images

Figure CN115809328B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of document information processing, and in particular to a text abstract generation method, device and equipment. BACKGROUND
[0002] With the rapid expansion of information on the network, people will obtain a large amount of redundant information, and browsing these redundant information will waste a lot of time and effort, so the automatic abstract technology appears, which aims to find important parts from information.
[0003] Abstracts are everywhere and are often used in daily life, such as common TV news headlines, book reviews, etc. Automatic abstract is a branch of natural language processing technology, which can optimize document format. Text abstract can generate summaries, generate compositions, combine with speech synthesis technology to automatically broadcast news, and human-computer interaction for complex problems, etc. In today's information over-saturation, people can use text abstract technology to extract important parts from massive text information, realize text information refining and summarizing, better solve the user information overload problem, and thus improve the user's efficiency of obtaining key information. With the upgrading of computer hardware and software, neural networks have made great progress in natural language processing, and in particular, the model method based on deep learning has achieved good experimental results in natural language processing.
[0004] Currently, automatic abstracts can be divided into extractive abstracts and generative abstracts according to technology, single-document abstracts and multi-document abstracts according to text range, and Chinese documents and English documents according to text language. Extractive means sorting and selecting existing sentences, and extracting key sentences as abstract sentences on the basis of the original document. Generative means generating abstracts based on the establishment of an abstract semantic representation model.
[0005] The main shortcomings of the existing text abstract method are:
[0006] (1) The abstract sentences extracted by the extractive abstract method will have redundancy phenomenon;
[0007] (2) The abstracts generated by the generative abstract method have poor readability;
[0008] (3) The performance of the traditional classification algorithm is low, the iteration is complex, and the time is long;
[0009] (4) Since it is aimed at multi-topic Chinese data, the requirements for topic relevance and semantic relevance are relatively high, and the common model has poor pertinence. SUMMARY
[0010] In view of the above problems, the present application is proposed to provide a text abstract generation method, device and equipment which can overcome the above problems or at least partially solve the above problems.
[0011] According to an aspect of the embodiments of the present application, a method for generating a text summary is provided, comprising:
[0012] obtaining an original text corpus of multi-topic texts and a set of topic keywords;
[0013] obtaining, according to the original text corpus, a text corpus related to a topic keyword in the set of topic keywords;
[0014] obtaining, according to the text corpus, a pre-selected summary corpus;
[0015] generating a text summary according to the pre-selected summary corpus.
[0016] According to another aspect of the embodiments of the present application, a device for generating a text summary is provided, comprising:
[0017] a obtaining module, configured to obtain an original text corpus of multi-topic texts and a set of topic keywords;
[0018] a processing module, configured to obtain, according to the original text corpus, a text corpus related to a topic keyword in the set of topic keywords, and obtain, according to the text corpus, a pre-selected summary corpus;
[0019] an output module, configured to generate a text summary according to the pre-selected summary corpus.
[0020] According to still another aspect of the embodiments of the present application, a computing device is provided, comprising a processor, a memory, a communication interface and a communication bus, the processor, the memory and the communication interface being capable of communicating with each other through the communication bus;
[0021] the memory is configured to store at least one executable instruction, and the executable instruction is configured to enable the processor to perform operations corresponding to the above-mentioned method for generating a text summary.
[0022] According to still another aspect of the embodiments of the present application, a computer storage medium is provided, and the storage medium stores at least one executable instruction, and the executable instruction is configured to enable a processor to perform operations corresponding to the above-mentioned method for generating a text summary.
[0023] According to the above-mentioned embodiments of the present application, by obtaining an original text corpus of multi-topic texts and a set of topic keywords, obtaining, according to the original text corpus, a text corpus related to a topic keyword in the set of topic keywords, obtaining, according to the text corpus, a pre-selected summary corpus, and generating a text summary according to the pre-selected summary corpus, the text summary of multi-topic texts can be obtained.
[0024] The above description is merely an overview of the technical solutions of the embodiments of the present invention. In order to better understand the technical means of the embodiments of the present invention and to implement them in accordance with the contents of the specification, and to make the above and other objects, features and advantages of the embodiments of the present invention more obvious and understandable, specific implementation methods of the embodiments of the present invention are described below. Attached Figure Description
[0025] Various other advantages and benefits will become apparent to those skilled in the art upon reading the following detailed description of preferred embodiments. The accompanying drawings are for illustrative purposes only and are not intended to limit the scope of the invention. Furthermore, the same reference numerals denote the same parts throughout the drawings. In the drawings:
[0026] Figure 1 A flowchart of a text summarization method provided in an embodiment of the present invention is shown;
[0027] Figure 2 The flowchart illustrates the steps of obtaining a raw text corpus of multi-topic texts in the method provided by an embodiment of the present invention.
[0028] Figure 3 A flowchart illustrating the steps of obtaining a text corpus set in the method provided by an embodiment of the present invention is shown.
[0029] Figure 4 A flowchart of the pre-selected summary corpus set in the method provided by an embodiment of the present invention is shown;
[0030] Figure 5 This illustration shows a schematic diagram of a Seq2Seq preset network model constructed based on the PyTorch framework according to an embodiment of the present invention.
[0031] Figure 6 A flowchart illustrating the steps for generating text summaries provided in an embodiment of the present invention is shown.
[0032] Figure 7 A flowchart of a text summarization method provided in an embodiment of the present invention is shown;
[0033] Figure 8 A schematic diagram of the structure of the text summarization generation apparatus provided in an embodiment of the present invention is shown;
[0034] Figure 9 A schematic diagram of the structure of a computing device provided in an embodiment of the present invention is shown. Detailed Implementation
[0035] Exemplary embodiments of the present application will be described herein below with reference to the accompanying drawings. While exemplary embodiments of the present application are shown in the drawings, it is understood that the present application can be embodied in various forms and should not be limited by the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the application to those skilled in the art.
[0036] Figure 1 A flow chart of the method for generating a text summary according to an embodiment of the present application is shown. As shown in the figure, the method comprises the following steps: Figure 1
[0037] Step 11, obtaining an original text corpus of a multi-topic text and a set of topic keywords; here, the multi-topic text refers to a text / document with multiple topics, and each topic can include at least one topic keyword;
[0038] Step 12, obtaining a text corpus related to the topic keywords in the set of topic keywords according to the original text corpus;
[0039] Step 13, obtaining a pre-selected summary corpus according to the text corpus;
[0040] Step 14, generating a text summary according to the pre-selected summary corpus.
[0041] In this embodiment, by obtaining an original text corpus of a multi-topic text and a set of topic keywords; obtaining a text corpus related to the topic keywords in the set of topic keywords according to the original text corpus; obtaining a pre-selected summary corpus according to the text corpus; and generating a text summary according to the pre-selected summary corpus, the text summary of the multi-topic text can be obtained.
[0042] In an optional embodiment of the present application, the step of obtaining an original text corpus of a multi-topic text in step 11 can include:
[0043] Step 111, obtaining an original corpus of a multi-topic text;
[0044] Step 112, performing text preprocessing on the original corpus to obtain a preprocessing result;
[0045] Step 113, extracting sentence vectors and document vectors according to the preprocessing result to obtain sentence vectors and document vectors of the multi-topic text;
[0046] Step 114, obtaining an original text corpus according to the sentence vectors and document vectors of the multi-topic text.
[0047] In this embodiment, the original corpus set OriginalCorpus can be defined, OriginalCorpus = {oldContent1, oldContent2, ..., oldContent...} oldsum}, where oldsum is the number of corpus entries, and oldContent is the number of entries in the corpus. u Let u be the text of the u-th corpus, where u ∈ [1, oldsum].
[0048] We can further define a collection of multi-topic text text named NewContent, where NewContent = {{stopPosition1, stopSentence1, stopValue1}, {stopPosition2, stopSentence2, stopValue2}, ..., {stopPosition1}. sum stopSentence sum stopValue sum}}, where sum is the number of sentences in each article, and stopPosition v The position of sentence v is stopSentence v For the content of sentence v, stopValue v Let v be the weight of the v-th sentence, where v∈[1,sum].
[0049] Define the original text corpus as: OriginaTextCorpus, OriginaTextCorpus = {NewContent1, NewContent2, ..., NewContent...} oldsum}, where oldsum is the number of corpus entries, and NewContent w Let w be the set of texts of the w-th corpus, where w∈[1, oldsum].
[0050] Define a loop variable i, initialize it to 1, and use it to iterate through the original corpus OriginalCorpus.
[0051] In this embodiment, the specific implementation process of steps 111 to 114 is as follows: Figure 2 As shown, it may include:
[0052] Step 21: Determine if i is less than oldsum. If i is less than oldsum, proceed to step 22.
[0053] Step 22: Split each oldContent into a newContent, where stopPosition is assigned the sentence position and stopValue is assigned 0;
[0054] Step 23: Perform text preprocessing on the original corpus OriginalCorpus to obtain the preprocessing result. The text preprocessing includes, but is not limited to, Hanlp Chinese word segmentation, stop word removal, etc.
[0055] Step 24: Use the word2vec tool to train the word vector model, and store the word vector model W as a .model file in the w2v_model_path path;
[0056] Step 25: Extract sentence vectors and document vectors based on the word vector model W to obtain sentence vectors and document vectors; i = i + 1, return to step 21 to continue execution;
[0057] Step 26: Continue until i is greater than oldsum to obtain the original text corpus OriginaTextCorpus, and store it in the origin_data_path path in TXT text format.
[0058] This embodiment involves cleaning the original corpus OriginalCorpus, preprocessing the text to remove noisy words, training word vectors using word2vec, extracting sentence and document vectors to obtain sentence and document vectors for multi-topic texts, and finally obtaining the original text corpus OriginalTextCorpus based on the sentence and document vectors, thus providing data support for the acquisition of the text corpus.
[0059] In another optional embodiment of the present invention, step 12 may include:
[0060] Step 121: Based on the topic keywords in the topic keyword set, perform binary classification on the original text corpus using a preset classification model to obtain a text corpus related to the topic keywords in the topic keyword set.
[0061] In a specific implementation, step 121 may include:
[0062] Step 1211: Iterate through the topic keywords in the topic keyword set and calculate the number of times each topic keyword appears in the sentence in each iteration;
[0063] Step 1212: Using the number of times as weights, perform binary classification on the original text corpus using a preset classification algorithm to obtain a text corpus related to the topic keywords in the topic keyword set.
[0064] like Figure 3 As shown, the preset classification algorithm model is trained through the following steps:
[0065] The first step is to define a text classification corpus ClassificationCorpus, ClassificationCorpus={{NewContent1, value1}, {NewContent2, value2}, …, {NewContent oldsum , value oldsum}}, wherein oldsum is the number of corpus, NewContent x is the body of the xth corpus, value x is whether the xth corpus meets the classification, x∈[1, oldsum];
[0066] The second step is to input a topic keyword set TopicWords, TopicWords={word1, word2, …, word wordsum}, wherein wordsum is the number of topic words, and word y is the yth topic word, y∈[1, wordsum];
[0067] The third step is to loop the text classification corpus ClassificationCorpus through the topic keyword set TopicWords, and then take the word vector model and the number of occurrences of the corresponding words as the weight value for calculation.
[0068] The fourth step is to divide the training text into training and prediction according to 5:5, 50% of the samples form a training set, and 50% of the samples form a prediction set.
[0069] The fifth step is to use the XGBoost algorithm to classify and train the text, wherein value is 0 if it does not meet the topic, the XGBoost algorithm reduces the calculation of overfitting for binary classification, which can make the speed faster and the accuracy higher.
[0070] Further, the method of the embodiment can further include:
[0071] The sixth step is to loop through the topic keywords in the topic keyword set, and calculate the number of occurrences of each traversed topic keyword in the sentence.
[0072] Step 1212 takes the number of occurrences as a weight value, uses a trained preset classification algorithm model to classify the samples of the original text corpus set, and obtains a text corpus set TextCorpus related to the topic keywords in the topic keyword set.
[0073] In another optional embodiment of the application, step 13 can include:
[0074] Step 131, loop through the text corpus to obtain the word vector, sentence vector and document vector obtained each time;
[0075] Step 132, obtain the topic information weight of each sentence, the cosine information weight of the sentence vector and the document vector, the keyword weight of each sentence, the position information weight of the sentence in the document and the sentence length information weight;
[0076] Step 133, obtain the sentence weight according to the topic information weight, the cosine information weight, the keyword weight, the position information weight and the sentence length information weight;
[0077] Step 134, obtain the preselected summary corpus according to the sentence weight; when the step is specifically implemented, a plurality of sentences are sorted according to the sentence weight, and N sentences are selected to form the preselected summary corpus, and N is a positive integer.
[0078] In the embodiment, the specific implementation process of steps 131 to 134 is as shown in Figure 4 , which includes:
[0079] Step 41, define the preselected summary corpus PreselectedCorpus, PreselectedCorpus={NewContent1, NewContent2, …, NewContent oldsum}, wherein oldsum is the number of corpus, NewContent t is the body set of the tth corpus, t∈[1, oldsum];
[0080] Step 42, define the loop variable j and assign the initial value 1, which is used to loop through the original text corpus OriginaTextCorpus;
[0081] Step 43, determine whether the loop variable j is less than oldsum, if the loop variable j is less than the number of corpus oldsum, calculate the TF-IDF value of each word, obtain the preselected summary corpus PreselectedCorpus, load the word vector model W, and take the original word vector * TF-IDF value as the new word vector of the word; if the loop variable j is not less than the number of corpus oldsum, execute step 52;
[0082] Step 44, calculate the weighted sum average of all word vectors in a sentence as the sentence vector, so that long sentences cannot score higher than short sentences;
[0083] Step 45, take the average of the weighted sum of all sentence vectors as the document vector;
[0084] Step 46, obtain the topic information weight of each sentence: put into the LDA topic model for training, and assign num_topics as 1, to obtain the topic information weight of each sentence under the same topic, and the specific calculation formula is: Wherein, represents the frequency of the word being assigned to the topic z i = t, represents the frequency of all words being assigned to the topic z i = t, represents the frequency of the word in the text where the word is assigned to the topic z i = t, represents the number of words in the text where the word is assigned to the topic z, V represents the total number of words in the corpus, T represents the number of all topics, and the current item is excluded when calculating all frequencies
[0085] Step 47, obtain the cosine information weight of the sentence vector and the document vector: calculate the angle cosine value between the sentence vector and the document vector to obtain the cosine information weight, if two vectors v m and v n are N-dimensional vectors, then their cosine similarity is:
[0086] Step 48, obtain the keyword weight of each sentence: use the TextRank algorithm to obtain the keyword list KeyWordsList of the same topic document, then calculate the number of keywords / sentence length to obtain the keyword weight of a sentence, if the weight of the edge between any two points V i and V j is WS(V j ), then the specific calculation formula of the weight WS(V i ) of the vertex V i of the weighted edge is as follows: Wherein, In(V i ) represents the point set pointing to V i , Out(V j ) represents the point set pointed by the point V j , and d is the damping coefficient, representing the probability of pointing from a certain point in the graph to other points, and the size is generally 0.85;
[0087] Step 49, obtain the position information weight of the sentence in the document: calculate the position information weight of the sentence in the document according to the formula, and the specific calculation formula is: Wherein, pos is the position sequence of the sentence p in the document D, for example, if P is the first sentence of the document, then the value of pos is 1, and len(D) represents the number of sentences contained in the document D;
[0088] In step 50, the length information weight of a sentence is obtained: the length information weight is defined, a local variable m is defined, m is equal to the length of a sentence / the target length, a local variable n is defined and is assigned a value of 1-(the length of a sentence-the target length) / the target length; if m is greater than 1 and n is greater than 0.5, the length information weight is n, if m is greater than 1 and n is less than or equal to 0.5, the length information weight is 0.5, if m is less than or equal to 1 and m is greater than 0.5, the length information weight is 0.5, and if m is less than or equal to 1 and m is less than or equal to 0.5, the length information weight is m;
[0089] In step 51, the five weight influence factors of the theme information weight, the cosine information weight, the keyword weight, the position information weight and the length information weight of a sentence are comprehensively considered, and a multiple linear regression method is used to dynamically calculate the final sentence weight ai+; the multiple linear regression or stepwise regression equation in a computer standard library is directly calculated to obtain the weight value stopValue of each sentence. In this way, the weight value stopValue of a sentence is optimal under maximum likelihood estimation;
[0090] In step 52, the sentences are sorted according to the weight value stopValue, the MMR (maximum margin relevance) algorithm and the LD (edit distance algorithm) algorithm are used to eliminate redundancy, and the first N sentences are selected to form the preselected corpus of the summary.
[0091] In this embodiment, the initial summary is extracted by fusing LDA, cosine similarity, TextRank, sentence length and sentence position, and the redundancy is eliminated by combining the MMR and LD algorithms. The method uses the theme keyword to lock the theme when classifying, and combines the LDA theme model when generating the summary, so that the theme and semantic relevance of the summary are improved, and the performance of the algorithm is further improved. In addition, the feature values are not synchronized by using the multiple linear regression method to dynamically calculate, and the weight calculation is not involved.
[0092] In still another optional embodiment of the present application, step 14 can include:
[0093] In step 141, the sentences in the preselected corpus of the summary are input into a trained preset network model for processing to generate a text summary.
[0094] If the word quantity of the input sentence exceeds a preset value, at least one word with a high word frequency in the sentence is selected, the at least one word is connected in sequence to replace the original sentence, and if the word quantity of the sentence is less than the preset value, all the words in the sentence are selected to form a sentence vector. The selected sentence vector is spliced by a comma to form a final text summary.
[0095] As Figure 5 shown, the trained preset network model comprises:
[0096] an encoder, and a decoder connected with the encoder, wherein an Attention layer is added in the decoder; wherein the encoder processes input information through a convolution layer to obtain a first output;
[0097] the first output is input into a pooling layer for processing to obtain a second output;
[0098] the second output is subjected to CNN encoding processing to obtain a sentence vector;
[0099] the sentence vector is subjected to GRU encoding processing to obtain a document vector;
[0100] the document vector is input into a GRU decoder for processing to obtain a final output, and the final output is a sentence vector in a text summary, wherein the decoder uses an Attention-enabled GRU to obtain a word vector.
[0101] As Figure 6 shown, the specific implementation process of the step 141 can comprise:
[0102] step 61, a Seq2Seq model built based on a PyTorch framework is used, which is composed of an Encoder-Decoder (encoder-decoder) and adds an Attention mechanism;
[0103] step 62, the word quantity of each sentence is controlled within a fixed value: if the fixed value is exceeded, the fixed value words with the highest word frequency in the sentence are selected according to the order and are connected to replace the original sentence, and if the sentence contains less than the fixed value, 0 is used to replace it;
[0104] step 63, the Encoder (encoder) of the training model uses CNN+GRU, first uses the convolution kernel of CNN to perform mutual operation, and then selects all maximum values to connect to form a sentence vector through a maximum pooling layer operation, and then converts through GRU;
[0105] step 64, the Attention mechanism of the training model uses LuongAttention;
[0106] step 65, the Decoder (decoder) of the training model uses an Attention-enabled GRU to obtain a word vector; a CNN with an Attention mechanism and a GRU model are used; in addition, the extractive summary method and the generative summary method are combined, so as to further improve the accuracy and readability when facing a large data text summary;
[0107] Step 66, train the seq2seq preset network model with 80% of the data set.
[0108] Step 67, use 20% of the data set for verification, compare the predicted summary and the actual summary, and adjust the model parameters in reverse.
[0109] Step 68, input the sentences in the preselected summary corpus into the trained preset network model for processing to generate sentence vectors.
[0110] Step 69, concatenate the selected sentence vectors with commas to form the final text summary.
[0111] The implementation process of the above embodiment of the present application will be described below. Figure 7
[0112] Step 71, data cleaning is performed on the obtained original corpus OriginalCorpus, then text preprocessing is performed to remove text noise words, word vector type is trained using the word2vec tool, and finally the original text corpus OriginaTextCorpus is obtained according to the sentence vector and the document vector.
[0113] Step 72, according to the theme keyword, the XGBoost is used to perform binary classification processing on the OriginaTextCorpus to obtain the theme related text corpus TextCorpus.
[0114] Step 73, fuse multiple features to preselect the summary of TextCorpus, select the top 10 of the score ranking of each article after screening, of course, the top several of the ranking can be selected according to the actual situation, to obtain the preselected summary corpus PreselectedCorpus.
[0115] Step 74, create a deep learning model and add an attention mechanism Attention, put the preselected summary corpus PreselectedCorpus into the model for training to obtain the final text summary.
[0116] In this embodiment of the present application, when the final text summary is obtained, the evaluation result of the automatic abstract ROUGE evaluation system can be used as an evaluation index.
[0117] In the above embodiment of the present application, the original text corpus of the multi-topic text and the topic keyword set are obtained, the text corpus related to the topic keyword in the topic keyword set is obtained according to the original text corpus, the preselected abstract corpus is obtained according to the text corpus, and the text abstract is generated according to the preselected abstract corpus, so as to realize the generation of the text abstract of the multi-topic text; XGBoost is used for reducing calculation by reducing overfitting for binary classification, which is faster and more accurate; the initial abstract is extracted by fusing LDA, cosine similarity, TextRank, sentence length, sentence position and other features, and the redundancy is eliminated by combining MMR and LD algorithms, the method locks the topic by using the topic keyword when classifying, and the LDA topic model is combined when generating the abstract, so as to improve the topic and semantic relevance of the abstract and further improve the algorithm performance; further, the CNN and GRU models with attention mechanism are used to further improve the accuracy and readability when facing the big data text abstract.
[0118] The multi-topic text abstract generation method in the above embodiment of the present application can further generate a big data text review according to the text abstract, automatically broadcast the text by combining the speech synthesis technology, and realize human-computer interaction for complex problems, so that the application field is wide.
[0119] Figure 8 The structure schematic diagram of the text abstract generation device 80 provided by the embodiment of the present application is shown. Figure 8 As shown in the figure, the device comprises:
[0120] The acquisition module 81 is configured to obtain the original text corpus of the multi-topic text and the topic keyword set.
[0121] The processing module 82 is configured to obtain the text corpus related to the topic keyword in the topic keyword set according to the original text corpus, and obtain the preselected abstract corpus according to the text corpus.
[0122] The output module 83 is configured to generate the text abstract according to the preselected abstract corpus.
[0123] Optionally, the acquisition module 81 is further configured to acquire the original corpus of the multi-topic text.
[0124] The original corpus is subjected to text preprocessing to obtain a preprocessing result.
[0125] The sentence vector and the document vector are extracted according to the preprocessing result, so as to obtain the sentence vector and the document vector of the multi-topic text.
[0126] The original text corpus is obtained according to the sentence vector and the document vector of the multi-topic text.
[0127] Optionally, the processing module 82 is further configured to perform binary classification processing on the original text corpus according to the topic keywords in the set of topic keywords by using a preset classification model, to obtain a text corpus related to the topic keywords in the set of topic keywords.
[0128] Optionally, the processing module 82 is further configured to calculate the number of occurrences of each of the topic keywords in the set of topic keywords in the sentences in each iteration;
[0129] Optionally, the processing module 82 is further configured to perform binary classification processing on the original text corpus by using a preset classification algorithm, taking the number of occurrences as a weight, to obtain a text corpus related to the topic keywords in the set of topic keywords.
[0130] Optionally, the processing module 82 is further configured to iterate through the text corpus to obtain a word vector, a sentence vector and a document vector obtained in each iteration;
[0131] Optionally, the processing module 82 is further configured to obtain a topic information weight of each sentence, a cosine information weight of the sentence vector and the document vector, a keyword weight of each sentence, a position information weight of the sentence in the document, and a sentence length information weight.
[0132] Optionally, the processing module 82 is further configured to obtain a sentence weight according to the topic information weight, the cosine information weight, the keyword weight, the position information weight and the sentence length information weight.
[0133] Optionally, the processing module 82 is further configured to obtain a preselected abstract corpus according to the sentence weight.
[0134] Optionally, the processing module 82 is further configured to sort a plurality of sentences according to the sentence weight, and select N sentences to form the preselected abstract corpus, where N is a positive integer.
[0135] Optionally, the output module 83 is further configured to input the sentences in the preselected abstract corpus into a trained preset network model for processing to generate a text abstract; the preset network model is configured to, when the word quantity of an input sentence exceeds a preset value, select at least one word in the sentence with a word frequency higher than a first value, connect the at least one word in order to replace the original sentence, and if the word quantity of the sentence is less than the preset value, select all the words in the sentence to connect to form a sentence vector.
[0136] It should be noted that the embodiment is a device embodiment corresponding to the above-mentioned method embodiment, and all implementation manners in the above-mentioned method embodiment are applicable to the device embodiment, and the same technical effects can be achieved.
[0137] The embodiment of the present application provides a non-volatile computer storage medium, which stores at least one executable instruction, and the computer executable instruction can execute the text abstract generation method in any method embodiment.
[0138] Figure 9 The embodiment of the present application shows the structural schematic diagram of the computing device, and the embodiment of the present application does not limit the specific implementation of the computing device.
[0139] As shown in the figure, the computing device can include a processor, a communications interface, a memory and a communications bus. Figure 9
[0140] The processor, the communications interface and the memory complete the communication among each other through the communications bus. The communications interface is used for the communication with network elements such as clients or other servers. The processor is used for executing programs, and specifically can execute the related steps in the text abstract generation method for the computing device.
[0141] Specifically, the program can include program codes, and the program codes include computer operation instructions.
[0142] The processor can be a central processing unit CPU, or an application specific integrated circuit ASIC, or one or more integrated circuits configured to implement the embodiment of the present application. The one or more processors included in the computing device can be the same type of processors, such as one or more CPUs; or can be different types of processors, such as one or more CPUs and one or more ASICs.
[0143] The memory is used for storing programs. The memory can include a high-speed RAM memory, and can also include a non-volatile memory, for example, at least one disk memory.
[0144] The program can be specifically used for enabling the processor to execute the text abstract generation method in any method embodiment. The specific implementation of each step in the program can refer to the corresponding description in the corresponding description of the corresponding step and unit in the text abstract generation method embodiment, and will not be described here. Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the device and the module described above can refer to the corresponding process description in the foregoing method embodiments, and will not be described here.
[0145] The algorithms and displays presented herein are not inherently related to any particular computer, virtual system, or other apparatus. Various general purpose systems can be used with programs in accordance with the teachings herein, or it can prove convenient to construct more specialized apparatus to perform the required method steps. The required structure for a variety of these systems will be apparent from the description above. In addition, the present embodiments are not described with reference to any particular programming language. It will be appreciated that a variety of programming languages can be used to implement the teachings of the embodiments as described herein, and any references below to specific languages are provided for disclosure of enablement only.
[0146] In the description provided herein, numerous specific details are set forth. However, it is understood that embodiments of the application can be practiced without these specific details. In some instances, well-known methods, structures and techniques have not been described in detail in order to avoid obscuring the understanding of this description.
[0147] Similarly, it is to be understood that the mechanical details of the application can be practiced without such specific detail. In other instances, well-known methods, structures and techniques have not been described in detail in order to avoid obscuring the understanding of this description.
[0148] It will be appreciated by those skilled in the art that the modules in the device of the embodiments can be adapted and placed in one or more devices other than the device of the embodiments. The modules or units or components in the embodiments can be combined into one module or unit or component and further can be divided into sub-modules or sub-units or sub-components. Any combination of all the features disclosed in the specification (including the accompanying claims, abstract and drawings), and any method or device so disclosed, can be made with any one or more of the features as mutually exclusive, in addition to such features and / or process steps or units being stated to be (part of a measure for providing) measures for solving the problem taught by the embodiments. Unless specifically stated otherwise, each feature disclosed in the specification (including the accompanying claims, abstract and drawings) can be replaced by alternative features providing the same, equivalent, or similar functionality without departing from the scope of the present disclosure.
[0149] Furthermore, those skilled in the art will recognize that, while certain embodiments described herein include certain features that are not included in other embodiments, combinations of features of the different embodiments are meant to be within the scope of the application and form different embodiments. For example, in the claims below, any of the claimed embodiments can be used in any combination.
[0150] Various component embodiments of the application can be implemented in hardware, or as software modules running in one or more processors, or in combinations thereof. Those skilled in the art will appreciate that a microprocessor or digital signal processor (DSP) can be used in practice to implement some or all of the functionality of some or all of the components according to embodiments of the application. Embodiments of the application can also be implemented as a program of instructions for performing part or all of the methods described herein, e.g., a computer program and a computer program product. Such program(s) implementing embodiments of the application can be stored on a computer readable medium, or can be in the form of one or more signals. Such signals can be downloaded from an Internet website, or provided on a carrier medium, or in any other form.
[0151] It should be noted that the above-mentioned embodiments illustrate rather than limit the application, and that one skilled in the art will be able to design many alternative embodiments without departing from the scope of the appended claims. In the claims, any reference signs placed between parentheses shall not be construed as limiting the claim. The word 'comprising' does not exclude the presence of elements or steps other than those listed in a claim. The word 'a' or 'an' preceding an element does not exclude the presence of a plurality of such elements. An embodiment of the application can be implemented by means of hardware comprising several distinct elements, and by means of a suitably programmed computer. In a unit claim, several devices can be listed with a comma. Such listing does not imply that the devices must be co-located. The use of the word 'at least' followed by a list of one or more members does not exclude additional members of the same class or steps. The word 'first','second', 'third', etc. do not imply any order. The terms 'first','second', 'third', etc. are to be interpreted as names. The steps of any of the methods disclosed herein do not have to be performed in the exact order disclosed.
Claims
1. A method for generating a text summary, characterized by, The method comprises: obtaining an original text corpus of multi-topic text and a topic keyword set; obtaining a text corpus related to the topic keywords in the topic keyword set according to the original text corpus; obtaining a preselected abstract corpus according to the text corpus; generating a text abstract according to the preselected abstract corpus; wherein, obtaining a preselected abstract corpus according to the text corpus, comprises: cyclically traversing the text corpus to obtain word vectors, sentence vectors and document vectors obtained each time; obtaining the topic information weight of each sentence, the cosine information weight of the sentence vector and the document vector, the keyword weight of each sentence, the position information weight of the sentence in the document and the sentence length information weight; obtaining the sentence weight according to the topic information weight, the cosine information weight, the keyword weight, the position information weight and the sentence length information weight; obtaining a preselected abstract corpus according to the sentence weight.
2. The method of claim 1, wherein, Obtaining an original text corpus of multi-topic text comprises: obtaining an original corpus of multi-topic text; performing text preprocessing on the original corpus to obtain a preprocessing result; extracting sentence vectors and document vectors according to the preprocessing result to obtain sentence vectors and document vectors of the multi-topic text; obtaining an original text corpus according to the sentence vectors and document vectors of the multi-topic text.
3. The method of claim 1, wherein, According to the original text corpus, obtaining a text corpus related to the topic keywords in the topic keyword set, comprises: using a pre-set classification model to perform binary classification processing on the original text corpus according to the topic keywords in the topic keyword set, to obtain a text corpus related to the topic keywords in the topic keyword set.
4. The method of claim 3, wherein, According to the topic keywords in the topic keyword set, using a pre-set classification model to perform binary classification processing on the original text corpus, to obtain a text corpus related to the topic keywords in the topic keyword set, comprises: cyclically traversing the topic keywords in the topic keyword set to calculate the number of times each traversed topic keyword appears in a sentence; using a pre-set classification algorithm to perform binary classification processing on the original text corpus by taking the number of times as a weight, to obtain a text corpus related to the topic keywords in the topic keyword set.
5. The method of claim 1, wherein, According to the sentence weight, obtaining a preselected abstract corpus, comprises: sorting a plurality of sentences according to the sentence weight, and selecting N sentences to form the preselected abstract corpus, N being a positive integer.
6. The method of claim 1, wherein, According to the preselected abstract corpus, generating a text abstract, comprises: inputting the sentences in the preselected abstract corpus into a trained pre-set network model for processing to generate a text abstract; if the word quantity of the input sentence exceeds a pre-set value, selecting at least one word with a word frequency higher than a first value in the sentence, and connecting the at least one word in order to replace the original sentence, and if the word quantity of the sentence is less than the pre-set value, selecting all the words in the sentence to connect to form a sentence vector.
7. An apparatus for generating a text summary, characterized by comprising: The device comprises: An acquisition module is configured to obtain an original text corpus of a multi-topic text and a set of topic keywords; A processing module is configured to obtain a text corpus related to a topic keyword in the set of topic keywords according to the original text corpus, and obtain a pre-selected abstract corpus according to the text corpus; An output module is configured to generate a text abstract according to the pre-selected abstract corpus; The processing module is further configured to loop through the text corpus to obtain a word vector, a sentence vector and a document vector obtained in each loop; obtain a topic information weight of each sentence, a cosine information weight of the sentence vector and the document vector, a keyword weight of each sentence, a position information weight of the sentence in the document and a sentence length information weight; obtain a sentence weight according to the topic information weight, the cosine information weight, the keyword weight, the position information weight and the sentence length information weight; obtain a pre-selected abstract corpus according to the sentence weight.
8. A computing device comprising: A processor, a memory, a communication interface and a communication bus, the processor, the memory and the communication interface complete communication with each other through the communication bus; The memory is configured to store at least one executable instruction, and the executable instruction causes the processor to perform operations corresponding to the method for generating a text abstract in any one of claims 1-6. 9.A computer storage medium, the storage medium storing at least one executable instruction, and the executable instruction causing a processor to perform operations corresponding to the method for generating a text abstract in any one of claims 1-6.
Citation Information
Patent Citations
Abstract generation method and device, server and storage medium
CN109657054A
Case element and BiGRU-based case-related public opinion news text abstract method
CN110489541A