Document processing method, document summary generation method and device

By inserting keywords into document processing and using a pre-trained language model to calculate perplexity, combined with statistical information to filter target documents, the problem of insufficient semantic relevance in existing technologies is solved, thereby improving the effectiveness of document processing and the quality of summary generation.

CN115563240BActive Publication Date: 2026-02-06TSINGHUA UNIVERSITY
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211035766.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-08-26
Publication Date
2026-02-06
Estimated Expiration
2042-08-26

AI Technical Summary

Technical Problem

Existing document processing methods based on statistical information cannot effectively measure the semantic relevance between documents and keywords, leading to the misfiltering of highly relevant target documents and failing to guarantee the effectiveness of documents.

Method used

By acquiring the set of documents to be processed and the set of keywords, inserting keywords, calculating the perplexity using a pre-trained language model, and combining statistical information to determine the scoring results of the documents, the target documents are selected.

Benefits of technology

It improves the effectiveness of document processing, ensures the semantic relevance of target documents to keywords, enhances the effect of summary generation, and enables rapid browsing and retrieval of information.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115563240B_ABST
    Figure CN115563240B_ABST
Patent Text Reader

Abstract

The application provides a document processing method, a document abstract generation method and device. The document processing method comprises: obtaining a document set to be processed and a keyword set; inserting keywords in the keyword set into each document to be processed in the document set to be processed respectively to obtain a sequence to be tested; determining the perplexity of each sequence to be tested, and determining a first score result of each document to be processed based on the perplexity of each sequence to be tested; screening the document set to be processed based on the first score result of each document to be processed to obtain a target document. The document abstract generation method comprises: extracting the target document from the document set to be processed based on each keyword in the keyword set; and generating an abstract based on the target document. The application can effectively improve the effectiveness of the target document, thereby ensuring the generation effect of the abstract.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of natural language understanding, and in particular to a document processing method and a document abstract generation method and device. BACKGROUND

[0002] With the rapid development of the Internet, document information is rapidly expanding, and how to process massive document information to obtain target documents with higher relevance plays a particularly key role in multi-document abstract generation, information retrieval, open domain question answering and the like.

[0003] The existing document processing method usually adopts a statistical information method, that is, the relevance between a candidate document and a keyword is measured by using statistical information such as word frequency and inverse document frequency, and the target document is extracted based on the relevance.

[0004] However, the method based on statistical information does not need training, but is subject to the existing statistical information which only considers the complete matching of words in a document and a keyword, resulting in that a document containing no keyword but containing relevant semantic context is mis-filtered, so that the effectiveness of the obtained target document cannot be guaranteed. SUMMARY

[0005] In view of the problems in the prior art, the present application provides a document processing method, a document abstract generation method and device.

[0006] The present application provides a document processing method, comprising:

[0007] obtaining a set of to-be-processed documents and a set of keywords;

[0008] inserting the keywords in the set of keywords into each to-be-processed document in the set of to-be-processed documents respectively to obtain a to-be-tested sequence;

[0009] determining the perplexity of each to-be-tested sequence, and determining a first scoring result of each to-be-processed document based on the perplexity of each to-be-tested sequence;

[0010] screening the set of to-be-processed documents based on the first scoring result of each to-be-processed document to obtain a target document.

[0011] According to the document processing method provided by the present application, the keywords in the set of keywords are inserted into each to-be-processed document in the set of to-be-processed documents respectively to obtain a to-be-tested sequence, comprising:

[0012] determining one or more target templates from a preset template set;

[0013] inserting the keyword into the to-be-processed document based on the target template, to obtain the to-be-tested sequence; wherein the target template is used to represent the position relationship between the keyword and the to-be-processed document.

[0014] According to the document processing method provided in the application, the perplexity of each to-be-tested sequence is determined, comprising:

[0015] inputting the to-be-tested sequence into a pre-trained language model to obtain a word vector matrix of the to-be-tested sequence;

[0016] determining the perplexity of the to-be-tested sequence based on the word vector matrix.

[0017] According to the document processing method provided in the application, the first score result of each to-be-processed document is determined based on the perplexity of each to-be-tested sequence, comprising:

[0018] obtaining the average perplexity of each to-be-tested sequence corresponding to the to-be-processed document, to obtain an average perplexity;

[0019] determining the first score result of the to-be-processed document based on the average perplexity.

[0020] According to the document processing method provided in the application, further comprising: obtaining a second score result of the to-be-processed document; wherein the second score result is obtained based on the statistical information of each keyword in the keyword set in the to-be-processed document;

[0021] The to-be-processed document set is screened based on the first score result of each to-be-processed document, to obtain a target document, comprising:

[0022] The first score result of the to-be-processed document and the second score result of the to-be-processed document are fused to obtain a comprehensive score result of the to-be-processed document;

[0023] The to-be-processed document set is screened based on the comprehensive score result of each to-be-processed document, to obtain a target document.

[0024] According to the document processing method provided in the application, the first score result of the to-be-processed document and the second score result of the to-be-processed document are fused to obtain a comprehensive score result of the to-be-processed document, comprising:

[0025] The first score result and the second score result are both normalized;

[0026] The first score result after normalization and the second score result after normalization are weighted and summed based on a preset weight, to obtain the comprehensive score result of the to-be-processed document.

[0027] The present application provides a document summary generation method, comprising:

[0028] extracting a target document from a set of to-be-processed documents based on each keyword in a keyword set; wherein the target document is obtained by processing each to-be-processed document in the set of to-be-processed documents based on any one of the above-mentioned document processing methods;

[0029] generating a summary based on the target document.

[0030] The present application also provides a document processing apparatus, comprising:

[0031] a data acquisition unit configured to acquire a set of to-be-processed documents and a keyword set;

[0032] a first processing unit configured to insert each keyword in the keyword set into each to-be-processed document in the set of to-be-processed documents to obtain a set of to-be-tested sequences;

[0033] a second processing unit configured to determine the perplexity of each to-be-tested sequence and determine a first scoring result of each to-be-processed document based on the perplexity of each to-be-tested sequence;

[0034] a third processing unit configured to screen the set of to-be-processed documents based on the first scoring result of each to-be-processed document to obtain a target document.

[0035] The present application also provides a document summary generation apparatus, comprising:

[0036] a first calculation unit configured to extract a target document from a set of to-be-processed documents based on each keyword in a keyword set; wherein the target document is obtained by processing each to-be-processed document in the set of to-be-processed documents based on any one of the above-mentioned document processing methods;

[0037] a second calculation unit configured to generate a summary based on the target document.

[0038] The present application also provides an electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the document processing method or the document summary generation method according to any one of the above-mentioned methods when executing the program.

[0039] The document processing method, document summarization method, and apparatus provided by this invention acquire a set of documents to be processed and a set of keywords. Keywords from the keyword set are inserted into each document in the set to be processed to obtain a test sequence. The perplexity of each test sequence is determined, and a first score is determined for each document based on its perplexity. The set of documents is then filtered based on these first scores to obtain target documents. This approach fully considers the semantic relevance between keywords and documents, ensuring the effectiveness of the target documents obtained through document processing. Furthermore, the process of generating summaries from the target documents further guarantees the quality of the generated summaries, enabling rapid browsing, retrieval, and use of information. Attached Figure Description

[0040] To more clearly illustrate the technical solutions in this invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0041] Figure 1 This is a flowchart illustrating the document processing method provided by the present invention;

[0042] Figure 2 This is a flowchart illustrating the document summary generation method provided by the present invention;

[0043] Figure 3 This is a schematic diagram of the document processing device provided by the present invention;

[0044] Figure 4 This is a schematic diagram of the document summarization generation device provided by the present invention;

[0045] Figure 5 This is a schematic diagram of the structure of the electronic device provided by the present invention. Detailed Implementation

[0046] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.

[0047] The following is combined Figure 1 This invention describes a document processing method. This document processing method is executed by an electronic device such as a computer, or by the hardware and / or software therein.Figure 1 The flowchart of the document processing method is shown in FIG. 1. Figure 1 The document processing method includes the following steps.

[0048] S101, obtaining a set of to-be-processed documents and a set of keywords.

[0049] Specifically, the set of to-be-processed documents is a set of documents to be processed, and the set of to-be-processed documents includes a plurality of to-be-processed documents, for example, a large number of documents of a relevant field searched from a network. The set of keywords includes one or more keywords, and the keywords can be determined according to information acquisition requirements. The set of to-be-processed documents can be represented as D = {d1, d2, …, dn}, where di (i ∈ [1, n]) is the ith to-be-processed document, and n is the number of to-be-processed documents in the set of to-be-processed documents. The set of keywords can be represented as K = {k1, k2, …, km}, where kj (j ∈ [1, m]) is the jth keyword in the set of keywords, and m is the number of keywords in the set of keywords. n i di is the ith to-be-processed document, i ∈ [1, n], and n is the number of to-be-processed documents in the set of to-be-processed documents; the set of keywords can be represented as K = {k1, k2, …, km}, where kj (j ∈ [1, m]) is the jth keyword in the set of keywords, and m is the number of keywords in the set of keywords. m j di is the ith to-be-processed document, i ∈ [1, n], and n is the number of to-be-processed documents in the set of to-be-processed documents; the set of keywords can be represented as K = {k1, k2, …, km}, where kj (j ∈ [1, m]) is the jth keyword in the set of keywords, and m is the number of keywords in the set of keywords.

[0050] S102, inserting the keywords in the set of keywords into the to-be-processed documents in the set of to-be-processed documents respectively to obtain to-be-tested sequences.

[0051] Specifically, the keywords in the set of keywords are inserted into the to-be-processed documents in the set of to-be-processed documents respectively, that is, each keyword kj (j ∈ [1, m]) in the set of keywords is inserted into each to-be-processed document di (i ∈ [1, n]) to obtain a plurality of to-be-tested sequences. The to-be-tested sequence s(kj, di) is a sequence obtained by inserting the keyword kj into the to-be-processed document di. j i j i j i

[0052] The specific way of inserting the keywords in the set of keywords into the to-be-processed documents in the set of to-be-processed documents can be set according to actual requirements, for example, the keywords can be inserted into the corresponding positions of the to-be-processed documents after being processed by different templates. The specific way of processing the keywords can also be set according to actual requirements, for example, the keywords can be expanded into different sentences or phrases according to the field or information acquisition requirements.

[0053] S103, determining the perplexity of each to-be-tested sequence, and determining the first score result of each to-be-processed document based on the perplexity of each to-be-tested sequence.

[0054] ​​​​​​​​Specifically, the perplexity is mainly used to measure the probability of each word in the to-be-sequenced sequence appearing at the position. The to-be-sequenced sequence can be input into the perplexity calculator to output the perplexity of the to-be-sequenced sequence through the perplexity calculator; wherein the specific type of the perplexity calculator can be set according to actual needs, for example, it can be a pre-trained language model. Since the to-be-sequenced sequence is obtained by connecting the keyword and the to-be-processed document, the probability of the to-be-processed document appearing in the context of the keyword can be effectively measured according to the obtained perplexity.

[0055] After obtaining the perplexity of each to-be-sequenced sequence, the first scoring result of the to-be-processed document can be further determined according to the perplexity of each to-be-sequenced sequence, for example, the perplexity of each to-be-sequenced sequence corresponding to the to-be-processed document can be summed / averaged, and the first scoring result of the to-be-processed document is determined based on the summing / averaging result, so that the first scoring result can effectively represent the semantic correlation degree of the to-be-processed document and the keyword set, and at the same time, the to-be-processed document that does not contain the keyword but contains the related semantic context is avoided from being misfiltered.

[0056] S104, screening the set of to-be-processed documents based on the first scoring result of each to-be-processed document to obtain a target document.

[0057] Specifically, the specific way of screening the set of to-be-processed documents based on the first scoring result of the to-be-processed document can be set according to actual needs, for example, the set of to-be-processed documents can be directly screened according to the first scoring result, or the first scoring result can be combined with the scoring result obtained by other methods to obtain a comprehensive scoring result of the to-be-processed document, and the set of to-be-processed documents is screened based on the comprehensive scoring result to obtain the target document. For example, the first scoring result can be combined with the scoring result obtained based on the statistical information method, and the first scoring result can also be combined with the scoring result obtained based on the regression prediction method. The regression prediction method, for example, uses the ROUGE (Recall-Oriented Understudy for Gisting Evaluation) score between the candidate document and the standard output result as the label to regress the scoring model, and determines the coincidence degree between the to-be-processed document and the standard output result based on the trained scoring model.

[0058] The embodiment of the present application can obtain a document set to be processed and a keyword set, insert keywords in the keyword set into each document to be processed in the document set to be processed to obtain a test sequence, determine the perplexity of each test sequence, determine the first score result of each document to be processed based on the perplexity of each test sequence, and screen the document set to be processed based on the first score result of each document to be processed to obtain a target document, which can fully consider the semantic correlation between the keywords and the document to be processed, and ensure the effectiveness of the target document obtained by processing the document.

[0059] Based on the above embodiment, the keywords in the keyword set are inserted into each document to be processed in the document set to be processed to obtain a test sequence, which includes:

[0060] determining one or more target templates from a preset template set;

[0061] inserting the keywords into the document to be processed based on the target template to obtain the test sequence; wherein the target template is used to represent the positional relationship between the keywords and the document to be processed.

[0062] Specifically, each template in the template set is used to represent the positional relationship between the keywords and the document to be processed, for example, it can be a prompt template. The prompt template is given a downstream task and a pre-trained language model, and the template is constructed to transform the format of the input into the original task format of the pre-trained language model, so as to prompt the pre-trained language model to output the answer in the original pre-training task format. For example, given a sentiment classification task and a pre-trained language model, the known instance input is "today the weather is good", and a prompt template such as "today the weather is good, the mood is very __" needs to be constructed to let the pre-trained language model predict the next word, and the sentiment classification is performed according to the predicted word.

[0063] Among them, one or more target templates can be allocated to each of the to-be-processed document set according to the information acquisition requirement. The type of the template can be a general template, or a specific template designed according to different fields. Among them, the general template is suitable for documents in any field, for example, it can be "this document is about k.d", the position of "k" in the template is used to insert the keyword, and the position of "d" is used to insert the to-be-processed document. The specific template of different fields can be set according to the related topics of the field. For example, it can be designed as a conclusion type template or a question type template according to the related topics; the conclusion type template inserts the keyword into the context of the to-be-processed document in a summary sentence, and if a conclusion about the attribute of the keyword can be inferred from the to-be-processed document, it is assumed that the to-be-processed document is valid; the question type template inserts the keyword into the context of the to-be-processed document in a summary sentence, and if the to-be-processed document contains important information that can answer the question about the keyword, it is assumed that the to-be-processed document is valid. Taking the template of the animal field as an example, the related topics include species, distribution, habits, etc. For the related topics, templates as shown in Table 1 can be designed.

[0064] Table 1

[0065] Type Template Conclusion Template 0 d. This document is about k. Conclusion Template 1 d. The distribution of k has been mentioned in the above sentence. Conclusion Template 2 d. This document introduces the subspecies of k. Conclusion Template 3 d. This document describes k. Conclusion Template 4 d. This document introduces the conservation status of k. Question Template 0 d. What does k like? Question Template 1 d. What is the classification method of k? Question Template 2 d. What are the species of k? Question Template 3 d. What are the subspecies of k? Question Template 4 d. What does k eat? Question Template 5 d. Where does k live? Question Template 6 d. What is the daily diet of k? Question Template 7 d. What are the living habits of k? Question Template 8 d. How does k reproduce? Question Template 9 d. What is the conservation status of k?

[0066] It can be understood that the keyword can also not be inserted into the to-be-processed document, and the perplexity of the to-be-processed document can be directly calculated. Among them, whether the keyword is inserted into the to-be-processed document and the selection of the type of the template can be set according to the accuracy requirement.

[0067] The embodiment of the application determines one or more target templates from a preset template set, and inserts the keyword into the to-be-processed document based on the target template, which can effectively ensure the semantic relevance of the target document and the keyword; at the same time, based on the target template, the keyword is inserted into the to-be-processed document, without the participation of the model, so as to avoid the overfitting or underfitting problem caused in the model training process, and ensure the validity of the target document.

[0068] Based on any of the above embodiments, the perplexity of each of the to-be-sequenced sequences is determined, comprising:

[0069] inputting the to-be-sequenced sequence into a pre-trained language model to obtain a word vector matrix of the to-be-sequenced sequence;

[0070] determining the perplexity of the to-be-sequenced sequence based on the word vector matrix.

[0071] Specifically, a pre-trained language model is a language model whose parameters have been initialized on another task. For example, the language model has been pre-trained in other applications before being applied. The specific type of pre-trained language model can be set according to actual needs, such as GPT2 (Generative Pre-Training), GPT3, or GLM (General Language Model).

[0072] After inputting the test sequence into a pre-trained language model, the model can parse the sequence into a word vector matrix, i.e., obtain a semantic representation matrix of the test sequence. This semantic representation matrix can then be used to calculate perplexity. For example, the test sequence s = [w1, w2, ..., w... T ], w t Let be the t-th word vector in the word vector matrix, where t∈[1,T] and T is the number of word vectors in the word vector matrix. A softmax layer can be connected to the output layer of the pre-trained language model. The softmax layer calculates the perplexity based on the word vector matrix output by the pre-trained language model to output the perplexity of the test sequence. The perplexity calculation of the test sequence based on the word vector matrix can be shown in Equation (1):

[0073]

[0074] In the formula, PPL(s) represents the perplexity of the test sequence s; w <t For w t The previous t-1 word vectors, i.e. w <t =[w1,w2,…,w t-1 ], where, at t=1, w <t Empty; p θ (w t |w <t ) for w t The word vector w that appears in the first t-1 words 1:t-1 The probability after that.

[0075] The existing document processing method also adopts a regression prediction-based method, that is, taking the ROUGE score between the candidate document and the standard output result as a label to train a scoring model to perform a regression task, and using the trained scoring model to predict the coincidence degree between the candidate document and the standard output result in the related document extraction process, so as to extract the target document according to the coincidence degree. However, this method aims to use the scoring model to fit the pre-defined index ROUGE, but the fitting capability completely depends on the distribution of the data in the training set, which is prone to overfitting or underfitting problems. In addition, the target document obtained by processing a large amount of document information is finally used as the input in the application stage, and the pre-defined index such as ROUGE cannot completely measure the effectiveness of the target document.

[0076] The embodiment of the present application inputs the to-be-tested sequence into the pre-trained language model to obtain the word vector matrix of the to-be-tested sequence, and determines the perplexity of the to-be-tested sequence based on the word vector matrix. The perplexity can effectively measure the probability that the to-be-processed document appears in the context of the keyword, and thus the semantic correlation between the obtained target document and the keyword can be ensured, and the effectiveness of the target document is improved. Meanwhile, the embodiment of the present application determines the perplexity of the to-be-tested sequence through the pre-trained language model, and the to-be-tested sequence is obtained by inserting the keyword into the to-be-processed document. The whole process is unsupervised, and the training of the scoring model based on the pre-defined index is not required, and thus the influence of overfitting or underfitting in the model training process on the effectiveness of the target document is avoided.

[0077] Based on any of the above embodiments, the first scoring result of each to-be-processed document is determined based on the perplexity of each to-be-tested sequence.

[0078] The average perplexity of each to-be-tested sequence corresponding to the to-be-processed document is obtained, and the average perplexity is obtained.

[0079] The first scoring result of the to-be-processed document is determined based on the average perplexity.

[0080] Specifically, the perplexity of each to-be-tested sequence corresponding to the to-be-processed document can be averaged to obtain the average perplexity corresponding to the to-be-processed document, and the first scoring result of the to-be-processed document is determined according to the average perplexity.

[0081] The to-be-tested sequence corresponding to the to-be-processed document includes to-be-tested sequences obtained by inserting all keywords in the keyword set into the to-be-processed document according to different target templates. The average perplexity of each to-be-tested sequence corresponding to the to-be-processed document can be as shown in formula (2):

[0082]

[0083] In the formula, g S(K, d) is the average perplexity of the to-be-processed document d based on the keyword set K; X is a target template set composed of target templates; |K| is the number of keywords in the keyword set; |X| is the number of target templates in the target template set; s x (k, d) is the to-be-measured sequence obtained by inserting the keyword k into the to-be-processed document d based on the target template x.

[0084] The specific manner of determining the first score result of the to-be-processed document according to the average perplexity can be set according to actual needs. For example, the average perplexity of the to-be-processed document can be directly taken as the first score result of the to-be-processed document, or the average perplexity can be modified and then taken as the first score result of the to-be-processed document.

[0085] The embodiment of the application obtains the average perplexity by obtaining the average value of the perplexities of the to-be-measured sequences corresponding to the to-be-processed document, and determines the first score result of the to-be-processed document based on the average perplexity. The first score result obtained can represent the semantic correlation between the to-be-processed document and all keywords in the keyword set, thereby further improving the effectiveness of the target document obtained according to the first score result.

[0086] Based on any of the above embodiments, the method further includes: obtaining a second score result of the to-be-processed document; wherein the second score result is obtained based on statistical information of each keyword in the keyword set in the to-be-processed document.

[0087] The method further includes: screening the set of to-be-processed documents based on the first score result of each to-be-processed document to obtain a target document.

[0088] The method further includes: fusing the first score result of the to-be-processed document and the second score result of the to-be-processed document to obtain a comprehensive score result of the to-be-processed document.

[0089] The method further includes: screening the set of to-be-processed documents based on the comprehensive score result of each to-be-processed document to obtain a target document.

[0090] Specifically, the second score result is obtained based on statistical information of each keyword in the keyword set in the to-be-processed document. The statistical information can be term frequency, inverse document frequency, etc. The specific manner of obtaining the statistical information of the keyword in the to-be-processed document can be set according to actual needs. For example, the TF-IDF (term frequency–inversed document frequency) method can be used to determine the statistical information of each keyword in the to-be-processed document, or the BM25 (Best Match) method can be used to determine the statistical information of each keyword in the to-be-processed document.

[0091] After obtaining the statistical information of each keyword in the keyword set in the to-be-processed document, the joint probability of all keywords in the keyword set appearing in the to-be-processed document at the same time can be determined through multiplication operation, and the second scoring result of the to-be-processed document can be determined according to the joint probability.

[0092] As an optional implementation, the second scoring result of the to-be-processed document is obtained through the following steps:

[0093] 1) The degree of lexical coincidence of each keyword in the keyword set and the to-be-processed document is determined by using the TF-IDF method, as shown in formula (3):

[0094]

[0095] In the formula, g L (k, d) is the degree of lexical coincidence of the keyword k and the to-be-processed document d, and the degree of lexical coincidence of the keyword k and the to-be-processed document d is used to represent the conditional probability of the keyword k appearing in the to-be-processed document d; is the number of times of the keyword k appearing in the to-be-processed document d; |d| is the length of the to-be-processed document d; n is the number of to-be-processed documents in the to-be-processed document set; n k is the number of to-be-processed documents in the to-be-processed document set containing the keyword k.

[0096] 2) The degrees of lexical coincidence of each keyword in the keyword set and the to-be-processed document are multiplied to obtain the joint probability of all keywords in the keyword set appearing in the to-be-processed document at the same time, as shown in formula (4):

[0097] g L (K, d) = ∏ k∈K g L (k, d) (4)

[0098] In the formula, g L (K, d) is the joint probability of all keywords in the keyword set K appearing in the to-be-processed document d at the same time.

[0099] 3) The second scoring result of the to-be-processed document is determined based on the joint probability of all keywords in the keyword set appearing in the to-be-processed document at the same time. For example, the joint probability can be directly taken as the second scoring result of the to-be-processed document, or the joint probability can be corrected and then taken as the second scoring result of the to-be-processed document.

[0100] After obtaining the second scoring result of the to-be-processed document, the first scoring result of the to-be-processed document and the second scoring result of the to-be-processed document can be fused to obtain a comprehensive scoring result of the to-be-processed document. The specific way of fusing the first scoring result and the second scoring result can be set according to actual needs, for example, the first scoring result and the second scoring result can be weighted and summed to obtain the comprehensive scoring result of the to-be-processed document.

[0101] After obtaining the comprehensive scoring result of each to-be-processed document in the set of to-be-processed documents, the set of to-be-processed documents can be further screened according to the comprehensive scoring result of the to-be-processed document to obtain the target document, so that the semantic relevance and statistical characteristics of the to-be-processed document and the keyword can be comprehensively considered, and the effectiveness of the target document is further improved.

[0102] Among them, the specific way of screening the set of to-be-processed documents according to the comprehensive scoring result of the to-be-processed document can be set according to actual needs, for example, the comprehensive scoring result can be compared with a preset threshold, and the to-be-processed document with a comprehensive scoring result greater than or equal to the preset threshold can be taken as the target document; the to-be-processed documents can also be sorted according to the comprehensive scoring result, and the target document can be extracted according to the sorting result.

[0103] Based on any of the above embodiments, the first scoring result of the to-be-processed document and the second scoring result of the to-be-processed document are fused to obtain a comprehensive scoring result of the to-be-processed document, comprising:

[0104] The first scoring result and the second scoring result are normalized;

[0105] The first scoring result after normalization and the second scoring result after normalization are weighted and summed based on a preset weight to obtain the comprehensive scoring result of the to-be-processed document.

[0106] Specifically, in the process of fusing the first scoring result and the second scoring result of the to-be-processed document, the first scoring result and the second scoring result can be normalized first to make the first scoring result and the second scoring result in the same order of magnitude. The specific way of normalization can be as shown in formula (5):

[0107]

[0108] In the formula, is the hth scoring result of the ith to-be-processed document in the set of to-be-processed documents; μ h is the mean of the hth scoring result of each to-be-processed document in the set of to-be-processed documents; σ h is the variance of the hth scoring result of each to-be-processed document in the set of to-be-processed documents. is a normalized result of the hth scoring result of the ith to-be-processed document in the to-be-processed document set.

[0109] After the normalization of the first scoring result and the second scoring result, the normalized first scoring result and the normalized second scoring result are further weighted and summed based on a preset weight value to obtain a comprehensive scoring result of the to-be-processed document. The weighted and summed normalized first scoring result and normalized second scoring result based on the preset weight value are as shown in formula (6):

[0110]

[0111] In the formula, is a comprehensive scoring result of the ith to-be-processed document in the to-be-processed document set; γ is a weight value of the first scoring result, 0<γ<1, and the value of γ can be set according to actual requirements, for example, it can be set to 0.75.

[0112] The embodiment of the present application normalizes the first scoring result and the second scoring result, and weights and sums the normalized first scoring result and the normalized second scoring result based on a preset weight value to obtain a comprehensive scoring result of the to-be-processed document, which can effectively consider the semantic relevance of the to-be-processed document and the key word and the importance of the statistical characteristics, so that the effectiveness of the target document can be further improved according to the comprehensive scoring result of the to-be-processed document.

[0113] The present application will be described below in conjunction with Figure 2 The document abstract generation method of the present application is executed by a computer or other electronic device, hardware and / or software therein. As shown in Figure 2 The document abstract generation method of the present application includes:

[0114] S201, extracting a target document from a to-be-processed document set based on each key word in a key word set; wherein the target document is obtained by processing each to-be-processed document in the to-be-processed document set based on the document processing method of any one of the above embodiments;

[0115] S202, generating an abstract based on the target document.

[0116] Specifically, the document abstract generation is to generate an abstract around a key word using effective information in a plurality of documents and the key word. The extraction of the document from the given to-be-processed document set can be performed based on each key word in the given key word set to obtain a target document related to the key word.

[0117] After the target documents related to the keywords are extracted from the document set to be processed, an abstract can be further generated based on the target documents. The number of target documents can be one or multiple, and the specific way of generating an abstract based on the target documents can be performed according to actual needs. For example, each target document can be sentence segmented, tokenized, and stop word removed to represent each target document as a vector, and the vectors corresponding to each target document are input into a pre-trained abstract generation model to generate an abstract related to each keyword in the keyword set using the effective information in each target document. The abstract generation model can be a BART (Bayesian Additive Regression Trees) model, an LED (Longformer Encoder Decoder) model, or the like.

[0118] The embodiments of the present application can effectively ensure the effectiveness of the target documents extracted from the document set to be processed, thereby improving the amount of information contained in the abstract in the process of generating the abstract based on the target documents, ensuring the generation effect of the abstract, and further enabling quick browsing, obtaining, and using of information according to the generated abstract.

[0119] It can be understood that, according to the generated target document, information retrieval, open domain question answering, and the like can also be used.

[0120] The effectiveness of the document abstract generation method of the present application is further illustrated by the following test. The test data is obtained from the WikiSum dataset and the WCEP dataset, including document sets of three fields of company, movie, and animal.

[0121] Test 1: TF-S2S (Transformer sequence to sequence), C2T (Generating summaries with topic templates and structured convolutional decoders), TWAG (Topic-Guided Wikipedia Abstract Generator), UniLMv2 (Unified Language Model), Noisysumm (Noisy self-knowledge distillation for text summarization), BART, BART+UPER (Unsupervised Prompt-based ExtractoR), LED and LED+UPER are used to generate summaries, and R1 (Rouge-1), R2 (Rouge-2) and RL (Rouge-L) summary evaluation indicators are used as evaluation criteria to compare the summaries generated by each method. The comparison results are shown in Table 2. Among them, UPER is the document processing method of the application, BART+UPER means adding the document processing method of the application to the existing BART summary generation method to extract the target document, and LED+UPER means adding the document processing method of the application to the existing LED summary generation method to extract the target document.

[0122] Table 2

[0123]

[0124] As can be seen from Table 2, after adding the document processing method of the application, the effect of the generated summary is significantly improved.

[0125] Test 2: In the case of completely supervised training of the summary generation model, the random method (Random), the TF-IDF method and the document processing method (UPER) of the application are used to extract the target document from the document set to be processed, and R1 (Rouge-1), R2 (Rouge-2) and RL (Rouge-L) summary evaluation indicators are used as evaluation criteria to compare the summaries generated by each method. The comparison results are shown in Table 3.

[0126] Table 3

[0127] Extraction Method R1 R2 RL Random 39.1 16.4 31.2 TF-IDF 39.8 17.0 32.0 UPER 41.4 18.7 33.8

[0128] As shown in Table 3, the effect of the summary generated by the target document obtained by the document processing method of the present application is significantly improved.

[0129] Test three: in the case of weakly supervised training of the summary generation model, the target document is extracted from the document set to be processed by using the random method (Random), the TF-IDF method and the document processing method (UPER) of the present application respectively, and the summaries generated by each method are compared based on the summary evaluation indexes R1 (Rouge-1), R2 (Rouge-2) and RL (Rouge-L), and the comparison results are shown in Table 4.

[0130] Table 4

[0131] Extraction Method R1 R2 RL Random 34.8 12.5 26.8 TF-IDF 35.0 12.6 27.3 UPER 35.1 12.8 27.4

[0132] As shown in Table 4, the effect of the summary generated by the target document obtained by the document processing method of the present application is significantly improved.

[0133] The document processing device provided by the present application is described below, and the document processing device described below can be referred to each other corresponding to the document processing method described above. As shown in Figure 3 The document processing device of the present application comprises:

[0134] The data acquisition unit 301 is configured to acquire a document set to be processed and a keyword set;

[0135] The first processing unit 302 is configured to insert the keywords in the keyword set into each document to be processed in the document set to be processed respectively, to obtain a test sequence;

[0136] The second processing unit 303 is configured to determine the perplexity of each test sequence, and determine the first score result of each document to be processed based on the perplexity of each test sequence;

[0137] The third processing unit 304 is configured to filter the document set to be processed based on the first score result of each document to be processed, to obtain a target document.

[0138] Based on the above embodiment, the first processing unit 302 is specifically configured to:

[0139] determine one or more target templates from a preset template set;

[0140] insert the keywords into the document to be processed based on the target template, to obtain the test sequence; wherein the target template is used to represent the positional relationship between the keywords and the document to be processed.

[0141] Based on any of the above embodiments, the second processing unit 303 is specifically configured to:

[0142] input the to-be-tested sequence into a pre-trained language model to obtain a word vector matrix of the to-be-tested sequence;

[0143] determine the perplexity of the to-be-tested sequence based on the word vector matrix.

[0144] Based on any of the above embodiments, the second processing unit 303 is specifically configured to:

[0145] obtain an average perplexity of the to-be-tested sequence corresponding to the to-be-processed document, to obtain an average perplexity;

[0146] determine the first score result of the to-be-processed document based on the average perplexity.

[0147] Based on any of the above embodiments, the fourth processing unit is further configured to:

[0148] obtain a second score result of the to-be-processed document, wherein the second score result is obtained based on statistical information of each keyword in the keyword set in the to-be-processed document;

[0149] The third processing unit 304 is specifically configured to:

[0150] fuse the first score result of the to-be-processed document and the second score result of the to-be-processed document to obtain a comprehensive score result of the to-be-processed document;

[0151] screen the set of to-be-processed documents based on the comprehensive score result of each to-be-processed document to obtain a target document.

[0152] Based on any of the above embodiments, the third processing unit 304 is specifically configured to:

[0153] normalize the first score result and the second score result;

[0154] weight and sum the normalized first score result and the normalized second score result based on a preset weight to obtain the comprehensive score result of the to-be-processed document.

[0155] The document abstract generation device provided by the present application is described below. The document abstract generation device described below can be referred to in correspondence with the document abstract generation method described above. As shown in Figure 4 The document abstract generation device provided by the present application includes:

[0156] The first calculation unit 401 is used to extract target documents from the document set to be processed based on each keyword in the keyword set; wherein the target documents are obtained by processing each document to be processed in the document set to be processed based on the document processing method described in any of the above embodiments;

[0157] The second calculation unit 402 is used to generate a summary based on the target document.

[0158] Figure 5 An example is a schematic diagram of the physical structure of an electronic device, such as... Figure 5 As shown, the electronic device may include a processor 501, a communications interface 502, a memory 503, and a communication bus 504. The processor 501, communications interface 502, and memory 503 communicate with each other via the communication bus 504. The processor 501 can call logical instructions in the memory 503 to execute a document processing method or a document summary generation method. The document processing method includes: acquiring a set of documents to be processed and a set of keywords.

[0159] The keywords in the keyword set are inserted into each document in the document set to be processed to obtain the test sequence;

[0160] Determine the perplexity of each of the test sequences, and determine a first score result for each of the documents to be processed based on the perplexity of each of the test sequences;

[0161] The target documents are obtained by filtering the set of documents to be processed based on the first score results of each document to be processed.

[0162] The document summary generation method includes: extracting target documents from a document set to be processed based on each keyword in the keyword set; wherein, the target documents are obtained by processing each document in the document set to be processed based on the document processing method described in any of the above embodiments;

[0163] A summary is generated based on the target document.

[0164] Further, the logic instructions in the memory 503 described above can be implemented in the form of software functional units and sold or used as standalone products, and can be stored in a computer readable storage medium. Based on such understanding, the technical solutions of the present application essentially or partially contribute to the prior art, or part of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium, and includes several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), magnetic disk or optical disk, and various media that can store program codes.

[0165] In another aspect, the present application also provides a computer program product, which comprises a computer program, the computer program can be stored on a non-transitory computer readable storage medium, and the computer program can be executed by a processor to enable a computer to execute the document processing method or the document abstract generation method provided by the above-mentioned methods. The document processing method comprises: obtaining a set of to-be-processed documents and a set of keywords;

[0166] Inserting the keywords in the set of keywords into each to-be-processed document in the set of to-be-processed documents respectively to obtain a set of to-be-tested sequences;

[0167] Determining the perplexity of each to-be-tested sequence, and determining a first scoring result of each to-be-processed document based on the perplexity of each to-be-tested sequence;

[0168] Screening the set of to-be-processed documents based on the first scoring result of each to-be-processed document to obtain a target document.

[0169] The document abstract generation method comprises: extracting a target document from the set of to-be-processed documents based on each keyword in the set of keywords; wherein the target document is obtained by processing each to-be-processed document in the set of to-be-processed documents based on the document processing method described in any one of the above embodiments;

[0170] Generating an abstract based on the target document.

[0171] In yet another aspect, the present application also provides a non-transitory computer readable storage medium, which stores a computer program, and the computer program is executed by a processor to implement the document processing method or the document abstract generation method provided by the above-mentioned methods. The document processing method comprises: obtaining a set of to-be-processed documents and a set of keywords;

[0172] Insert the keywords in the keyword set into each to-be-processed document in the to-be-processed document set respectively to obtain to-be-tested sequences;

[0173] Determine the perplexity of each to-be-tested sequence, and determine a first scoring result of each to-be-processed document based on the perplexity of each to-be-tested sequence;

[0174] Screen the to-be-processed document set based on the first scoring result of each to-be-processed document to obtain target documents.

[0175] The document summarization generation method comprises: extracting target documents from a to-be-processed document set based on each keyword in a keyword set; wherein the target documents are obtained by processing each to-be-processed document in the to-be-processed document set based on the document processing method in any of the above embodiments;

[0176] Generating a summary based on the target documents.

[0177] The device embodiments described above are merely illustrative, wherein the units illustrated as separate components can or can not be physically separated, and the components illustrated as units can or can not be physical units, i.e., they can be located in one place or distributed on multiple network units. Part or all of the modules can be selected to achieve the purpose of the embodiment according to actual needs. Those skilled in the art can understand and implement without creative labor.

[0178] From the above description of the embodiments, those skilled in the art can clearly understand that the embodiments can be realized by means of software and necessary general hardware platforms, and of course, can also be realized by hardware. Based on such understanding, the above technical solutions can be embodied in the form of a software product, which can be stored in a computer readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes a number of instructions to make a computer device (which can be a personal computer, server, or network device, etc.) execute the methods described in each embodiment or some parts of the embodiments.

[0179] Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of the present application, and not to limit them; although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that they can still modify the technical solutions recorded in the foregoing embodiments, or make equivalent replacements to some technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims

1. A document processing method, characterized in that, include: Obtain the set of documents to be processed and the set of keywords; The keywords in the keyword set are inserted into each document in the document set to be processed to obtain the test sequence; Determine the perplexity of each of the test sequences, and determine a first score result for each of the documents to be processed based on the perplexity of each of the test sequences; The set of documents to be processed is filtered based on the first score results of each document to be processed to obtain the target documents; The step of inserting keywords from the keyword set into each document in the document set to be processed to obtain the test sequence includes: Select one or more target templates from a preset template set; The keywords are inserted into the document to be processed based on the target template to obtain the test sequence; wherein, the target template is used to characterize the positional relationship between the keywords and the document to be processed. Determining the perplexity of each of the test sequences includes: The test sequence is input into a pre-trained language model to obtain the word vector matrix of the test sequence; The perplexity of the sequence to be tested is determined based on the word vector matrix; The determination of the first score result for each document to be processed based on the perplexity of each of the test sequences includes: The mean perplexity of each test sequence corresponding to the document to be processed is obtained to obtain the average perplexity. The first score result of the document to be processed is determined based on the average perplexity.

2. The document processing method according to claim 1, characterized in that, Also includes: Obtain a second rating result for the document to be processed; wherein the second rating result is obtained based on statistical information of each keyword in the keyword set in the document to be processed; The process of filtering the set of documents to be processed based on the first score results of each of the documents to be processed to obtain target documents includes: The first score result and the second score result of the document to be processed are fused together to obtain the comprehensive score result of the document to be processed. The target documents are obtained by filtering the set of documents to be processed based on the comprehensive score results of each document.

3. The document processing method according to claim 2, characterized in that, The process of fusing the first score result and the second score result of the document to be processed to obtain a comprehensive score result for the document to be processed includes: Both the first and second scoring results are normalized. The first and second normalized scores are weighted and summed based on preset weights to obtain the comprehensive score of the document to be processed.

4. A document summarization method, characterized in that, include: Target documents are extracted from the document set based on each keyword in the keyword set; wherein, the target documents are obtained by processing each document in the document set based on the document processing method according to any one of claims 1 to 3; A summary is generated based on the target document.

5. A document processing device, characterized in that, include: The data acquisition unit is used to acquire the set of documents to be processed and the set of keywords. The first processing unit is used to insert the keywords in the keyword set into each document in the document set to be processed, so as to obtain the sequence to be tested; The second processing unit is used to determine the perplexity of each of the test sequences and to determine the first score result of each of the test documents based on the perplexity of each of the test sequences. The third processing unit is used to filter the set of documents to be processed based on the first score result of each document to be processed, and obtain the target document; The step of inserting keywords from the keyword set into each document in the document set to be processed to obtain the test sequence includes: Select one or more target templates from a preset template set; The keywords are inserted into the document to be processed based on the target template to obtain the test sequence; wherein, the target template is used to characterize the positional relationship between the keywords and the document to be processed. Determining the perplexity of each of the test sequences includes: The test sequence is input into a pre-trained language model to obtain the word vector matrix of the test sequence; The perplexity of the sequence to be tested is determined based on the word vector matrix; The determination of the first score result for each document to be processed based on the perplexity of each of the test sequences includes: The mean perplexity of each test sequence corresponding to the document to be processed is obtained to obtain the average perplexity. The first score result of the document to be processed is determined based on the average perplexity.

6. A document summarization generation apparatus, characterized in that, include: The first calculation unit is used to extract target documents from the document set to be processed based on each keyword in the keyword set; wherein the target documents are obtained by processing each document to be processed in the document set to be processed based on the document processing method according to any one of claims 1 to 3; The second computing unit is used to generate a summary based on the target document.

7. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the document processing method or document summary generation method as described in any one of claims 1 to 3.

Citation Information

Patent Citations

  • Title generation method and device, electronic device and storage medium

    CN110717327A

  • Automatic composition scoring method based on confusion

    CN110826329A