Document creation method and apparatus, terminal, and storage medium

By using word vector libraries and CNN neural network models to identify materials during the document creation process, and combining this with template libraries for formatting adjustments, the problem of low accuracy in material collection and classification is solved, thus improving the efficiency and quality of document creation.

CN115906776BActive Publication Date: 2026-06-09STATE GRID HEBEI ELECTRIC POWER COMPANY TRAINING CENT +1

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
STATE GRID HEBEI ELECTRIC POWER COMPANY TRAINING CENT
Filing Date
2022-11-16
Publication Date
2026-06-09

AI Technical Summary

Technical Problem

In existing technologies, the accuracy of material collection and classification during document creation is not high, which affects the quality of the final document.

Method used

By acquiring multiple constraints from the input information, the system matches relevant materials from the document database, uses a word vector library and a CNN neural network model to identify image content, and combines a template library for formatting adjustments to generate the target document.

Benefits of technology

It improves material matching accuracy, reduces resource consumption, and increases the operational efficiency of document creation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115906776B_ABST
    Figure CN115906776B_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of document processing, and especially relates to a document making method, device, terminal and storage medium, wherein the method comprises the following steps: firstly, obtaining input information; then, according to the multiple constraint conditions, obtaining multiple candidate materials matched with the multiple constraint conditions from a document database; then, according to the type of the document, selecting multiple target materials from the multiple candidate materials to form graphic-text materials; finally, selecting a target template from a template library, and adjusting the graphic-text materials according to the target template to obtain a target document. The method finds the most matched materials with the constraint conditions through the document database, and the matching degree is good. The target document is obtained through the template and the adjustment of the format, the operation efficiency is improved, and unnecessary resource consumption is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of document processing technology, and in particular to a document creation method, apparatus, terminal, and storage medium. Background Technology

[0002] Currently, there is no professional software on the market that can intelligently create PPT, Word, audio, and video documents. For example, the cost of creating PPTs in the power industry is very high; a high-quality PPT presentation is priced per page, often costing hundreds or even thousands of dollars. Similarly, many Word documents have a standardized format, and writing the initial draft requires significant manpower and effort. The term "documents" in this text refers broadly to various output formats such as PPT, Word, audio, and video.

[0003] Chinese Invention Patent Application No. CN202010883833.2, entitled "Document Automated Generation Method, Apparatus, Computer Storage Medium, and Electronic Device," discloses a document automated generation method, apparatus, computer storage medium, and electronic device. The method includes: acquiring data definition instructions written in a first language to specify the data source and processing method required for data processing in the document to be generated; acquiring data interpretation instructions and content generation instructions written in the first language to specify the document content and format dynamically generated from the data processing results dependent on the execution of the data definition instructions; converting the data definition instructions, data interpretation instructions, and content generation instructions into a computer-executable second language; having the computer execute the data definition instructions in the second language to obtain the data processing results, and then having the computer execute the data interpretation instructions and content generation instructions in the second language to generate the document. Using the solution in this application, the document generation method based on data, content, and format can automatically generate documents on demand or periodically, improving document production efficiency and offering high usability and flexibility.

[0004] The Chinese invention patent application number CN202111323248.8, entitled "A Method and System for Automated Document Generation," discloses a method and system for automated document generation, relating to the technical field of data processing. The method includes: obtaining a sample document template, classifying the content within the template, and adding dynamic identifier data to the classifications to obtain an adaptation file. The classification types include paragraphs, tables, and visualizations. The method further includes: extracting target files from the adaptation files, where the target files include a first target file and a second target file. The first target file is a file containing paragraphs and / or tables, and the second target file is a file containing the IDs of visualizations. The method also includes: dynamically transposing the dynamic identifier data in the target files to obtain a target adaptation file. After obtaining a user-sent requirement file, the method determines the target adaptation file corresponding to the requirement file and constructs a target document based on the target adaptation file. This invention solves the technical problem of high development costs in existing methods and systems for automated document generation.

[0005] In existing technologies, the accuracy of collecting and classifying document materials is not high, which affects the quality of the final document.

[0006] Therefore, it is necessary to develop and design a document creation method. Summary of the Invention

[0007] The present invention provides a document creation method, apparatus, terminal and storage medium to solve the problem of poor content matching in the document creation process in the prior art.

[0008] In a first aspect, embodiments of the present invention provide a document creation method, including:

[0009] Obtain input information, wherein the input information includes multiple constraints of the target document;

[0010] Based on the multiple constraints, multiple candidate materials matching the multiple constraints are obtained from the document database, wherein the document database includes multiple preset materials;

[0011] Based on the document type, select multiple target materials from the multiple candidate materials to form graphic and textual materials;

[0012] From the template library, a target template is selected, and the graphic materials are formatted and adjusted according to the target template to obtain a target document, wherein the template library includes multiple document templates.

[0013] In one possible implementation, the multiple candidate materials in the document database include multiple text material codes, and the process of obtaining the text material codes includes:

[0014] Obtain text materials;

[0015] Segment the text material to obtain multiple word groups;

[0016] Based on the multiple word groups and the word vector library, the text material encoding corresponding to the multiple word groups is obtained. The word vector library includes multiple word vectors corresponding to the word groups. Word group codes with similar semantics in the word vector library are set adjacent to each other. The text material encoding includes multiple word vectors corresponding to the multiple word groups and a text material identification code. The multiple word vectors of the text material encoding are arranged in the order of the multiple word groups.

[0017] In one possible implementation, when the plurality of constraints includes text material constraints, the step of retrieving multiple candidate materials from the document database that match the plurality of constraints includes:

[0018] The text material constraints are segmented to obtain multiple constraint phrases;

[0019] Based on the multiple constraint word groups and the word vector library, obtain multiple constraint word vectors corresponding to the multiple constraint word groups;

[0020] Based on the multiple constraint word vectors and the multiple text material codes in the document database, multiple candidate text materials are determined.

[0021] In one possible implementation, determining multiple candidate text materials based on the multiple constraint word vectors and multiple text material codes in the document database includes:

[0022] Based on the multiple constraint word vectors, the multiple text material codes in the document database, and the first formula, multiple matching coefficients are obtained, wherein the first formula is:

[0023]

[0024] In the formula, S i a is the matching coefficient corresponding to the encoding of the i-th text element. n For the nth constrained word vector, b in This is the word vector encoded for the i-th text element;

[0025] Based on the multiple matching coefficient values, a preset number of text materials are obtained from the document database as multiple candidate text materials, wherein the multiple candidate text materials have the largest matching coefficient value.

[0026] In one possible implementation, the multiple candidate materials in the document database include multiple image material codes, and the process of obtaining the image material codes includes:

[0027] Obtain image materials;

[0028] The image material is fed into the recognition model to obtain multiple target names contained in the image material;

[0029] Based on the multiple target names and the word vector library, the image material code corresponding to the image material is obtained. The word vector library includes multiple word vectors corresponding to phrases. The word vector library sets the semantically similar phrase codes adjacently. The image material code includes multiple word vectors corresponding to the multiple target name phrases and an image material identification code.

[0030] In one possible implementation, the recognition model is built based on a CNN neural network model and obtained after training. The recognition model includes: an input layer, a convolutional layer, a pooling layer, a fully connected layer, and an output layer. The convolutional layer receives the input of the input layer, the pooling layer receives the input of the convolutional layer, the input of the fully connected layer is connected to the output of the pooling layer, and the input of the output layer is connected to the output of the fully connected layer. The training step includes:

[0031] Obtain multiple sample images and multiple labels, wherein the multiple labels correspond to the multiple images and represent the target names contained in the multiple sample images;

[0032] The multiple sample images are input into the recognition model to obtain multiple recognition outputs from the recognition model;

[0033] Based on the deviations between the multiple recognition outputs and the multiple labels, the parameters of the recognition model are adjusted using a backpropagation algorithm until the deviations between the multiple recognition outputs and the multiple labels are less than a threshold.

[0034] In one possible implementation, the step of formatting and adjusting the textual and graphic materials according to the target template to obtain the target document includes:

[0035] The target template specifies image locations and text formatting.

[0036] The images in the graphic materials are rotated, stretched, and scaled according to the size of the image position in the target template.

[0037] Place the image at the specified image location;

[0038] According to the text format, the text in the graphic material is formatted and then placed in the text position of the target template.

[0039] A document creation apparatus for implementing the document creation method, the document creation apparatus comprising:

[0040] An input information module is used to acquire input information, wherein the input information includes multiple constraints of the target document;

[0041] The material matching module is used to retrieve multiple candidate materials that match the multiple constraints from the document database, wherein the document database includes multiple preset materials;

[0042] The image and text selection module is used to select multiple target materials from the multiple candidate materials according to the type of the document, so as to form image and text materials;

[0043] as well as,

[0044] The document generation module is used to select a target template from the template library and to format and adjust the graphic materials according to the target template to obtain a target document, wherein the template library includes multiple document templates.

[0045] Secondly, embodiments of the present invention provide a document creation apparatus for implementing the document creation method as described in the first aspect or any possible implementation thereof, the document creation apparatus comprising:

[0046] An input information module is used to acquire input information, wherein the input information includes multiple constraints of the target document;

[0047] The material matching module is used to retrieve multiple candidate materials that match the multiple constraints from the document database, wherein the document database includes multiple preset materials;

[0048] The image and text selection module is used to select multiple target materials from the multiple candidate materials according to the type of the document, so as to form image and text materials;

[0049] as well as,

[0050] The document generation module is used to select a target template from the template library and to format and adjust the graphic materials according to the target template to obtain a target document, wherein the template library includes multiple document templates.

[0051] Thirdly, embodiments of the present invention provide a terminal, including a memory and a processor, wherein the memory stores a computer program that can run on the processor, and the processor executes the computer program to implement the steps of the method as described in the first aspect or any possible implementation of the first aspect.

[0052] Fourthly, embodiments of the present invention provide a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the method as described in the first aspect or any possible implementation thereof.

[0053] The beneficial effects of the embodiments of the present invention compared with the prior art are as follows:

[0054] This invention discloses a document creation method. First, it acquires input information, including multiple constraints on a target document. Then, based on these constraints, it retrieves multiple candidate materials matching the constraints from a document database, where the document database includes multiple preset materials. Next, based on the document type, it selects multiple target materials from the candidate materials to form graphic materials. Finally, it selects a target template from a template library and formats and adjusts the graphic materials according to the target template to obtain the target document. The template library includes multiple document templates. This method finds the most matching materials based on the constraints using a document database, achieving excellent matching. By using templates and adjusting the format, it obtains the target document, improving operational efficiency and reducing unnecessary resource consumption. Attached Figure Description

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

[0056] Figure 1 This is a flowchart of the document creation method provided by an embodiment of the present invention;

[0057] Figure 2 This is a basic structural diagram of the CNN neural network model provided in the embodiments of the present invention;

[0058] Figure 3 This is a functional block diagram of the document creation device provided in the embodiments of the present invention;

[0059] Figure 4This is a terminal function block diagram provided by an embodiment of the present invention. Detailed Implementation

[0060] In the following description, specific details such as particular system structures and techniques are set forth for illustrative purposes and not for limitation, so as to provide a thorough understanding of embodiments of the invention. However, those skilled in the art will understand that the invention can be implemented in other embodiments without these specific details. In other instances, detailed descriptions of well-known systems, apparatuses, and methods are omitted so as not to obscure the description of the invention with unnecessary detail.

[0061] To make the objectives, technical solutions, and advantages of the present invention clearer, specific embodiments will be described below in conjunction with the accompanying drawings.

[0062] The embodiments of the present invention will be described in detail below. This example is implemented based on the technical solution of the present invention, and provides detailed implementation methods and specific operation processes. However, the protection scope of the present invention is not limited to the following embodiments.

[0063] Figure 1 A flowchart illustrating a document creation method provided for an embodiment of the present invention.

[0064] like Figure 1 As shown, a flowchart illustrating the document creation method provided by an embodiment of the present invention is presented, and is described in detail below:

[0065] In step 101, input information is obtained, wherein the input information includes multiple constraints of the target document.

[0066] In step 102, based on the multiple constraints, multiple candidate materials matching the multiple constraints are obtained from the document database, wherein the document database includes multiple preset materials.

[0067] In some implementations, the multiple candidate materials in the document database include multiple text material codes, and the process of obtaining the text material codes includes:

[0068] Obtain text materials;

[0069] Segment the text material to obtain multiple word groups;

[0070] Based on the multiple word groups and the word vector library, the text material encoding corresponding to the multiple word groups is obtained. The word vector library includes multiple word vectors corresponding to the word groups. Word group codes with similar semantics in the word vector library are set adjacent to each other. The text material encoding includes multiple word vectors corresponding to the multiple word groups and a text material identification code. The multiple word vectors of the text material encoding are arranged in the order of the multiple word groups.

[0071] In some implementations, when the plurality of constraints includes text material constraints, the step of retrieving multiple candidate materials from the document database that match the plurality of constraints includes:

[0072] The text material constraints are segmented to obtain multiple constraint phrases;

[0073] Based on the multiple constraint word groups and the word vector library, obtain multiple constraint word vectors corresponding to the multiple constraint word groups;

[0074] Based on the multiple constraint word vectors and the multiple text material codes in the document database, multiple candidate text materials are determined.

[0075] In some implementations, determining multiple candidate text materials based on the multiple constraint word vectors and multiple text material codes in the document database includes:

[0076] Based on the multiple constraint word vectors, the multiple text material codes in the document database, and the first formula, multiple matching coefficients are obtained, wherein the first formula is:

[0077]

[0078] In the formula, S i a is the matching coefficient corresponding to the encoding of the i-th text element. n For the nth constrained word vector, b in This is the word vector encoded for the i-th text element;

[0079] Based on the multiple matching coefficient values, a preset number of text materials are obtained from the document database as multiple candidate text materials, wherein the multiple candidate text materials have the largest matching coefficient value.

[0080] For example, a document typically includes two parts: text and images; that is, it is mostly a text and image document. Of course, some may also include audio. For document creation, acquiring text and image materials is a crucial step in the process.

[0081] Regarding text materials, this invention provides a document database containing multiple text materials and multiple image materials. The text materials are identified through encoding.

[0082] To facilitate searching based on input constraints, the text material is encoded to represent its semantics. Specifically, this involves encoding the text material semantically. First, the text material is segmented into words. The resulting word groups are then looked up in a word vector library to obtain their vectors. For semantically similar word groups, the codes are similar, while for semantically opposite words, the codes are opposite. For example, the vectors for "beautiful" and "pretty" are very close, while the vectors for "ugly" and "beautiful" are opposite. After vectorizing multiple word groups, the encoding of the text material is determined based on the position of the word groups within the text material.

[0083] For finding source material through constraints, the constraints are also segmented into constraint phrases, which are then processed through a word vector library to obtain corresponding constraint word vectors. These constraint word vectors are then matched with the encodings in the document database to obtain a matching coefficient. The larger the coefficient value, the closer the constraint is to the text source material, indicating that a corresponding source material has been found.

[0084] Specifically, the matching coefficient is obtained using the following formula:

[0085]

[0086] In the formula, S i a is the matching coefficient corresponding to the encoding of the i-th text element. n For the nth constrained word vector, b in This is the word vector encoded for the i-th text element;

[0087] Sort multiple matching coefficients and select the text material corresponding to the largest matching coefficient from the preset number of text materials as candidate text materials.

[0088] In some implementations, the multiple candidate materials in the document database include multiple image material codes, and the process of obtaining the image material codes includes:

[0089] Obtain image materials;

[0090] The image material is fed into the recognition model to obtain multiple target names contained in the image material;

[0091] Based on the multiple target names and the word vector library, the image material code corresponding to the image material is obtained. The word vector library includes multiple word vectors corresponding to phrases. The word vector library sets the semantically similar phrase codes adjacently. The image material code includes multiple word vectors corresponding to the multiple target name phrases and an image material identification code.

[0092] In some implementations, the recognition model is built based on a CNN neural network model and obtained after training. The recognition model includes: an input layer, a convolutional layer, a pooling layer, a fully connected layer, and an output layer. The convolutional layer receives the input of the input layer, the pooling layer receives the input of the convolutional layer, the input of the fully connected layer is connected to the output of the pooling layer, and the input of the output layer is connected to the output of the fully connected layer. The training step includes:

[0093] Obtain multiple sample images and multiple labels, wherein the multiple labels correspond to the multiple images and represent the target names contained in the multiple sample images;

[0094] The multiple sample images are input into the recognition model to obtain multiple recognition outputs from the recognition model;

[0095] Based on the deviations between the multiple recognition outputs and the multiple labels, the parameters of the recognition model are adjusted using a backpropagation algorithm until the deviations between the multiple recognition outputs and the multiple labels are less than a threshold.

[0096] For example, for image materials, this is achieved by identifying the content contained within the image and assigning it material encoding.

[0097] After recognizing the content of an image, the names of the content in the image are obtained. These names are then used to obtain vectors from a word vector library. The combination of vectors from multiple names can serve as the main part of the encoding of the image material.

[0098] For recognition models, one application uses a CNN neural network model, such as... Figure 2 As shown, the model includes an input layer, convolutional layers, pooling layers, fully connected layers, and an output layer. Image data is digitized and fed into the model to recognize its content. This model requires training to complete its final construction. Specifically, multiple samples are obtained, fed into the model to obtain recognition results, and if the recognition result deviation exceeds a set value, the parameters of each layer of the model are adjusted. Generally, backpropagation algorithms and genetic algorithms can be used to correct the parameters. When the recognition error is less than the threshold, the training is considered successful.

[0099] In step 103, multiple target materials are selected from the multiple candidate materials according to the type of the document to form graphic materials.

[0100] In step 104, a target template is selected from the template library, and the graphic materials are formatted and adjusted according to the target template to obtain a target document, wherein the template library includes multiple document templates.

[0101] In some implementations, step 104 includes:

[0102] The target template specifies image locations and text formatting.

[0103] The images in the graphic materials are rotated, stretched, and scaled according to the size of the image position in the target template.

[0104] Place the image at the specified image location;

[0105] According to the text format, the text in the graphic material is formatted and then placed in the text position of the target template.

[0106] After selecting document materials, you can obtain a first draft. After formatting the images and text in the first draft, you can obtain the final document.

[0107] The document creation method of this invention first acquires input information, including multiple constraints on the target document. Then, based on the multiple constraints, it retrieves multiple candidate materials matching the constraints from a document database, where the document database includes multiple preset materials. Next, based on the document type, it selects multiple target materials from the candidate materials to form graphic materials. Finally, it selects a target template from a template library and formats and adjusts the graphic materials according to the target template to obtain the target document. The template library includes multiple document templates. This method finds the most matching materials based on the constraints using a document database, achieving excellent matching. By using templates and adjusting the format, it obtains the target document, improving operational efficiency and reducing unnecessary resource consumption.

[0108] It should be understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.

[0109] The following are embodiments of the apparatus of the present invention. For details not described in detail, please refer to the corresponding method embodiments described above.

[0110] Figure 3 This is a functional block diagram of the document creation device provided in the embodiments of the present invention, with reference to... Figure 3 The document creation device 3 includes: an input information module 301, a material matching module 302, an image and text selection module 303, and a document generation module 304.

[0111] The input information module 301 is used to acquire input information, wherein the input information includes multiple constraints of the target document;

[0112] The material matching module 302 is used to obtain multiple candidate materials that match the multiple constraints from the document database, wherein the document database includes multiple preset materials;

[0113] The image and text selection module 303 is used to select multiple target materials from the multiple candidate materials according to the type of the document, so as to form image and text materials;

[0114] as well as,

[0115] The document generation module 304 is used to select a target template from the template library and to format and adjust the graphic materials according to the target template to obtain a target document, wherein the template library includes multiple document templates.

[0116] Figure 4 This is a functional block diagram of the terminal provided in an embodiment of the present invention. For example... Figure 4 As shown, the terminal 4 in this embodiment includes a processor 400 and a memory 401, wherein the memory 401 stores a computer program 402 that can run on the processor 400. When the processor 400 executes the computer program 402, it implements the steps of the various document creation methods and embodiments described above, for example... Figure 1 Steps 101 to 104 are shown.

[0117] For example, the computer program 402 may be divided into one or more modules / units, which are stored in the memory 401 and executed by the processor 400 to complete the present invention.

[0118] The terminal 4 can be a computing device such as a desktop computer, laptop, handheld computer, or cloud server. The terminal 4 may include, but is not limited to, a processor 400 and a memory 401. Those skilled in the art will understand that... Figure 4 This is merely an example of terminal 4 and does not constitute a limitation on terminal 4. It may include more or fewer components than shown, or combine certain components, or different components. For example, terminal 4 may also include input / output devices, network access devices, buses, etc.

[0119] The processor 400 may be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor.

[0120] The memory 401 can be an internal storage unit of the terminal 4, such as a hard disk or memory of the terminal 4. The memory 401 can also be an external storage device of the terminal 4, such as a plug-in hard disk, Smart Media Card (SMC), Secure Digital (SD) card, or Flash Card equipped on the terminal 4. Furthermore, the memory 401 can include both internal storage units and external storage devices of the terminal 4. The memory 401 is used to store the computer program 402 and other programs and data required by the terminal 4. The memory 401 can also be used to temporarily store data that has been output or will be output.

[0121] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is merely an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit. Furthermore, the specific names of the functional units and modules are only for easy differentiation and are not intended to limit the scope of protection of this application. The specific working process of the units and modules in the above system can be referred to the corresponding process in the aforementioned method embodiments, and will not be repeated here.

[0122] In the above embodiments, the descriptions of each embodiment have their own emphasis. For parts that are not described in detail or recorded in a certain embodiment, please refer to the relevant descriptions of other embodiments.

[0123] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.

[0124] In the embodiments provided by this invention, it should be understood that the disclosed devices / terminals and methods can be implemented in other ways. For example, the device / terminal embodiments described above are merely illustrative. For instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.

[0125] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment, depending on actual needs.

[0126] Furthermore, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0127] If the integrated module / unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the above-described embodiments can also be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various methods and apparatus embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable medium can include: any entity or device capable of carrying the computer program code, a recording medium, a USB flash drive, a portable hard drive, a magnetic disk, an optical disk, a computer memory, a read-only memory (ROM), a random access memory (RAM), an electrical carrier signal, a telecommunication signal, and a software distribution medium, etc.

[0128] The above-described embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit them. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be included within the protection scope of the present invention.

Claims

1. A document creation method, characterized in that, include: Obtain input information, wherein the input information includes multiple constraints of the target document; Based on the multiple constraints, multiple candidate materials matching the multiple constraints are obtained from the document database, wherein the document database includes multiple preset materials; the multiple candidate materials in the document database include multiple text material codes, and the process of obtaining the text material codes includes: Obtain text materials; Segment the text material to obtain multiple word groups; Based on the multiple word groups and the word vector library, the text material encoding corresponding to the multiple word groups is obtained. The word vector library includes multiple word vectors corresponding to the word groups. Word group codes with similar semantics in the word vector library are set adjacent to each other. The text material encoding includes multiple word vectors corresponding to the multiple word groups and a text material identification code. The multiple word vectors of the text material encoding are arranged in the order of the multiple word groups. When the multiple constraints include text material constraints, the step of retrieving multiple candidate materials from the document database that match the multiple constraints includes: The text material constraints are segmented to obtain multiple constraint phrases; Based on the multiple constraint word groups and the word vector library, obtain multiple constraint word vectors corresponding to the multiple constraint word groups; Based on the multiple constraint word vectors and the multiple text material codes in the document database, multiple candidate text materials are determined, including: Based on the multiple constraint word vectors, the multiple text material codes in the document database, and the first formula, multiple matching coefficients are obtained, wherein the first formula is: In the formula, S i a is the matching coefficient corresponding to the encoding of the i-th text element. n For the nth constrained word vector, b in This is the word vector encoded for the i-th text element; Based on multiple matching coefficient values, a preset number of text materials are obtained from the document database as multiple candidate text materials, wherein the matching coefficient value corresponding to the multiple candidate text materials is the largest; Based on the document type, select multiple target materials from the multiple candidate materials to form graphic and textual materials; From the template library, a target template is selected, and the graphic materials are formatted and adjusted according to the target template to obtain a target document, wherein the template library includes multiple document templates.

2. The document creation method according to claim 1, characterized in that, The document database contains multiple candidate materials, including multiple image material codes. The process of obtaining the image material codes includes: Obtain image materials; The image material is fed into the recognition model to obtain multiple target names contained in the image material; Based on multiple target names and a word vector library, the image material code corresponding to the image material is obtained. The word vector library includes multiple word vectors corresponding to phrases. Word vector codes with similar semantics are set adjacently in the word vector library. The image material code includes multiple word vectors corresponding to multiple target name phrases and an image material identification code.

3. The document creation method according to claim 2, characterized in that, The recognition model is built based on a CNN neural network model and obtained after training. The recognition model includes an input layer, a convolutional layer, a pooling layer, a fully connected layer, and an output layer. The convolutional layer receives the input from the input layer, the pooling layer receives the input from the convolutional layer, the input of the fully connected layer is connected to the output of the pooling layer, and the input of the output layer is connected to the output of the fully connected layer. The training steps include: Obtain multiple sample images and multiple labels, wherein the multiple labels correspond to the multiple images and represent the target names contained in the multiple sample images; The multiple sample images are input into the recognition model to obtain multiple recognition outputs from the recognition model; Based on the deviations between the multiple recognition outputs and the multiple labels, the parameters of the recognition model are adjusted using a backpropagation algorithm until the deviations between the multiple recognition outputs and the multiple labels are less than a threshold.

4. The document creation method according to any one of claims 1-3, characterized in that, The step of formatting and adjusting the text and image materials according to the target template to obtain the target document includes: The target template specifies image locations and text formatting. The images in the graphic materials are rotated, stretched, and scaled according to the size of the image position in the target template. Place the image at the specified image location; According to the text format, the text in the graphic material is formatted and then placed in the text position of the target template.

5. A document creation device, characterized in that, For implementing the document creation method as described in any one of claims 1-4, the document creation apparatus includes: An input information module is used to acquire input information, wherein the input information includes multiple constraints of the target document; The material matching module is used to retrieve multiple candidate materials that match the multiple constraints from the document database, wherein the document database includes multiple preset materials; The image and text selection module is used to select multiple target materials from the multiple candidate materials according to the type of the document, so as to form image and text materials; as well as, The document generation module is used to select a target template from the template library and to format and adjust the graphic materials according to the target template to obtain a target document, wherein the template library includes multiple document templates.

6. A terminal, comprising a memory and a processor, wherein the memory stores a computer program executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the method as described in any one of claims 1 to 4 above.

7. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method as described in any one of claims 1 to 4 above.