A method for automating document report writing

By collecting and training similar content models of documents, extracting writing elements, and using neural networks and LSTMs for text expansion, the problems of style flexibility and adaptability in the existing technology are solved, and automated writing of documents with flexible styles and accurate content is achieved. , improves the efficiency and creativity of automated writing.

CN113688606BActive Publication Date: 2024-12-06达观数据(苏州)有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202110871820.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-07-30
Publication Date
2024-12-06
Estimated Expiration
2041-07-30

AI Technical Summary

Technical Problem

It is difficult for the existing technology to achieve flexible document automation synthesis and writing while ensuring the accuracy of critical data content, especially in scenarios with different document formats and content lengths, resulting in a lack of adaptability and creativity in the report content.

Method used

Using an automated document report writing method, collect and train similar content models of documents, extract writing elements, and use neural networks to expand context, combine long and short-term memory neural network (LSTM) for text prediction and expansion, and execute cycle until the writing is completed. , ensure the accuracy of content and the flexibility of style.

Benefits of technology

It realizes the automatic synthesis and writing of documents with different lengths and styles while ensuring the accuracy of key data content, avoids the rigid and rigid text problems caused by content that does not conform to precise expression and template fill-in-the-blanks caused by templates, and improves the The efficiency of automatic writing of routine document reports.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113688606B_ABST
    Figure CN113688606B_ABST
Patent Text Reader

Abstract

The present invention discloses a method for automatically writing a document report, the method comprising the following steps: step 1, collecting documents of the same type as the document to be written, cleaning the collected documents, and cutting sentences; step 2, training a document similar content model; step 3, extracting document writing elements; step 4, filling and / or rewriting the writing elements into predetermined sentences in the document to be written; step 5, based on the document similar content model, expanding the preceding and following related sentences of the sentence completed in step 4; step 6, using a neural network to perform context expansion on the text obtained in step 5. The present invention realizes the automatic synthesis and writing of documents of different lengths and flexible styles under the premise of ensuring the accuracy of key data content.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the field of natural language processing, and in particular relates to a method for automatically writing document reports. Background Art

[0002] In daily office work, a large number of document reports need to be written, and the format, paragraph content, and main wording of a large number of reports have corresponding rules to follow. For this type of official document writing work with relatively clear routines and standardized formats, an automated writing system can be developed to allow the computer to automatically complete the writing work after learning the writing rules of the document, greatly reducing the burden of manual writing and improving writing efficiency.

[0003] Intelligent writing uses natural language generation (NLG) technology to automatically generate target texts based on understanding the established target needs and integrating multiple models and algorithms. The main tasks of machine intelligent writing include automatic summarization, generating texts from structured data, describing pictures, writing poems, automatic couplets, etc. It is widely used in news bulletins, meeting minutes, public opinion interpretation, event analysis reports, knowledge popularization, current affairs review, event information, automatic live broadcast commentary, information summary, picture and video introduction, automatic generation of multi-source data reports, auxiliary news and literary works writing, creative marketing and many other application scenarios, freeing workers from all walks of life who deal with text from trivial matters and focusing on creative work.

[0004] Document automation writing is usually aimed at industries and enterprises with huge amounts of text content that require a large amount of manpower for text production, editing, review, and distribution, involving a variety of industries such as finance, taxation, finance, human resources, information technology, insurance, customer service, operators, and manufacturing, where automated writing can replace manual work. This type of writing is not just a pile of text content, but requires the embedding of relatively rigorous and standardized financial data, financial and financial information, and corporate operating data, etc., and requires a very precise description of these numbers.

[0005] At the same time, the document formats are different. The documents that need to be written are of different lengths and formats. Therefore, unlike the traditional simple fill-in-the-blank document writing system, it is necessary to use a certain intelligent document semantic understanding technology to avoid the reports being written being monotonous and have a certain degree of adaptability. Summary of the invention

[0006] In view of the problems existing in the prior art, the present invention provides a method for automatically writing document reports. Some embodiments of the present invention can realize the automatic synthesis and writing of documents of different lengths and flexible styles while ensuring the accuracy of key data content.

[0007] To achieve the above object, the present invention adopts the following technical solutions:

[0008] A method for automatically writing a document report, the method comprising the following steps: step 1, collecting documents of the same type as the document to be written, cleaning the collected documents, and cutting sentences; step 2, training a document similar content model; step 3, extracting document writing elements; step 4, filling in and / or rewriting the writing elements into predetermined sentences in the document to be written; step 5, based on the document similar content model, expanding the previous and next related sentences of the sentence completed in step 4; step 6, using a neural network to perform context expansion on the text obtained in step 5.

[0009] Preferably, in step 6, a long short-term memory neural network (LSTM) is used to perform context expansion on the text obtained in step 5.

[0010] Preferably, step 2 includes: using edit distance to calculate the similarity of the content-related sentences in the collected documents, clustering and dividing the sentences to form a related sentence group model, and calculating the collocation probability relationship between the previous and next sentences.

[0011] Preferably, step 5 comprises: for the sentence completed in step 4, based on the collocation probability relationship between the preceding and following sentences obtained in step 2, extracting the preceding and following sentences with the closest probability from the document similarity content model as expansion.

[0012] Preferably, the method further comprises: step 7, looping through steps 4-6 until the writing is completed.

[0013] Preferably, before executing step 4 in step 7, the writing elements in the current text are rechecked to determine whether all the writing elements are consistent: if they are consistent, the writing is completed; if not, continue to execute steps 4-6.

[0014] A computer storage medium stores a computer program, and the computer program implements the above method after being executed.

[0015] A system for automatically writing document reports, the system comprising: a collection module, the collection module collects documents of the same type as the document to be written, cleans the collected documents, and cuts sentences; a training module, the training module trains a document similar content model; an extraction module, the extraction module extracts document writing elements; a filling and rewriting module, the filling and rewriting module fills and / or rewrites the writing elements into predetermined sentences in the document to be written; a first expansion module, the first expansion module expands the previous and next related sentences of the sentence completed in the filling and rewriting module based on the document similar content model; a second expansion module, the second expansion module uses a neural network to perform context expansion on the text obtained in the first expansion module.

[0016] Compared with the prior art, the beneficial effects of the present invention are: the loop and integration of three different technologies, namely, key element filling, sentence context expansion based on probability statistics, and text expansion based on long short-term memory neural network, can avoid the problem that the text creation content does not conform to the precise expression content caused by the neural network technology alone, and also avoid the problem that the text is rigid and unchanged due to the method of simply using templates to fill in the blanks. The automated writing task of routine document reports can be well realized by loop execution. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0018] Figure 1 Flow chart of key steps of an embodiment of the present invention.

[0019] Figure 2 Schematic diagram of the method principle of long short-term memory neural network LSTM. DETAILED DESCRIPTION

[0020] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0021] In the description of the present invention, it is necessary to understand that the terms "longitudinal", "lateral", "up", "down", "front", "back", "left", "right", "vertical", "horizontal", "top", "bottom", "inside", "outside", etc., indicating the orientation or position relationship, are based on the orientation or position relationship shown in the accompanying drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as a limitation on the present invention.

[0022] A method for automating document report writing comprises the following steps:

[0023] Step 1: Collect documents of the same type, normalize the content and segment sentences

[0024] Computer-automated writing is based on a large number of documents written by humans in the past. Therefore, it is necessary to collect a large amount of past documents, clean and normalize the content, remove headers, footers, signatures and other content that are not related to writing, and divide the remaining parts into sentences according to punctuation marks such as commas and periods.

[0025] Step 2: Document similarity model training

[0026] The similarity of sentences related to the content in the document can be calculated using the edit distance, and the sentences can be clustered and divided to form a related sentence group model, and the collocation probability relationship between the previous and next sentences can be calculated. The model results established in this step will be used for subsequent expansion of the probability of the previous and next sentences.

[0027] Step 3: Document writing element extraction

[0028] A large number of official documents need to reflect the core content of the writing, usually need to fill in accurate numbers, text expressions, key conclusions and other information, which are called writing elements. The extraction of relevant writing elements needs to be completed from existing systems or documents.

[0029] Step 4: Fill in and rewrite key information

[0030] After the first three steps are completed, the system enters the most important automated writing stage, which is divided into three main steps: key information filling and rewriting - conditional probability expansion of previous and next sentences - rewriting by recurrent neural network. These three steps need to be repeated several times until the writing is completed.

[0031] Filling in key information refers to filling in the writing elements extracted in step 3 into relevant chapters and sentences in the document to be written, so as to achieve accuracy and completeness of key elements in the entire document.

[0032] Step 5: Conditional Probability Expansion of Previous and Next Sentences

[0033] According to the probability relationship between sentences generated by previous training, i.e. Markov chain, the related sentences before and after the currently filled sentence are obtained. Therefore, according to the conditional probability relationship between the previous and next sentences, the sentences with the closest probability can be extracted from the trained model and expanded. The key words and sentences in an article only account for a small part, and a large number of words are preparatory words and routine words before and after, which can be expanded through this probability expansion link.

[0034] Step 6: Use long short-term memory neural network LSTM for article synthesis

[0035] LSTM long short-term memory neural network is a method for predicting and expanding text content. The text generated based on the above two links can be used as the input of the LSTM network. Through the training of a large number of industry samples accumulated previously, a neural network is generated to predict what the subsequent text in the text to be written should be like. This achieves the purpose of using LSTM for context expansion and automatic text writing.

[0036] Step 7: Repeat steps 4-6 until writing is completed

[0037] If there are key content descriptions in the text obtained through step 6, there may be inconsistencies with the content to be expressed in the article, so step 4 should be repeated to recheck and rewrite key elements (such as numbers) to ensure the consistency of the content of the elements. Then, step 5 is performed to expand the context obtained by probability statistics based on the human language model, and then step 6 is repeated until the number of words written in the article reaches the set target requirement, and the writing is completed.

[0038] Although the above embodiments have been described in detail for the present invention, it should be understood by those skilled in the art that modifications or improvements may be made based on the contents disclosed in the present invention without departing from the spirit and scope of the present invention, and such modifications and improvements are within the spirit and scope of the present invention.

Claims

1. A method for automating document report writing, characterized in that: The method comprises the following steps: Step 1: Collect documents of the same type as the document to be written, clean the collected documents, and cut sentences; Step 2: Training document similarity content model: Use edit distance to calculate the similarity of sentences with relevant content in the collected documents, cluster and divide the sentences to form a related sentence group model, and calculate the collocation probability relationship between the previous and next sentences; Step 3: Extract document writing elements; Step 4: Fill in and / or rewrite the writing elements into the predetermined sentences in the document to be written; Step 5: Based on the document similar content model, expand the previous and next related sentences of the sentence completed in step 4: for the sentence completed in step 4, based on the collocation probability relationship between the previous and next sentences obtained in step 2, extract the previous and next sentences with the closest probability from the document similar content model as expansion; Step 6: Use a neural network to expand the context of the text obtained in step 5: Use documents of the same type as samples to train a neural network, which is used to predict subsequent text in the document to be written. Input the text obtained in step 5 into the neural network to expand the text context obtained in step 5.

2. The method for automating document report writing according to claim 1, characterized in that: In step 6, a long short-term memory neural network LSTM is used to perform context expansion on the text obtained in step 5.

3. The method for automating document report writing according to claim 1, characterized in that: The method further includes: step 7, looping through steps 4-6 until the writing is completed.

4. The method for automating document report writing according to claim 3, characterized in that: Before executing step 4 in step 7, the writing elements in the current text are rechecked to determine whether all the writing elements are consistent: if they are consistent, the writing is completed; if not, continue to execute steps 4-6.

5. A computer storage medium, characterized in that: The storage medium stores a computer program, and the computer program implements the method according to any one of claims 1 to 4 after being executed.

6. A system for automating document report writing, characterized in that: The system comprises: A collection module, wherein the collection module collects documents of the same type as the document to be written, cleans the collected documents, and cuts sentences; A training module, wherein the training module trains a document similarity content model, calculates the similarity of the content-related sentences in the collected documents using the edit distance, clusters and divides the sentences to form a related sentence group model, and calculates the collocation probability relationship between the previous and next sentences; An extraction module, wherein the extraction module extracts document writing elements; A filling and rewriting module, wherein the filling and rewriting module fills and / or rewrites the writing elements into predetermined sentences in the document to be written; A first expansion module, which expands and fills in related sentences before and after the sentence completed in the rewriting module based on the document similar content model: for the sentence completed in the rewriting module, based on the collocation probability relationship between the before and after sentences obtained in the training module, extracts the before and after sentences with the closest probability from the document similar content model as expansion; The second expansion module uses a neural network to perform context expansion on the text obtained in the first expansion module: a neural network is generated by training with documents of the same type as samples, and the neural network is used to predict subsequent text of the document to be written. The text obtained in the first expansion module is input into the neural network to expand the text context obtained in the first expansion module.