Text generation method and device, equipment and storage medium

通过文本分析和筛选技术,自动化生成满足数据分析需求的文本,解决了现有技术中效率低和准确性差的问题,实现了高效、准确的文本生成。

CN118917320APending Publication Date: 2024-11-08SHENZHEN YISHIHUOLALA TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410970513.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-18
Publication Date
2024-11-08

AI Technical Summary

Technical Problem

The existing text generation methods rely too much on manual labor, reduce efficiency and cannot guarantee the accuracy of text content.

Method used

By obtaining pending text, performing text analysis to obtain fields, filtering these fields based on preset data analysis requirements and embeding them into letter templates to generate target text, and using text analysis techniques such as keyword extraction and semantic analysis, automated filtering and generation process.

Benefits of technology

It improves the efficiency of text generation, ensures the accuracy of text content, and reduces manual intervention.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118917320A_ABST
    Figure CN118917320A_ABST
Patent Text Reader

Abstract

Embodiments of the invention provide a text generation method and apparatus, a device and a storage medium. The method comprises the steps of obtaining a to-be-processed text; performing text analysis on the to-be-processed text to obtain N fields in the to-be-processed text, N being a positive integer greater than 1; based on a preset data analysis requirement, the N fields are screened, M target fields are obtained, and M is a positive integer smaller than N; and based on a data analysis demand, embedding the M target fields into the corresponding letter templates to generate a target text. In the embodiment of the invention, text analysis is performed on a to-be-processed text to obtain N fields; and based on a preset data analysis demand and the field, generating a target text meeting the data analysis demand. In the process, various information does not need to be screened manually, so that the text generation efficiency is improved; and the target text is generated based on the preset data analysis requirement, so that the accuracy of the text content is further ensured.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of communication technology, and in particular to a text generation method, device, equipment and storage medium. Background Art

[0002] In data analysis work, data analysts need to collect texts that record various information, extract valid data from the text that meets the analysis needs, embed the above valid data into preset templates, generate letters, and then send the letters to the demand side.

[0003] That is to say, in the data analysis work, it is necessary to manually screen various information to obtain valid data that meets the analysis needs, and manually fill the above valid data into the preset template to generate a letter. The above method relies too much on manual labor, reduces the efficiency of letter generation, and cannot guarantee the accuracy of the letter content. Summary of the invention

[0004] The main purpose of the present invention is to provide a text generation method, device, computer equipment and storage medium, aiming to solve the technical problems that the existing text generation method is too dependent on manual work, reduces the efficiency of text generation, and cannot guarantee the accuracy of text content.

[0005] To achieve the above object, the present invention provides a text generation method, which comprises:

[0006] Get the text to be processed;

[0007] Performing text analysis on the text to be processed to obtain N fields in the text to be processed, where N is a positive integer greater than 1;

[0008] Based on the preset data analysis requirements, the N fields are screened to obtain M target fields, where M is a positive integer less than N;

[0009] Based on the data analysis requirements, the M target fields are embedded into the corresponding letter template to generate the target text.

[0010] Optionally, performing text analysis on the text to be processed to obtain N fields in the text to be processed includes:

[0011] In the case where the text to be processed is a structured text, performing keyword extraction on the text to be processed;

[0012] The extracted N keywords are determined as N fields in the text to be processed.

[0013] Optionally, performing text analysis on the text to be processed to obtain N fields in the text to be processed includes:

[0014] In the case where the text to be processed is an unstructured text, performing semantic analysis on the text to be processed;

[0015] Extract keywords from the text to be processed after semantic analysis;

[0016] The extracted N keywords are determined as N fields in the text to be processed.

[0017] Optionally, based on the preset data analysis requirements, the N fields are screened to obtain M target fields, including:

[0018] Performing semantic analysis on each of the N fields to obtain semantics corresponding to each field;

[0019] Analyze the data analysis requirements to obtain target semantics;

[0020] Among the N fields, the fields whose corresponding semantics are the same as the target semantics are determined as target fields to obtain the M target fields.

[0021] Optionally, based on the data analysis requirement, embedding the M target fields into a corresponding letter template to generate a target text includes:

[0022] When M is equal to 0, the preset letter template is determined as the target text.

[0023] Optionally, based on the data analysis requirement, embedding the M target fields into a corresponding letter template to generate a target text includes:

[0024] When M is not equal to 0, the data analysis requirement is parsed to obtain a letter template;

[0025] The M target fields are embedded into the above-mentioned letter template to generate the target text.

[0026] Optionally, the method further comprises:

[0027] Receive demand instructions;

[0028] The demand instruction is parsed to obtain the data analysis demand.

[0029] In addition, to achieve the above-mentioned purpose, the present invention also provides a text generation device, the text generation device comprising:

[0030] An acquisition module is used to obtain the text to be processed;

[0031] An analysis module, used for performing text analysis on the text to be processed to obtain N fields in the text to be processed, where N is a positive integer greater than 1;

[0032] A screening module, used to screen the N fields based on preset data analysis requirements to obtain M target fields, where M is a positive integer less than N;

[0033] A generation module is used to embed the M target fields into a corresponding letter template based on the data analysis requirements to generate a target text.

[0034] In order to solve the above technical problems, the embodiment of the present application further provides a computer device, which adopts the following technical solution:

[0035] The computer device includes a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the steps of any one of the text generation methods proposed in the embodiments of the present application are implemented.

[0036] In order to solve the above technical problems, the embodiment of the present application further provides a computer-readable storage medium, which adopts the following technical solution:

[0037] The computer-readable storage medium stores a computer program, and when the computer program is executed by the processor, the steps of any one of the text generation methods proposed in the embodiments of the present application are implemented.

[0038] Compared with the prior art, the embodiments of the present application have the following beneficial effects:

[0039] The embodiment of the present application provides a text generation method, device, equipment and storage medium, the method comprising: obtaining a text to be processed; performing text analysis on the text to be processed to obtain N fields in the text to be processed, N being a positive integer greater than 1; based on preset data analysis requirements, screening the N fields to obtain M target fields, M being a positive integer less than N; based on data analysis requirements, embedding the M target fields into a corresponding letter template to generate a target text. In the embodiment of the present application, text analysis is performed on the text to be processed to obtain N fields; and based on the preset data analysis requirements and the above fields, a target text that meets the data analysis requirements is generated. In the above process, there is no need to manually screen various information, which improves the efficiency of text generation; and the target text is generated based on the preset data analysis requirements, which further ensures the accuracy of the text content. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] In order to more clearly illustrate the scheme in the present application, a brief introduction is given below to the drawings required for use in the description of the embodiments of the present application. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0041] Figure 1 is an exemplary system architecture diagram to which the present application may be applied;

[0042] Figure 2 is a flow chart of a text generation method provided by an embodiment of the present invention;

[0043] Figure 3 is an application scenario diagram of the text generation method provided by an embodiment of the present invention;

[0044] Figure 4 is a schematic diagram of a search module provided by an embodiment of the present invention;

[0045] Figure 5 is a schematic diagram of a letter generation module provided by an embodiment of the present invention;

[0046] Figure 6 is a structural schematic diagram of an embodiment of a text generation device provided by an embodiment of the present invention;

[0047] Figure 7 This is a basic structural block diagram of the computer device in this embodiment. DETAILED DESCRIPTION

[0048] The text generation method provided by the embodiment of the present invention is applied to a text generation device. Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those generally understood by technicians in the technical field of the present application; the terms used in the specification of the application herein are only for the purpose of describing specific embodiments and are not intended to limit the present application; the terms "including" and "having" in the specification and claims of the present application and the above-mentioned figure descriptions and any variations thereof are intended to cover non-exclusive inclusions. The terms "first", "second", etc. in the specification and claims of the present application or the above-mentioned figures are used to distinguish different objects, not to describe a specific order.

[0049] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.

[0050] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the accompanying drawings.

[0051] like Figure 1As shown, the system architecture 100 may include terminal devices 101, 102, 103, a network 104 and a server 105. The network 104 is used to provide a medium for communication links between the terminal devices 101, 102, 103 and the server 105. The network 104 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.

[0052] Users can use terminal devices 101, 102, 103 to interact with server 105 through network 104 to receive or send messages, etc. Various communication client applications can be installed on terminal devices 101, 102, 103, such as web browser applications, shopping applications, search applications, instant messaging tools, email clients, social online platform software, etc.

[0053] Terminal devices 101, 102, 103 can be various electronic devices with display screens and supporting web browsing, including but not limited to smart phones, tablet computers, e-book readers, MP3 players (Moving Picture Experts Group Audio Layer III), MP4 (Moving Picture Experts Group Audio Layer IV) players, laptop computers, desktop computers, etc.

[0054] The server 105 may be a server that provides various services, such as a background server that provides support for web pages displayed on the terminal devices 101 , 102 , and 103 .

[0055] It should be noted that the text generation method provided in the embodiment of the present application is generally executed by a server / terminal device, and accordingly, the text generation device is generally arranged in the server / terminal device.

[0056] It should be understood that Figure 1 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.

[0057] Please refer to Figure 2 , shows a flow chart of an embodiment of the text generation method proposed in the present application. The embodiment of the present application can acquire and process relevant data based on artificial intelligence technology.

[0058] The text generation method provided by the embodiment of the present invention comprises the following steps:

[0059] S210, obtaining the text to be processed.

[0060] An optional implementation manner is that the above-mentioned text to be processed is various texts obtained by a web crawler, and the text generation device obtains the text to be processed by means of a web crawler.

[0061] Another optional implementation is that a device that is communicatively connected to the text generating device sends text to the text generating device, that is, the above-mentioned text to be processed is various texts received by the text generating device.

[0062] No specific restrictions are imposed on the source of the text to be processed.

[0063] S220, performing text analysis on the text to be processed to obtain N fields in the text to be processed.

[0064] In this step, after obtaining the text to be processed, text analysis is performed on the text to be processed to obtain N fields in the text to be processed, where N is a positive integer greater than 1.

[0065] The above-mentioned text analysis method includes but is not limited to semantic analysis of the text to be processed and keyword extraction of the text to be processed. For specific implementation methods, please refer to the subsequent embodiments.

[0066] S230, based on preset data analysis requirements, the N fields are screened to obtain M target fields.

[0067] In this step, an optional implementation method is that the above-mentioned data analysis requirements are preset, that is, the data analysis requirements are set in advance, and after performing text analysis on the text to be processed to obtain N fields, the N fields are screened based on the data analysis requirements to obtain M target fields.

[0068] Another optional implementation is that the text generation device receives a demand instruction, parses the demand instruction to obtain a data analysis requirement, and after performing text analysis on the text to be processed to obtain N fields, screens the N fields based on the data analysis requirement to obtain M target fields.

[0069] Wherein, M is a positive integer less than N.

[0070] S240, based on the data analysis requirements, embed the M target fields into the corresponding letter template to generate a target text.

[0071] In this step, after obtaining M target fields, the M target fields are embedded into the corresponding letter template to generate the target text.

[0072] Among them, the above letter template is obtained based on data analysis needs.

[0073] For the specific implementation of this step, please refer to the subsequent embodiments.

[0074] To understand the overall technical solution, please refer to Figure 3 ,exist Figure 3 In the application scenario shown, the text generation device includes a retrieval module and a letter generation module. Figure 3 The external data in can be understood as the text to be processed obtained by the text generation device.

[0075] exist Figure 3 In the application scenario shown, the retrieval module performs text analysis on external data. If the target field is obtained (that is, the retrieval result is not empty), the letter generation requirements are determined according to the preset data analysis requirements, and the target text is generated based on the letter generation module. The target text is converted into an email and sent to the demand side.

[0076] If the target field corresponding to the external data is not obtained (that is, the search result is empty), the target text is directly generated based on the letter generation module, the target text is converted into an email, and sent to the demand side.

[0077] The embodiment of the present application provides a text generation method, device, equipment and storage medium, the method comprising: obtaining a text to be processed; performing text analysis on the text to be processed to obtain N fields in the text to be processed, N being a positive integer greater than 1; based on preset data analysis requirements, screening the N fields to obtain M target fields, M being a positive integer less than N; based on data analysis requirements, embedding the M target fields into a corresponding letter template to generate a target text. In the embodiment of the present application, text analysis is performed on the text to be processed to obtain N fields; and based on the preset data analysis requirements and the above fields, a target text that meets the data analysis requirements is generated. In the above process, there is no need to manually screen various information, which improves the efficiency of text generation; and the target text is generated based on the preset data analysis requirements, which further ensures the accuracy of the text content.

[0078] Optionally, performing text analysis on the text to be processed to obtain N fields in the text to be processed includes:

[0079] In the case where the text to be processed is a structured text, performing keyword extraction on the text to be processed;

[0080] The extracted N keywords are determined as N fields in the text to be processed.

[0081] It should be understood that the above structured text is organized in a specific format, consists of clearly defined information, and is stored and managed in a highly organized table or database, and is a form of data that has been extracted or processed. For example, the structured text is "Cargo volume: 3 cubic meters, cargo weight: 20 kilograms, cargo quantity: 20 pieces".

[0082] In this embodiment, the text type of the text to be processed can be obtained. When the text type represents structured text, it is determined that the text to be processed is structured text, and keyword extraction is performed on the text to be processed, and then the extracted N keywords are determined as N fields in the text to be processed.

[0083] Among them, the above keyword extraction methods include but are not limited to TF-IDF algorithm, TextRank algorithm, etc.

[0084] Optionally, performing text analysis on the text to be processed to obtain N fields in the text to be processed includes:

[0085] In the case where the text to be processed is an unstructured text, performing semantic analysis on the text to be processed;

[0086] Extract keywords from the text to be processed after semantic analysis;

[0087] The extracted N keywords are determined as N fields in the text to be processed.

[0088] It should be understood that the above unstructured text has no specific format or structure, and is usually manually generated, and the data content needs to be extracted. For example, the unstructured text is "I have 20 kilograms of goods here, and I need your help to move them. There are 20 pieces in total, and the total size is about 3 cubic meters."

[0089] In this embodiment, the text type of the text to be processed can be obtained. When the text type represents unstructured text, it is determined that the text to be processed is unstructured text, and semantic analysis is performed on the text to be processed to obtain the text to be processed after the semantic analysis, and then keyword extraction is performed on the text to be processed after the semantic analysis to obtain N fields.

[0090] The keyword extraction method includes but is not limited to TF-IDF algorithm, TextRank algorithm, etc. The semantic analysis method includes but is not limited to NLP text semantic analysis, application of natural language analysis, and other methods.

[0091] To understand the technical solution provided by this embodiment, please refer to Figure 4 , Figure 4 The data in the search module is the text to be processed, and the search result is the field. The search module includes data extraction requirements and a large model. The data extraction requirements can be understood as different field extraction methods for structured text and unstructured text. The large model includes a semantic analysis model and a keyword extraction model.

[0092] Specifically, Figure 4In the process shown, the text to be processed is input into the retrieval module of the text generation device, and the fields of the text to be processed are extracted using the data extraction requirements and the large model, thereby obtaining the retrieval results.

[0093] In this embodiment, according to the text type of the text to be processed, that is, when the text to be processed is a structured text and when the text to be processed is an unstructured text, in these two different cases, the fields in the text are extracted using a method suitable for its text type, thereby ensuring that accurate fields are extracted.

[0094] Optionally, based on the preset data analysis requirements, the N fields are screened to obtain M target fields, including:

[0095] Performing semantic analysis on each of the N fields to obtain semantics corresponding to each field;

[0096] Analyze the data analysis requirements to obtain target semantics;

[0097] Among the N fields, the fields whose corresponding semantics are the same as the target semantics are determined as target fields to obtain the M target fields.

[0098] As described above, data analysis requirements are preset. In this embodiment, the preset data analysis requirements are parsed to obtain target semantics, and semantic analysis is performed on each field to obtain the semantics corresponding to each field.

[0099] Among them, semantic analysis methods include but are not limited to NLP text semantic analysis, applied natural language analysis and other methods.

[0100] Furthermore, among the N fields, the fields whose corresponding semantics are the same as the target semantics are determined as target fields, thereby obtaining M target fields.

[0101] In this embodiment, by performing semantic analysis on the fields and parsing the data analysis requirements, the target semantics are obtained, and the fields among N fields whose corresponding semantics are the same as the target semantics are determined as target fields, thereby accurately determining the target fields that meet the semantic requirements.

[0102] Optionally, based on the data analysis requirement, embedding the M target fields into a corresponding letter template to generate a target text includes:

[0103] When M is equal to 0, the preset letter template is determined as the target text.

[0104] An optional implementation is that when M is equal to 0, indicating that the target field in the text to be processed is not extracted, the search result is determined to be empty, and the preset letter template is directly determined as the target text.

[0105] For example, the above-mentioned preset letter template may be "No information was retrieved, please re-enter the data."

[0106] Optionally, based on the data analysis requirement, embedding the M target fields into a corresponding letter template to generate a target text includes:

[0107] When M is not equal to 0, the data analysis requirement is parsed to obtain a letter template;

[0108] The M target fields are embedded into the above-mentioned letter template to generate the target text.

[0109] Another optional implementation is that when M is not equal to 0, it means that the target field in the text to be processed is extracted, then the search result is determined to be not empty, the data analysis requirements are parsed, the letter template is obtained, and M target fields are embedded into the above letter template to generate the target text.

[0110] To understand the technical solutions provided in the above embodiments, please refer to Figure 5 ,like Figure 5 As shown, the text generation device includes a letter generation module, the letter generation module includes a fixed template and a large model, and the "search result" is related to the number of target fields. Figure 5 In the application scenario shown, if the search result is empty, it means that the number of target fields is 0, and a letter is generated based on a fixed template; if the search result is not empty, it means that the number of target fields is not 0, and a large model is applied to embed the target field into the template obtained based on data analysis requirements to generate a letter.

[0111] In this embodiment, according to the number of target fields and data analysis requirements, target texts are generated through different letter templates to ensure that the generated texts meet the requirements of data analysis.

[0112] Optionally, the method further comprises:

[0113] Receive demand instructions;

[0114] The demand instruction is parsed to obtain the data analysis demand.

[0115] In this embodiment, an optional implementation method is that the above-mentioned data analysis demand is sent by the data analyst through a demand instruction.

[0116] Specifically, a text generation device that applies the text generation method provided in an embodiment of the present application is communicatively connected to a device used by a data analyst. The data analyst sends a demand instruction to the text generation device through the device. The text generation device receives the demand instruction and parses the demand instruction to obtain the data analysis demand.

[0117] Further references Figure 6 , as a response to the above Figure 2 In order to realize the method shown in the figure, the present application provides an embodiment of a text generation device 600, which is similar to Figure 2 Corresponding to the method embodiment shown, the device can be specifically applied to various electronic devices.

[0118] An embodiment of the present invention provides a text generation device 600, the text generation device 600 comprising:

[0119] An acquisition module 610 is used to acquire the text to be processed;

[0120] An analysis module 620 is used to perform text analysis on the text to be processed to obtain N fields in the text to be processed, where N is a positive integer greater than 1;

[0121] A screening module 630 is used to screen the N fields based on a preset data analysis requirement to obtain M target fields, where M is a positive integer less than N;

[0122] The generation module 640 is used to embed the M target fields into the corresponding letter template based on the data analysis requirements to generate the target text.

[0123] Optionally, the analysis module 620 is specifically configured to:

[0124] In the case where the text to be processed is a structured text, performing keyword extraction on the text to be processed;

[0125] The extracted N keywords are determined as N fields in the text to be processed.

[0126] Optionally, the analysis module 620 is further specifically configured to:

[0127] In the case where the text to be processed is an unstructured text, performing semantic analysis on the text to be processed;

[0128] Extract keywords from the text to be processed after semantic analysis;

[0129] The extracted N keywords are determined as N fields in the text to be processed.

[0130] Optionally, the screening module 630 is specifically used to:

[0131] Performing semantic analysis on each of the N fields to obtain semantics corresponding to each field;

[0132] Analyze the data analysis requirements to obtain target semantics;

[0133] Among the N fields, the fields whose corresponding semantics are the same as the target semantics are determined as target fields to obtain the M target fields.

[0134] Optionally, the generating module 640 is specifically configured to: when M is equal to 0, determine a preset letter template as the target text.

[0135] Optionally, the generating module 640 is further specifically configured to:

[0136] When M is not equal to 0, the data analysis requirement is parsed to obtain a letter template;

[0137] The M target fields are embedded into the above-mentioned letter template to generate the target text.

[0138] Optionally, the text generating device 600 further includes:

[0139] A receiving module, used for receiving a demand instruction;

[0140] The parsing module is used to parse the demand instruction to obtain the data analysis demand.

[0141] To solve the above technical problems, the present application also provides a computer device. Figure 7 , Figure 7 This is a basic structural block diagram of the computer device in this embodiment.

[0142] The computer device 7 includes a memory 71, a processor 72, and a network interface 73 that are interconnected through a system bus. It should be noted that the figure only shows a computer device 7 with components 71-73, but it should be understood that it is not required to implement all the components shown, and more or fewer components can be implemented instead. Among them, those skilled in the art can understand that the computer device here is a device that can automatically perform numerical calculations and / or information processing according to pre-set or stored instructions, and its hardware includes but is not limited to microprocessors, application specific integrated circuits (Application Specific Integrated Circuit, ASIC), programmable gate arrays (Field-Programmable Gate Array, FPGA), digital processors (Digital Signal Processor, DSP), embedded devices, etc.

[0143] The computer device may be a computing device such as a desktop computer, a notebook, a PDA, a cloud server, etc. The computer device may interact with a user through a keyboard, a mouse, a remote controller, a touch pad, or a voice control device.

[0144] The memory 71 includes at least one type of readable storage medium, and the readable storage medium includes flash memory, hard disk, multimedia card, card-type memory (for example, SD or DX memory, etc.), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, disk, optical disk, etc. In some embodiments, the memory 71 can be an internal storage unit of the computer device 7, such as a hard disk or memory of the computer device 7. In other embodiments, the memory 71 can also be an external storage device of the computer device 7, such as a plug-in hard disk equipped on the computer device 7, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (FlashCard), etc. Of course, the memory 71 can also include both the internal storage unit of the computer device 7 and its external storage device. In this embodiment, the memory 71 is generally used to store the operating system and various application software installed on the computer device 7, such as the program code of the text generation method, etc. In addition, the memory 71 can also be used to temporarily store various types of data that have been output or are to be output.

[0145] The processor 72 may be a central processing unit (CPU), a controller, a microcontroller, a microprocessor, or other data processing chips in some embodiments. The processor 72 is generally used to control the overall operation of the computer device 7. In this embodiment, the processor 72 is used to run the program code stored in the memory 71 or process data, such as running the program code of the text generation method.

[0146] The network interface 73 may include a wireless network interface or a wired network interface. The network interface 73 is generally used to establish a communication connection between the computer device 7 and other electronic devices.

[0147] The present application also provides another implementation, namely, providing a computer-readable storage medium, wherein the computer-readable storage medium stores the text generation program, and the text generation program can be executed by at least one processor so that the at least one processor performs the steps of the text generation method as described above.

[0148] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware online platform, and of course, by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in each embodiment of the present application.

[0149] The present application can be used in many general or special computer system environments or configurations. For example: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, distributed computing environments including any of the above systems or devices, etc. The present application can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. The present application can also be practiced in distributed computing environments, in which tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules can be located in local and remote computer storage media including storage devices.

[0150] Obviously, the embodiments described above are only some embodiments of the present application, rather than all embodiments. The preferred embodiments of the present application are given in the accompanying drawings, but they do not limit the patent scope of the present application. The present application can be implemented in many different forms. On the contrary, the purpose of providing these embodiments is to make the understanding of the disclosure of the present application more thorough and comprehensive. Although the present application is described in detail with reference to the aforementioned embodiments, for those skilled in the art, it is still possible to modify the technical solutions recorded in the aforementioned specific implementation methods, or to perform equivalent replacement of some of the technical features therein. Any equivalent structure made using the contents of the specification and drawings of this application, directly or indirectly used in other related technical fields, is similarly within the scope of patent protection of this application.

Claims

1. A text generation method, characterized in that: include: Get the text to be processed; Performing text analysis on the text to be processed to obtain N fields in the text to be processed, where N is a positive integer greater than 1; Based on the preset data analysis requirements, the N fields are screened to obtain M target fields, where M is a positive integer less than N; Based on the data analysis requirements, the M target fields are embedded into the corresponding letter template to generate the target text.

2. The method according to claim 1, characterized in that The performing text analysis on the text to be processed to obtain N fields in the text to be processed includes: In the case where the text to be processed is a structured text, performing keyword extraction on the text to be processed; The extracted N keywords are determined as N fields in the text to be processed.

3. The method according to claim 1, characterized in that The performing text analysis on the text to be processed to obtain N fields in the text to be processed includes: In the case where the text to be processed is an unstructured text, performing semantic analysis on the text to be processed; Extract keywords from the text to be processed after semantic analysis; The extracted N keywords are determined as N fields in the text to be processed.

4. The method according to claim 1, characterized in that: Based on the preset data analysis requirements, the N fields are screened to obtain M target fields, including: Performing semantic analysis on each of the N fields to obtain semantics corresponding to each field; Analyze the data analysis requirements to obtain target semantics; Among the N fields, the fields whose corresponding semantics are the same as the target semantics are determined as target fields to obtain the M target fields.

5. The method according to claim 1, characterized in that Based on the data analysis requirements, the M target fields are embedded into corresponding letter templates to generate target texts, including: When M is equal to 0, the preset letter template is determined as the target text.

6. The method according to claim 1, characterized in that Based on the data analysis requirements, the M target fields are embedded into corresponding letter templates to generate target texts, including: When M is not equal to 0, the data analysis requirement is parsed to obtain a letter template; The M target fields are embedded into the above-mentioned letter template to generate the target text.

7. The method according to any one of claims 1 to 6, characterized in that The method further comprises: Receive demand instructions; The demand instruction is parsed to obtain the data analysis demand.

8. A text generation device, characterized in that: include: An acquisition module is used to obtain the text to be processed; An analysis module, used for performing text analysis on the text to be processed to obtain N fields in the text to be processed, where N is a positive integer greater than 1; A screening module, used to screen the N fields based on preset data analysis requirements to obtain M target fields, where M is a positive integer less than N; A generation module is used to embed the M target fields into a corresponding letter template based on the data analysis requirements to generate a target text.

9. A computer device, characterized in that: The method comprises a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the steps of the text generation method according to any one of claims 1 to 7 are implemented.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the text generation method according to any one of claims 1 to 7 are implemented.