Text data generation method and device, electronic equipment and storage medium
Patent Information
- Application Number
- CN202311331989.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-10-16
- Publication Date
- 2026-08-18
- Estimated Expiration
- 2043-10-16
AI Technical Summary
[0002]对非结构化文本数据进行加工处理,人工方式耗时耗力,并且容易出错
[0054] Therefore, this application integrates pre-defined text summary information, pre-defined text structure information, and a first text set into model input data that can be directly input into a large model. This allows the pre-defined model to directly process the first text set contained in the model input data into structured data without undergoing large-scale text training, directly outputting structured text data that meets user expectations. This achieves "out-of-the-box" usability for large models, saving the time and money costs of sample learning and training. Simultaneously, using the pre-defined model's general language processing capabilities to process the first text set can generate accurate and expected structured data, avoiding the problems of insufficient noise resistance and overfitting in machine learning techniques. Furthermore, the preprocessing of the model input data is universal, avoiding the limitations of machine learning techniques due to the characteristics of training samples and the restricted application scenarios. This solves the technical shortcomings of related technologies, such as high data preparation and model training costs and limited applicability.
Smart Images

Figure CN117312547B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of electronic equipment technology, and more specifically, to a text data generation method, apparatus, electronic device, and storage medium. Background Technology
[0002] Processing unstructured text data manually is time-consuming, labor-intensive, and prone to errors.
[0003] In related technologies, machine learning requires a large number of samples for learning and training in order to meet the needs of structured data extraction in specific scenarios. This has the drawbacks of high data preparation and model training costs and limited applicability.
[0004] Therefore, overcoming the aforementioned technical deficiencies has become an urgent technical problem to be solved. Summary of the Invention
[0005] The present invention aims to solve at least one of the technical problems existing in the prior art.
[0006] Therefore, the first aspect of the present invention proposes a method for generating text data.
[0007] A second aspect of the present invention provides a text data generation apparatus.
[0008] A third aspect of the present invention provides an electronic device.
[0009] A fourth aspect of the present invention provides a readable storage medium.
[0010] In view of this, a first aspect of the present invention provides a text data generation method, the text data generation method comprising:
[0011] Obtain the preset text structure information;
[0012] Given the first text set, the model input data is generated based on the preset text summary information, preset text structure information, and the first text set.
[0013] Input the model input data into the preset model to generate target text data, which is structured text data that matches the preset text structure information.
[0014] This application defines a text data generation method that can generate text data required by a user based on a text set, thereby meeting the user's text processing needs and providing convenient conditions for the user to process text information.
[0015] Specifically, in the process of generating text data, preset text structure information is first obtained. This preset text structure information corresponds to the user's text structuring requirements, i.e., the text data structure desired by the user. Having obtained the preset text structure information and the first text set to be processed by the user, model input data suitable for input into the larger model is generated based on the preset text summary information, the preset text structure information, and the first text set. Finally, the model input data is input into the preset model. After processing the model input data, the preset model outputs target text data. This target text data satisfies the user's desired data structure; that is, the first text set does not possess the user's desired data structure. After integrating the model input data and processing by the preset model, structured text data that meets the user's desired data structure is obtained, i.e., the target text data.
[0016] Therefore, this application integrates pre-defined text summary information, pre-defined text structure information, and a first text set into model input data that can be directly input into a large model. This allows the pre-defined model to directly process the first text set contained in the model input data into structured data without undergoing large-scale text training, directly outputting structured text data that meets user expectations. This achieves "out-of-the-box" usability for large models, saving the time and money costs of sample learning and training. Simultaneously, using the pre-defined model's general language processing capabilities to process the first text set can generate accurate and expected structured data, avoiding the problems of insufficient noise resistance and overfitting in machine learning techniques. Furthermore, the preprocessing of the model input data is universal, avoiding the limitations of machine learning techniques due to the characteristics of training samples and the restricted application scenarios. This solves the technical shortcomings of related technologies, such as high data preparation and model training costs and limited applicability.
[0017] This achieves the technical effects of optimizing the processing efficiency and accuracy of unstructured text data, reducing the cost of structured text processing, expanding the scenarios for structured text processing, and improving the user experience.
[0018] In addition, the text data generation method provided by the present invention may also have the following additional technical features:
[0019] In some technical solutions of the invention, optionally, model input data is input into a preset model to generate target text data, including:
[0020] The first text data is extracted from the first text set based on the preset text summary information using a preset model. The first text data is unstructured text data.
[0021] By using a preset model, the first text data is structured according to the preset text structure information to obtain the target text data.
[0022] In this technical solution, the step of inputting model input data into a preset model to generate target text data is refined. Specifically, after the model input data is entered into the preset model, the preset model extracts first text data from a first text set based on preset text summary information. This extracted first text data does not yet possess structured attributes and is considered unstructured text data. Subsequently, the preset model performs structuring processing on the unstructured first text data based on preset text structure information to obtain target text data that meets the user's expected structured requirements.
[0023] By limiting the extraction process of the first text data, a large model can automatically filter key text information, eliminating the need for users to actively identify the information to be filtered, thereby improving the processing efficiency and accuracy of text data. Based on a pre-defined text structure, the first text data can be directly structured using a pre-defined model, eliminating the need to train the model with a large number of training samples. This allows for the direct output of structured text data that meets user expectations, achieving "out-of-the-box" functionality for the large model and saving the time and money costs associated with sample learning and training. This addresses the technical shortcomings of related technologies, such as high data preparation and model training costs and limited applicability.
[0024] Optionally, in some technical solutions of the invention, pre-defined text structure information is obtained, including:
[0025] Extract text information from the target text model;
[0026] Generate preset text structure information based on the text information in the target text model;
[0027] The target text model includes any of the following: domain text model, entity text model, and data text model.
[0028] This technical solution refines the step of obtaining the preset text structure. Specifically, after obtaining the target text model, key fields or attributes in the target text model are filtered to extract text information. Subsequently, based on the text information extracted from the target text model, corresponding preset text structure information is generated and finally integrated into the model input data.
[0029] The target text model includes at least one of the following: domain text model, entity text model, and data text model. The domain text model, entity text model, and data text model can be directly obtained from the cloud database. Users can select and download the corresponding target text model according to their expectations, thereby saving users the steps of building the target text model themselves or training the target text model through a large amount of sample data. This achieves the "out-of-the-box" functionality of the preset model, realizing the technical effect of optimizing the processing efficiency of unstructured text data and reducing the processing cost of structured text.
[0030] In some technical solutions of the invention, optionally, the text information in the target text model includes at least one of the following: key field information, attribute information, and additional constraint information.
[0031] In this technical solution, the text information in the target text model includes at least one of key field information, attribute information, and additional constraint information.
[0032] Key field information can ensure the accuracy of the extraction of the first text data, reduce the possibility of extracting data that is not expected by the user or omitting data that the user expects, thereby improving the processing accuracy of structured data.
[0033] The attribute information corresponds to the user's structured expectations. By limiting the attribute data, it can be ensured that the structured attributes of the final target text data match the user's expectations.
[0034] Additional constraint requirements correspond to additional expectations beyond the structured expectations, and users can optimize the target text data by editing the additional constraint information.
[0035] In some technical solutions of the invention, optionally, upon obtaining the first text set, model input data is generated based on preset text summary information, preset text structure information, and the first text set, including:
[0036] Based on the preset text summary information, generate the first extraction instruction;
[0037] The model input data is generated based on the first extraction instruction, the preset text structure information, and the first text set.
[0038] In this technical solution, the step of generating model input data based on preset text summary information, preset text structure information, and the first text set after obtaining the first text set is refined. After obtaining the preset text summary information, the corresponding first extraction instruction is determined based on the preset text summary information. After determining the first extraction instruction, the first extraction instruction, the preset text structure information, and the first text set are integrated into the model input data.
[0039] By defining the steps for generating the first extraction instruction, this text data generation method can automatically extract text filtering and extraction rules based on preset text summary information. This ensures that the text data extracted from the first text set matches the user's text extraction needs, reducing the possibility of extracting data that is not expected by the user or omitting data that the user expects. This achieves the technical effect of optimizing the accuracy of text data generation.
[0040] Optionally, in some technical solutions of the invention, a first extraction instruction is generated based on preset text summary information, including:
[0041] Acquire data processing information, anomaly handling information, and data output information;
[0042] Based on data processing information, anomaly handling information, data output information, and preset text summary information, a first extraction instruction is generated.
[0043] In this technical solution, the step of generating a first extraction instruction based on preset text summary information is refined. Specifically, after obtaining the preset text summary information, data processing information, exception handling information, and data output information are acquired. Then, corresponding data processing sub-instructions are determined based on the data processing information, corresponding exception handling sub-instructions are determined based on the exception handling information, corresponding data return sub-instructions are determined based on the data output information, and corresponding summary extraction sub-instructions are determined based on the preset text summary information. Finally, the data processing sub-instructions, exception handling sub-instructions, data return sub-instructions, and summary extraction sub-instructions are integrated to obtain a first extraction instruction that meets the user's expectations.
[0044] The first extraction instruction generated by the above method can meet the user's expectations for data filtering and processing, thereby ensuring the accuracy of the processed structured text data. Furthermore, this first extraction instruction also has an exception handling function to prevent the text processing flow from being interrupted due to abnormalities. This achieves the technical effect of improving the reliability of text data generation.
[0045] In some technical solutions of the invention, optionally, upon obtaining the first text set, model input data is generated based on preset text summary information, preset text structure information, and the first text set, including:
[0046] Based on the preset text summary information and preset text structure information, a second extraction instruction is generated;
[0047] Based on the second extraction instruction and the first text set, generate model input data.
[0048] In this technical solution, the step of generating model input data based on preset text summary information, preset text structure information, and the first text set, after obtaining the first text set, is further refined. Specifically, after obtaining the preset text structure information and preset text summary information, the corresponding second extraction instruction is determined based on the preset text structure information and preset text summary information. After determining the second extraction instruction, the second extraction instruction, the preset text structure information, and the first text set are integrated into the model input data.
[0049] By defining the steps for generating the second extraction instruction, this text data generation method can automatically extract text structure processing rules based on preset text structure information, and automatically extract text filtering and extraction rules based on preset text summary information. This ensures that the model input data contains the user's structured expectations and that the text data extracted from the first text set matches the user's text extraction needs. Ultimately, this achieves the technical effects of optimizing the processing efficiency and accuracy of unstructured text data, reducing the cost of structured text processing, broadening the scenarios for structured text processing, and improving the user experience.
[0050] Specifically, the second extraction instruction, which includes a preset text structure, is a special form of text summary extraction instruction.
[0051] A second aspect of the present invention provides a text data generation apparatus, comprising: an acquisition module for acquiring preset text structure information; a generation module for generating model input data based on preset text summary information, preset text structure information, and the first text set when a first text set is acquired; and a generation module for inputting the model input data into a preset model to generate target text data, wherein the target text data is structured text data that matches the preset text structure information.
[0052] This application defines a text data generation device that can generate text data required by a user based on a text set, thereby meeting the user's text processing needs and providing convenient conditions for the user to process text information.
[0053] Specifically, in the process of generating text data, the acquisition module first obtains preset text structure information, which corresponds to the user's text structuring requirements, i.e., the text data structure expected by the user. Having obtained the preset text structure information and the first text set to be processed by the user, the generation module generates model input data that can be entered into the large model based on the preset text summary information, the preset text structure information, and the first text set. Finally, the generation module inputs the model input data into the preset model. After processing the model input data, the preset model outputs target text data. This target text data satisfies the user's expected data structure; that is, the first text set does not possess the user's expected data structure. After integrating the model input data and processing by the preset model, structured text data that meets the user's expected data structure is obtained, i.e., the target text data.
[0054] Therefore, this application integrates pre-defined text summary information, pre-defined text structure information, and a first text set into model input data that can be directly input into a large model. This allows the pre-defined model to directly process the first text set contained in the model input data into structured data without undergoing large-scale text training, directly outputting structured text data that meets user expectations. This achieves "out-of-the-box" usability for large models, saving the time and money costs of sample learning and training. Simultaneously, using the pre-defined model's general language processing capabilities to process the first text set can generate accurate and expected structured data, avoiding the problems of insufficient noise resistance and overfitting in machine learning techniques. Furthermore, the preprocessing of the model input data is universal, avoiding the limitations of machine learning techniques due to the characteristics of training samples and the restricted application scenarios. This solves the technical shortcomings of related technologies, such as high data preparation and model training costs and limited applicability.
[0055] This achieves the technical effects of optimizing the processing efficiency and accuracy of unstructured text data, reducing the cost of structured text processing, expanding the scenarios for structured text processing, and improving the user experience.
[0056] A third aspect of the present invention provides an electronic device comprising: a processor and a memory, wherein the memory stores a program or instructions executable on the processor, and the program or instructions, when executed by the processor, implement the steps of the text data generation method in any of the above-described technical solutions.
[0057] In this technical solution, an electronic device is provided that can implement any of the above technical solutions. Therefore, the electronic device has the advantages of the text data generation method in any of the above technical solutions and can achieve the technical effect of the text data generation method in any of the above technical solutions. To avoid repetition, it will not be described in detail here.
[0058] A fourth aspect of the present invention provides a read storage medium having a program or instructions stored thereon, wherein the program or instructions, when executed by a processor, implement the steps of the text data generation method in any of the above-described technical solutions.
[0059] In this technical solution, a readable storage medium is provided that, after being read by a processor, can implement the steps of the text data generation method in any of the above technical solutions. Therefore, the readable storage medium has the advantages of the text data generation method in any of the above technical solutions and can achieve the technical effects of the text data generation method in any of the above technical solutions. To avoid repetition, it will not be described in detail here.
[0060] Additional aspects and advantages of the invention will become apparent in the following description or may be learned by practice of the invention. Attached Figure Description
[0061] The above and / or additional aspects and advantages of the present invention will become apparent and readily understood from the description of the embodiments taken in conjunction with the following drawings, in which:
[0062] Figure 1 A flowchart of a text data generation method according to an embodiment of the present invention is shown;
[0063] Figure 2 A flowchart of a text data generation method according to an embodiment of the present invention is shown;
[0064] Figure 3 A flowchart of a text data generation method according to an embodiment of the present invention is shown;
[0065] Figure 4 A flowchart of a text data generation method according to an embodiment of the present invention is shown;
[0066] Figure 5 A flowchart of a text data generation method according to an embodiment of the present invention is shown;
[0067] Figure 6 A flowchart of a text data generation method according to an embodiment of the present invention is shown;
[0068] Figure 7 A flowchart of a text data generation method according to an embodiment of the present invention is shown;
[0069] Figure 8 A structural block diagram of a text data generation apparatus according to an embodiment of the present invention is shown;
[0070] Figure 9 A structural block diagram of an electronic device according to an embodiment of the present invention is shown. Detailed Implementation
[0071] To better understand the above-mentioned objectives, features, and advantages of the present invention, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments. It should be noted that, unless otherwise specified, the embodiments and features described in these embodiments can be combined with each other.
[0072] Many specific details are set forth in the following description in order to provide a full understanding of the invention. However, the invention may also be practiced in other ways different from those described herein, and therefore the scope of protection of the invention is not limited to the specific embodiments disclosed below.
[0073] The following reference Figures 1 to 9 This invention describes text data generation methods, apparatuses, electronic devices, and storage media according to some embodiments of the present invention.
[0074] like Figure 1 As shown, one embodiment of this application proposes a text data generation method, which includes:
[0075] Step 102: Obtain the preset text structure information;
[0076] Step 104: Given the first text set, generate model input data based on the preset text summary information, preset text structure information, and the first text set;
[0077] Step 106: Input the model input data into the preset model to generate target text data. The target text data is structured text data that matches the preset text structure information.
[0078] This application defines a text data generation method that can generate text data required by a user based on a text set, thereby meeting the user's text processing needs and providing convenient conditions for the user to process text information.
[0079] Specifically, in the process of generating text data, preset text structure information is first obtained. This preset text structure information corresponds to the user's text structuring requirements, i.e., the text data structure desired by the user. Having obtained the preset text structure information and the first text set to be processed by the user, model input data suitable for input into the larger model is generated based on the preset text summary information, the preset text structure information, and the first text set. Finally, the model input data is input into the preset model. After processing the model input data, the preset model outputs target text data. This target text data satisfies the user's desired data structure; that is, the first text set does not possess the user's desired data structure. After integrating the model input data and processing by the preset model, structured text data that meets the user's desired data structure is obtained, i.e., the target text data.
[0080] Therefore, this application integrates pre-defined text summary information, pre-defined text structure information, and a first text set into model input data that can be directly input into a large model. This allows the pre-defined model to directly process the first text set contained in the model input data into structured data without undergoing large-scale text training, directly outputting structured text data that meets user expectations. This achieves "out-of-the-box" usability for large models, saving the time and money costs of sample learning and training. Simultaneously, using the pre-defined model's general language processing capabilities to process the first text set can generate accurate and expected structured data, avoiding the problems of insufficient noise resistance and overfitting in machine learning techniques. Furthermore, the preprocessing of the model input data is universal, avoiding the limitations of machine learning techniques due to the characteristics of training samples and the restricted application scenarios. This solves the technical shortcomings of related technologies, such as high data preparation and model training costs and limited applicability.
[0081] This achieves the technical effects of optimizing the processing efficiency and accuracy of unstructured text data, reducing the cost of structured text processing, expanding the scenarios for structured text processing, and improving the user experience.
[0082] like Figure 2 As shown, in some technical solutions of the invention, optionally, model input data is input into a preset model to generate target text data, including:
[0083] Step 202: Extract the first text data from the first text set according to the preset text summary information using the preset model. The first text data is unstructured text data.
[0084] Step 204: Using a preset model, the unstructured text data is structured according to the preset text structure information to obtain the target text data.
[0085] In this technical solution, the step of inputting model input data into a preset model to generate target text data is refined. Specifically, after the model input data is entered into the preset model, the preset model extracts first text data from a first text set based on preset text summary information. This extracted first text data does not yet possess structured attributes and is considered unstructured text data. Subsequently, the preset model performs structuring processing on the unstructured first text data based on preset text structure information to obtain target text data that meets the user's expected structured requirements.
[0086] By limiting the extraction process of the first text data, a large model can automatically filter key text information, eliminating the need for users to actively identify the information to be filtered, thereby improving the processing efficiency and accuracy of text data. Based on a pre-defined text structure, the first text data can be directly structured using a pre-defined model, eliminating the need to train the model with a large number of training samples. This allows for the direct output of structured text data that meets user expectations, achieving "out-of-the-box" functionality for the large model and saving the time and money costs associated with sample learning and training. This addresses the technical shortcomings of related technologies, such as high data preparation and model training costs and limited applicability.
[0087] like Figure 3 As shown, in some technical solutions of the invention, optionally, obtaining preset text structure information includes:
[0088] Step 302: Extract text information from the target text model;
[0089] Step 304: Generate preset text structure information based on the text information in the target text model;
[0090] The target text model includes any of the following: domain text model, entity text model, and data text model.
[0091] This technical solution refines the step of obtaining the preset text structure. Specifically, after obtaining the target text model, key fields or attributes in the target text model are filtered to extract text information. Subsequently, based on the text information extracted from the target text model, corresponding preset text structure information is generated and finally integrated into the model input data.
[0092] The target text model includes at least one of the following: domain text model, entity text model, and data text model. The domain text model, entity text model, and data text model can be directly obtained from the cloud database. Users can select and download the corresponding target text model according to their expectations, thereby saving users the steps of building the target text model themselves or training the target text model through a large amount of sample data. This achieves the "out-of-the-box" functionality of the preset model, realizing the technical effect of optimizing the processing efficiency of unstructured text data and reducing the processing cost of structured text.
[0093] In some technical solutions of the invention, optionally, the text information in the target text model includes at least one of the following: key field information, attribute information, and additional constraint information.
[0094] In this technical solution, the text information in the target text model includes at least one of key field information, attribute information, and additional constraint information.
[0095] Key field information can ensure the accuracy of the extraction of the first text data, reduce the possibility of extracting data that is not expected by the user or omitting data that the user expects, thereby improving the processing accuracy of structured data.
[0096] The attribute information corresponds to the user's structured expectations. By limiting the attribute data, it can be ensured that the structured attributes of the final target text data match the user's expectations.
[0097] Additional constraint requirements correspond to additional expectations beyond the structured expectations, and users can optimize the target text data by editing the additional constraint information.
[0098] like Figure 4 As shown, in some technical solutions of the invention, optionally, upon obtaining the first text set, model input data is generated based on preset text summary information, preset text structure information, and the first text set, including:
[0099] Step 402: Generate a first extraction instruction based on the preset text summary information;
[0100] Step 404: Generate model input data based on the first extraction instruction, preset text structure information, and the first text set.
[0101] In this technical solution, the step of generating model input data based on preset text summary information, preset text structure information, and the first text set after obtaining the first text set is refined. After obtaining the preset text summary information, the corresponding first extraction instruction is determined based on the preset text summary information. After determining the first extraction instruction, the first extraction instruction, the preset text structure information, and the first text set are integrated into the model input data.
[0102] By defining the steps for generating the first extraction instruction, this text data generation method can automatically extract text filtering and extraction rules based on preset text summary information. This ensures that the text data extracted from the first text set matches the user's text extraction needs, reducing the possibility of extracting data that is not expected by the user or omitting data that the user expects. This achieves the technical effect of optimizing the accuracy of text data generation.
[0103] like Figure 5 As shown, in some technical solutions of the invention, optionally, a first extraction instruction is generated based on preset text summary information, including:
[0104] Step 502: Obtain data processing information, anomaly handling information, and data output information;
[0105] Step 504: Generate the first extraction instruction based on the data processing information, anomaly handling information, data output information, and preset text summary information.
[0106] In this technical solution, the step of generating a first extraction instruction based on preset text summary information is refined. Specifically, after obtaining the preset text summary information, data processing information, exception handling information, and data output information are acquired. Then, corresponding data processing sub-instructions are determined based on the data processing information, corresponding exception handling sub-instructions are determined based on the exception handling information, corresponding data return sub-instructions are determined based on the data output information, and corresponding summary extraction sub-instructions are determined based on the preset text summary information. Finally, the data processing sub-instructions, exception handling sub-instructions, data return sub-instructions, and summary extraction sub-instructions are integrated to obtain a first extraction instruction that meets the user's expectations.
[0107] The first extraction instruction generated by the above method can meet the user's expectations for data filtering and processing, thereby ensuring the accuracy of the processed structured text data. Furthermore, this first extraction instruction also has an exception handling function to prevent the text processing flow from being interrupted due to abnormalities. This achieves the technical effect of improving the reliability of text data generation.
[0108] like Figure 6 As shown, in some technical solutions of the invention, optionally, upon obtaining the first text set, model input data is generated based on preset text summary information, preset text structure information, and the first text set, including:
[0109] Step 602: Generate a second extraction instruction based on the preset text summary information and preset text structure information;
[0110] Step 604: Generate model input data based on the second extraction instruction and the first text set.
[0111] In this technical solution, the step of generating model input data based on preset text summary information, preset text structure information, and the first text set, after obtaining the first text set, is further refined. Specifically, after obtaining the preset text structure information and preset text summary information, the corresponding second extraction instruction is determined based on the preset text structure information and preset text summary information. After determining the second extraction instruction, the second extraction instruction, the preset text structure information, and the first text set are integrated into the model input data.
[0112] By defining the steps for generating the second extraction instruction, this text data generation method can automatically extract text structure processing rules based on preset text structure information, and automatically extract text filtering and extraction rules based on preset text summary information. This ensures that the model input data contains the user's structured expectations and that the text data extracted from the first text set matches the user's text extraction needs. Ultimately, this achieves the technical effects of optimizing the processing efficiency and accuracy of unstructured text data, reducing the cost of structured text processing, broadening the scenarios for structured text processing, and improving the user experience.
[0113] Specifically, the second extraction instruction, which includes a preset text structure, is a special form of text summary extraction instruction.
[0114] like Figure 7 As shown in a specific embodiment of this application, the text data processing flow is as follows:
[0115] Step 702, construct the expected data structure;
[0116] Step 704, Organize the large model input data (Prompt);
[0117] Step 706, Large-scale natural language processing;
[0118] Step 708: Generate structured data.
[0119] Wherein, the expected data structure corresponds to the preset text structure information in any of the above embodiments, the large model input data corresponds to the model input data in any of the above embodiments, and the structured data corresponds to the target text data in any of the above embodiments.
[0120] Table 1 below shows the instruction patterns and structure of the model input data.
[0121] Table 1
[0122]
[0123] Specifically, here's an example of a preset text structure:
[0124] {"customer": "{customer}","address": "{shipping address}","eta": "{expected delivery time|yyyy-MM-dd}","details": [{"product": "{product name}","attributes": "{product specifications, model, parameters}","quantity": "{quantity}","unit": "{unit of measurement}"}]}
[0125] Example of a simple text summary extraction command:
[0126] Please extract the summary of the "text to be processed" according to the "expected data structure" format and output it in JSON format.
[0127] Multi-step text summarization and prompt extraction example:
[0128] Please follow these steps to complete the task:
[0129] Step 1. Please extract the summary of the "text to be processed" according to the "expected data structure" format.
[0130] Step 2. Merge duplicate products in the results data from Step 1 and sum the quantities.
[0131] Step 3. Output the results from Step 2 in JSON format.
[0132] like Figure 8 As shown, one embodiment of the present invention provides a text data generation device 800, which includes: an acquisition module 802 for acquiring preset text structure information; a generation module 804 for generating model input data based on preset text summary information, preset text structure information and the first text set when a first text set is acquired; and a generation module 804 for inputting the model input data into a preset model to generate target text data, wherein the target text data is structured text data that matches the preset text structure information.
[0133] This application defines a text data generation device that can generate text data required by a user based on a text set, thereby meeting the user's text processing needs and providing convenient conditions for the user to process text information.
[0134] Specifically, in the process of generating text data, the acquisition module 802 first acquires preset text structure information, which corresponds to the user's text structuring requirements, i.e., the text data structure expected by the user. Having acquired the preset text structure information and the first text set to be processed by the user, the generation module 804 generates model input data that can be entered into the large model based on the preset text summary information, the preset text structure information, and the first text set. Finally, the generation module 804 inputs the model input data into the preset model. After processing the model input data, the preset model outputs target text data. This target text data satisfies the user's expected data structure; that is, the first text set does not possess the user's expected data structure. After integrating the model input data and processing the preset model, structured text data that meets the user's expected data structure is obtained, i.e., the target text data.
[0135] Therefore, this application integrates pre-defined text summary information, pre-defined text structure information, and a first text set into model input data that can be directly input into a large model. This allows the pre-defined model to directly process the first text set contained in the model input data into structured data without undergoing large-scale text training, directly outputting structured text data that meets user expectations. This achieves "out-of-the-box" usability for large models, saving the time and money costs of sample learning and training. Simultaneously, using the pre-defined model's general language processing capabilities to process the first text set can generate accurate and expected structured data, avoiding the problems of insufficient noise resistance and overfitting in machine learning techniques. Furthermore, the preprocessing of the model input data is universal, avoiding the limitations of machine learning techniques due to the characteristics of training samples and the restricted application scenarios. This solves the technical shortcomings of related technologies, such as high data preparation and model training costs and limited applicability.
[0136] This achieves the technical effects of optimizing the processing efficiency and accuracy of unstructured text data, reducing the cost of structured text processing, expanding the scenarios for structured text processing, and improving the user experience.
[0137] like Figure 9 As shown, one embodiment of the present invention provides an electronic device 900, which includes a processor 904 and a memory 902. The memory 902 stores programs or instructions that can run on the processor 904. When the program or instructions are executed by the processor 904, they implement the steps of the text data generation method in any of the above embodiments.
[0138] In this embodiment, an electronic device 900 is provided that can implement any of the above embodiments. Therefore, the electronic device 900 has the advantages of the text data generation method in any of the above embodiments and can achieve the technical effects of the text data generation method in any of the above embodiments. To avoid repetition, it will not be described again here.
[0139] One embodiment of the present invention provides a readable storage medium having a program or instructions stored thereon, which, when executed by a processor, implement the steps of the text data generation method in any of the above embodiments.
[0140] In this embodiment, a readable storage medium is provided that, after being read by a processor, can implement the steps of the text data generation method in any of the above embodiments. Therefore, the readable storage medium has the advantages of the text data generation method in any of the above embodiments and can achieve the technical effects of the text data generation method in any of the above embodiments. To avoid repetition, it will not be described again here.
[0141] It should be clarified that in the claims, description, and accompanying drawings of this invention, the term "plural" refers to two or more. Unless otherwise explicitly defined, the terms "upper," "lower," etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings, and are only for the convenience of describing the invention and simplifying the description process, not to indicate or imply that the device or element referred to must have the described specific orientation, or be constructed and operated in a specific orientation. Therefore, these descriptions should not be construed as limiting the invention. The terms "connection," "installation," "fixing," etc., should be interpreted broadly. For example, "connection" can be a fixed connection between multiple objects, a detachable connection between multiple objects, or an integral connection; it can be a direct connection between multiple objects or an indirect connection between multiple objects through an intermediate medium. For those skilled in the art, the specific meaning of the above terms in this invention can be understood based on the specific circumstances of the above data.
[0142] In the claims, description, and accompanying drawings of this invention, the terms "one embodiment," "some embodiments," "specific embodiment," etc., refer to a specific feature, structure, material, or characteristic described in connection with that embodiment or example, which is included in at least one embodiment or example of the invention. In the claims, description, and accompanying drawings of this invention, illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples.
[0143] The above are merely preferred embodiments of the present invention and are not intended to limit the present invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. A method for generating text data, characterized in that, include: Obtain the preset text structure information; Given the first text set, model input data is generated based on preset text summary information, preset text structure information, and the first text set. The model input data is input into a preset model to generate target text data, wherein the target text data is structured text data that matches the preset text structure information; The process of obtaining the preset text structure information includes: Extract text information from the target text model; Based on the text information in the target text model, the preset text structure information is generated; The target text model includes any one of the following: a domain text model, an entity text model, or a data text model; the domain text model, the entity text model, and the data text model are obtained directly from a cloud database. The step of generating model input data based on preset text summary information, preset text structure information, and the first text set, upon obtaining the first text set, includes: Based on the preset text summary information, a first extraction instruction is generated; The model input data is generated based on the first extraction instruction, the preset text structure information, and the first text set; The step of generating a first extraction instruction based on the preset text summary information includes: Acquire data processing information, anomaly handling information, and data output information; The first extraction instruction is generated based on the data processing information, the anomaly handling information, the data output information, and the preset text summary information.
2. The text data generation method according to claim 1, characterized in that, The step of inputting the model input data into a preset model to generate target text data includes: The first text data in the first text set is extracted using the preset model and the preset text summary information. The first text data is unstructured text data. The target text data is obtained by structuring the first text data according to the preset text structure information using the preset model.
3. A text data generation device, characterized in that, The text data generation device is used to implement the steps of the text data generation method as described in claim 1 or 2, and the text data generation device includes: The acquisition module is used to acquire preset text structure information; The generation module is used to generate model input data based on preset text summary information, preset text structure information and the first text set when the first text set is obtained; The generation module is used to input the model input data into a preset model to generate target text data, wherein the target text data is structured text data that matches the preset text structure information.
4. An electronic device, characterized in that, include: A processor and a memory, the memory storing a program or instructions that can run on the processor, the program or instructions being executed by the processor to implement the steps of the method as described in claim 1 or 2.
5. A readable storage medium having a program or instructions stored thereon, characterized in that, When the program or instructions are executed by the processor, they implement the steps of the method as described in claim 1 or 2.
Citation Information
Patent Citations
Intelligent question and answer method, device and equipment and storage medium
CN116069911A
Method, electronic device, and storage medium for training text generation model
US20210374359A1