Structured data corpus generation method, electronic device, computer readable medium and computer program product
By acquiring labeled target examples and structured data to generate prompt words, and using a large language model to generate target data, the problem of high cost and poor flexibility in generating structured data in the field of communication is solved. This enables the automated generation of high-quality and diverse corpus samples and improves the generalization ability of the model.
Patent Information
- Application Number
- CN202510560230.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-29
- Publication Date
- 2026-11-06
AI Technical Summary
In existing technologies, generating corpus sample data based on structured data in the field of communication is costly and difficult to apply on a large scale. Furthermore, corpus sample data generated based on predefined rules has poor flexibility, resulting in insufficient model generalization.
By acquiring labeled target examples and structured data, prompt words are generated, and target data is generated based on the prompt words using a large language model. Combined with random sampling techniques, high-quality corpus sample data is automatically generated in large batches.
While ensuring the quality of the corpus, the human cost of corpus generation was reduced, the diversity of corpus samples and the generalization ability of the model were improved, and the problems of high cost and poor flexibility in corpus generation were solved.
Smart Images

Figure CN123050563A_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of artificial intelligence technology, and in particular to a method for generating corpus of structured data, an electronic device, a computer-readable medium, and a computer program product. Background Technology
[0002] In recent years, large-scale models have demonstrated powerful capabilities in natural language processing and multimodal tasks, marking a shift in AI (Artificial Intelligence) technology from specialized models to general-purpose models. The core capabilities of large-scale models rely on two main elements: data and parameters. While increasing the number of parameters enhances the expressive power of large-scale models, the scale and quality of the data are the key determinants of their performance. High-quality, diverse data serves as the "fuel" for large-scale models to learn language rules and knowledge, directly impacting their generalization ability and robustness, making corpus generation technology particularly important.
[0003] Corpus generation, through methods such as data augmentation, synthetic data generation, and manual annotation, can effectively supplement and optimize training data, addressing issues of data scarcity and quality. In the field of communications, technologies for generating text corpora based on structured data in the communications domain are particularly important. Structured data in the communications domain is characterized by high standardization, hierarchy, real-time nature, and multi-dimensional correlation. It typically follows strict communication protocol definitions, is stored using fixed field formats, and includes key information such as timestamps, session identifiers, and device identifiers. This type of data is mostly numerical measurement indicators (such as signal strength and latency) or discrete states (such as signaling events), with clear logical layers (such as physical layer and network layer data), and may involve large-scale, high-dimensional network topology and user behavior information.
[0004] In related technologies, corpus sample data can be generated based on structured communication data, specifically by expert annotation. However, this method of corpus generation is costly and difficult to apply on a large scale. Summary of the Invention
[0005] This disclosure provides a method for generating corpus of structured data, an electronic device, a computer-readable medium, and a computer program product.
[0006] In a first aspect, embodiments of this disclosure provide a method for generating a corpus of structured data, comprising: acquiring target examples and raw data, wherein the target examples are labeled examples and the raw data are structured data;
[0007] Generate prompt words corresponding to the original data based on the target example;
[0008] By using a pre-defined large language model, target data corresponding to the original data is obtained according to the prompt word instructions, and the target data is used to generate corpus sample data.
[0009] Secondly, embodiments of this disclosure provide an electronic device, including a memory and a processor; the memory stores a computer program executable by the processor, and when the computer program is executed by the processor, it implements the corpus generation method for structured data.
[0010] Thirdly, embodiments of this disclosure provide a computer-readable medium having a computer program stored thereon, which, when executed by a processor, implements the corpus generation method for structured data.
[0011] Fourthly, embodiments of this disclosure provide a computer program product, which includes a computer program that, when executed by a processor, implements the corpus generation method for structured data.
[0012] The method for generating corpus data from structured data in this embodiment includes: acquiring target examples and original data, where the target examples are annotated examples and the original data is structured data; generating prompt word instructions corresponding to the original data based on the target examples; obtaining target data corresponding to the original data based on the prompt word instructions using a preset large language model, and using the target data to generate corpus sample data; this embodiment utilizes expert-annotated examples to generate prompt word instructions corresponding to structured original data, and generates target data based on the prompt word instruction fields using a preset large language model, so as to generate corpus sample data corresponding to the original data based on the target data; combining a small number of high-quality expert-annotated examples with the powerful generation capability of a large language model, it can automatically generate high-quality corpus sample data in large batches, reducing the human cost of corpus generation while ensuring corpus quality. Attached Figure Description
[0013] In the accompanying drawings of the embodiments disclosed herein:
[0014] Figure 1 A flowchart illustrating the corpus generation method for structured data provided in this embodiment of the disclosure;
[0015] Figure 2 This is a schematic diagram illustrating the generation of multimodal corpora from structured data provided in embodiments of this disclosure.
[0016] Figure 3 A block diagram of the electronic device provided in the embodiments of this disclosure. Detailed Implementation
[0017] To enable those skilled in the art to better understand the technical solutions of this disclosure, the embodiments of this disclosure will be described in detail below with reference to the accompanying drawings.
[0018] The present disclosure will be described more fully below with reference to the accompanying drawings; however, the embodiments shown may be embodied in different forms, and the present disclosure should not be construed as limited to the embodiments set forth below. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will enable those skilled in the art to fully understand the scope of the disclosure.
[0019] The accompanying drawings of the embodiments disclosed herein are provided to further illustrate the embodiments of this disclosure and form part of the specification. They are used together with the detailed embodiments to explain this disclosure and do not constitute a limitation thereof. The above and other features and advantages will become more apparent to those skilled in the art from the description of the detailed embodiments with reference to the accompanying drawings.
[0020] This disclosure may be described with reference to plan and / or cross-sectional views using the ideal schematic diagrams of this disclosure. Therefore, the example illustrations may be modified according to manufacturing techniques and / or tolerances.
[0021] Where there is no conflict, the various embodiments of this disclosure and the features thereof in the embodiments may be combined with each other.
[0022] The terminology used in this disclosure is for the purpose of describing particular embodiments only and is not intended to limit the disclosure. The term "and / or" as used in this disclosure includes any and all combinations of one or more of the associated enumerated entries. The singular forms "a" and "the" as used in this disclosure are also intended to include the plural forms, unless the context clearly indicates otherwise. The terms "comprising," "made of," etc., as used in this disclosure specify the presence of the stated feature, integral, step, operation, element, and / or component, but do not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components, and / or groups thereof.
[0023] Unless otherwise specified, all terms used in this disclosure (including technical and scientific terms) have the same meaning as commonly understood by one of ordinary skill in the art. It will also be understood that terms such as those defined in commonly used dictionaries should be interpreted as having a meaning consistent with their meaning in the context of the relevant art and this disclosure, and will not be interpreted as having an idealized or overly formal meaning, unless expressly so defined in this disclosure.
[0024] This disclosure is not limited to the embodiments shown in the accompanying drawings, but includes modifications to the configuration based on the manufacturing process. Therefore, the areas illustrated in the drawings are schematic, and the shapes of the areas shown illustrate specific shapes of areas of an element, but are not intended to be limiting.
[0025] This disclosure provides a method for generating corpus data from structured raw data. The method automatically generates corresponding target data based on structured raw data, so as to generate corpus sample data for training a Large Language Model (LLM) based on the raw data and target data. The corpus sample data includes the raw data and its corresponding target data, whereby the target data is the data generated based on the LLM. In this disclosure, the raw data includes, but is not limited to, structured data from the communications domain.
[0026] Figure 1 This is a flowchart illustrating the method for generating corpus of structured data provided in this embodiment of the disclosure, as shown below. Figure 1 As shown, the method for generating the corpus of structured data includes the following steps:
[0027] Step S11: Obtain the target example and the original data, where the target example is an annotated example and the original data is structured data.
[0028] In this step, one or more examples are selected from a pre-defined example library as target examples. These expert-annotated target examples can serve as a reference for the corpus samples generated by the large language model, ensuring the quality of the corpus sample data generated by the large language model.
[0029] Step S12: Generate prompt words corresponding to the original data based on the target example.
[0030] The prompt words are used to generate target data from the corpus sample data. In this step, prompt words that match the original data are generated by referring to the content of the target example. For example, the prompt words may include: the original data, task description, output requirements, etc.
[0031] Step S13: Using a pre-set large language model, target data corresponding to the original data is obtained according to the prompt word instructions. The target data is used to generate corpus sample data.
[0032] In this step, the prompt word instruction is input into the preset large language model, which then generates and outputs the corresponding target data according to the content of each part of the prompt word instruction. The target data can be used together with the original data to generate corpus sample data.
[0033] The method for generating corpus data from structured data in this embodiment includes: acquiring target examples and original data, where the target examples are annotated examples and the original data is structured data; generating prompt word instructions corresponding to the original data based on the target examples; obtaining target data corresponding to the original data based on the prompt word instructions using a preset large language model, and using the target data to generate corpus sample data; this embodiment utilizes expert-annotated examples to generate prompt word instructions corresponding to structured original data, and generates target data based on the prompt word instruction fields using a preset large language model, so as to generate corpus sample data corresponding to the original data based on the target data; combining a small number of high-quality expert-annotated examples with the powerful generation capability of a large language model, it can automatically generate high-quality corpus sample data in large batches, reducing the human cost of corpus generation while ensuring corpus quality.
[0034] In some embodiments, after obtaining the target data corresponding to the original data according to the prompt word instruction through a preset large language model, and using the target data to generate corpus sample data (i.e., step S13), the corpus generation method of the structured data may further include the following steps:
[0035] Step S14: Generate corpus sample data based on the original data and target data.
[0036] In some embodiments, generating corpus sample data based on the original data and target data (i.e., step S14) may include the following steps: extracting text information from the target data according to preset rules, and generating corpus sample data based on the original data and text information.
[0037] Using rule matching, the corresponding text information is extracted from the target data obtained in step S13, and the original data and the text information are bound together to form corpus sample data. Preset rules can be set according to the output requirements in the prompt words. For example, assuming the target data is "Question: xxxxx", the text information extracted from the target data is the "xxxxx" text information after the colon.
[0038] In some related technologies, corpus sample data is generated based on predefined rules. Specifically, predefined templates are used to fill the fields and corresponding values of structured data into the predefined templates to generate corpus sample data. This method of corpus generation is not very flexible, the generated corpus sample data is monotonous, and the model trained based on this corpus sample data has poor generalization ability, which seriously affects the model's ability.
[0039] To address the aforementioned issues, some embodiments of this disclosure increase the diversity of the corpus sample data by randomly selecting target examples. Therefore, in some embodiments, obtaining target examples includes: randomly sampling target examples from a preset example library. Selecting target examples through random sampling increases the randomness and diversity of the prompt word instructions, thereby ensuring the richness of the corpus sample data and enhancing the model's generalization ability.
[0040] In some embodiments, the preset example library includes at least one of the following: a preset overall description example library, a preset field question and answer example library, and a preset thought chain example library; the target example includes at least one of the following: a target description example, a target question and answer example, and a target thought chain example; the prompt word instruction includes at least one of the following: an overall description prompt word instruction, a field question and answer prompt word instruction, and a thought chain prompt word instruction; the target data includes at least one of the following: overall description data, field question and answer data at each level of the original data, and thought chain data.
[0041] Accordingly, in some embodiments, the step of randomly sampling the target example from a preset example library includes at least one of the following:
[0042] Target description examples are obtained by randomly sampling from a pre-defined overall description example library;
[0043] Target question and answer examples are randomly sampled from a pre-defined field question and answer example library;
[0044] Target mind chain examples are obtained by randomly sampling from a pre-defined mind chain example library.
[0045] Accordingly, in some embodiments, the step of generating prompt word instructions corresponding to the original data based on the target example (i.e., step S12) includes at least one of the following:
[0046] Generate overall description prompts for the original data based on the target description example;
[0047] Generate field-specific question-and-answer prompts for the original data based on the target question-and-answer example;
[0048] Generate mind chain prompts corresponding to the original data based on the target mind chain example.
[0049] Accordingly, in some embodiments, obtaining the target data corresponding to the original data based on the prompt word instruction through a preset large language model (i.e., step S13) includes at least one of the following:
[0050] By using a pre-set large language model, the overall description data corresponding to the original data is obtained based on the overall description prompt words;
[0051] By using a pre-defined large language model, the field question and answer data at each level of the original data are obtained according to the field question and answer prompt words.
[0052] By using a pre-set large language model, the thought chain data corresponding to the original data is obtained based on the thought chain prompt words.
[0053] Overall description data is used to generate overall description corpus sample data, field question-and-answer data at each level of the original data is used to generate field question-and-answer corpus sample data, and thought chain data is used to generate thought chain corpus sample data.
[0054] The overall descriptive corpus sample data is a comprehensive textual description of the structured data based on the field values of the structured data. It can be used as alignment corpus in the pre-training stage of multimodal large language models to help the multimodal large language models learn structured knowledge and map structured data and natural language text to the same semantic space.
[0055] The sample data of the field question-and-answer corpus at each level of the original data consists of question-and-answer pairs for each level of the structured data. Since structured data contains a rich hierarchical structure, the sample data of the field question-and-answer corpus can be used as training data in the supervised fine-tuning stage of the multimodal large language model, helping the large language model understand the hierarchical structural information of the structured data and enhancing the large language model's instruction following and task processing capabilities.
[0056] The sample data of the thinking chain corpus is used to provide the "thinking" process of the large language model while answering questions, which helps the large language model to acquire complex reasoning ability and enhance its task processing ability in complex scenarios.
[0057] To generate multimodal corpus sample data, in this embodiment of the disclosure, the preset example library may include a preset overall description example library, a preset field question-and-answer example library, and a preset thought chain example library. Correspondingly, the target examples may include target description examples, target question-and-answer examples, and target thought chain examples; prompt words may include overall description prompt words, field question-and-answer prompt words, and thought chain prompt words; the target data may include overall description data, field question-and-answer data at each level of the original data, and thought chain data.
[0058] Figure 2 This is a schematic diagram illustrating the generation of multimodal corpora of structured data provided in the embodiments of this disclosure, such as... Figure 2As shown, target description examples are randomly sampled from a preset overall description example library. Based on these examples, corresponding overall description prompts are generated for the original data. These prompts are then input into an LLM (Local Language Management) system, which outputs overall description data. Rule matching is used to extract the first text information from the overall description data. Overall description corpus sample data is generated based on the original data and the first text information. Similarly, target question-and-answer examples are randomly sampled from a preset field question-and-answer example library. Based on these examples, corresponding field question-and-answer prompts are generated for the original data. These prompts are then input into an LLM system, which outputs field question-and-answer data at each level of the original data. Rule matching is used to extract the second text information from the field question-and-answer data at each level of the original data. Field question-and-answer corpus sample data is generated based on the original data and the second text information. Finally, target thought chain examples are randomly sampled from a preset thought chain example library. Based on these examples, corresponding thought chain prompts are generated for the original data. These prompts are then input into an LLM system, which outputs thought chain data. Rule matching is used to extract the third text information from the thought chain data. Thought chain corpus sample data is generated based on the original data and the third text information.
[0059] Randomly sampling target examples from a pre-defined example library can improve the generalization ability of large language models; generating overall description prompts based on target description examples and generating field question-answer prompts based on target question-answer examples can improve the comprehension ability of large language models; generating thought chain prompts based on target thought chain examples can improve the reasoning ability of large language models.
[0060] In some embodiments, the overall description prompt instruction for generating overall description data may include four components: raw data, task description, output requirements, and target description example.
[0061] The "raw data" provides the basic information needed to generate the overall description data. By filling in the raw data, the large language model can generate the overall description data based on the filled data, ensuring that the large language model has clear references when generating the overall description data and avoiding guesswork.
[0062] The “task description” clarifies the specific task that the large language model needs to complete, namely, to provide an overall professional descriptive text based on the raw data. This part is designed to make the large language model clear about its goal and avoid generating irrelevant content or deviating from the task requirements.
[0063] The “output requirements” further refine the standards for generating overall descriptive data. In this embodiment, the standards are mainly considered from five factors: content consistency, language professionalism, numerical interpretation, determinism, and scene adaptability. Regarding content consistency, ensure that the generated content does not conflict with the context, and that numerical values are completely consistent to avoid errors or contradictions. Regarding language professionalism, the text must be coherent and professional. Regarding numerical interpretation, since the numerical values of some types of raw data (such as signaling data) do not inherently possess meaning, the underlying mapping relationships are what truly matter. High-quality corpora should convey these mapping relationships rather than simply the numerical values themselves. Therefore, if numerical values are involved, their represented tendencies or meanings must be clearly defined to avoid vague expressions. Regarding certainty, the use of uncertain words such as "maybe" is prohibited to ensure the authority and accuracy of the text. Regarding scenario adaptability, for certain types of raw data, if they are derived from data to be decoded, considering that the user input will not include the phrase "decoding result," and that the large language model generates corpora based on the decoding result, the generated text corpus might contain the phrase "decoding result" without constraints. This does not match the real-world scenario, so the output should avoid such phrases. For example, the output requirements for overall description prompts may include the following:
[0064] (1) Consistency requirement: The content must not conflict with the original data, and the values must be completely consistent with the original data;
[0065] (2) Language professionalism requirements: The language should be coherent and professional;
[0066] (3) Numerical interpretation requirements: If the output text contains numerical values, please clearly explain the tendencies that the values represent;
[0067] (4) Certainty requirement: Avoid using words such as "similar" or "possibly";
[0068] (5) Scene adaptability requirements: Do not include words related to "decoding result" in the generated overall description data.
[0069] The "target description example" randomly samples a complete description text from the preset overall description example library to provide a reference for the corpus generated by the large language model, and also ensures the quality of the overall description data generated by the large language model. At the same time, the random sampling operation also ensures that the target description examples in the overall description prompt words have a certain degree of randomness, further ensuring the richness of the generated overall description data and overall description corpus sample data.
[0070] For example, the instruction to generate the overall description prompt words corresponding to the original data based on the target description example is as follows:
[0071] #Decoding result
[0072] {}
[0073] #Task Description
[0074] Based on the given decoding results, provide a professional descriptive text for the entire signaling message.
[0075] #Output Requirements
[0076] 1. The content must not conflict with the given decoding result, and the value must be completely consistent with the decoding result;
[0077] 2. The language is coherent and professional;
[0078] 3. If the output text contains numerical values, please clearly explain the meaning of the values.
[0079] 4. Avoid using words like 'may';
[0080] 5. Since user input does not provide decoding results, the generated results should not include any terms related to "decoding results." It should be assumed that the user only inputs the raw signaling bitstream and the question.
[0081] #Example of target description
[0082] In this communication interaction, a typical 5G core network scenario was observed, involving the interaction between User Equipment (UE) and Network Function (NF). Specifically, the UE communicates with the network through a 3GPP access type (such as 5G NR) to request the establishment or modification of a PDU session. This process is carried over the TCP / IP protocol stack via the HTTP / 2 protocol, using IPv6 as the network layer protocol, demonstrating a typical communication flow in the control plane of a 5G network.
[0083] In the first frame, the UE sends a P0ST request to the network with the target URL / npcf-smpolicycontrol / vl / sm-policies, requesting the establishment or modification of a session management policy. The request contains rich information, such as pdusesionType being IPv4v6, meaning the UE requests a session supporting both IPv4 and IPv6; accessType being 3GPP ACCESS, indicating the UE accesses the network via 3GPP; ratType being NR, indicating the UE accesses the network via 5G NR; and ueTimezone being +88:00, indicating the UE's time zone is UTC+8. subsSessAmbr defines the maximum uplink and downlink session bit rates of 75Mbps and 300Mbps respectively, used for QoS management. qosFlowUsage being GENERAL indicates that the QoS stream is used for general data transmission.
[0084] In the second frame, the network (SMF) responded to the UE's request, returning an HTTP status code 40 (Bad Request), indicating an error or unrecognized part of the request. The response included error information, specifically the value of the cause field being USER UNKNOMW, meaning the network failed to recognize the UE, and the UE's identification information was unknown or invalid in the current network. This entire interaction demonstrates the complexity and granularity of control plane communication in 5G networks, involving multiple aspects such as user identity management, session management, OoS policies, and error handling.
[0085] In some embodiments, the field question-and-answer prompt instructions for generating field question-and-answer data at each level of the raw data may include five components: raw data, task description, output requirements, target fields, and target question-and-answer examples.
[0086] "Raw data" ensures that the question-and-answer data at each level of the generated raw data is based on real and specific data, avoiding guesswork.
[0087] The "Task Description" clarifies the task requirements for generating field question-and-answer data (i.e., question-and-answer pairs) at each level of the original data. It describes in detail the task of generating field question-and-answer data at each level of the original data. For example, the "Task Description" can be: "Based on the above original data and the fields involved, please generate a batch of field question-and-answer pairs related to communication services (such as network operation and maintenance, fault detection, traffic monitoring, etc.). Each question and answer corresponds to a specific protocol field or business scenario in the fields involved. The answers should be based on the original data."
[0088] The "Output Requirements" section details the specific requirements for the generated question-and-answer pairs. Some requirements are consistent with the "Output Requirements" in the overall description prompt instruction. In addition, considering that the illusion phenomenon of large language models gradually intensifies with increasing context length, the number of generated question-and-answer pairs is limited to only 5 pairs. Furthermore, to facilitate batch extraction of text information from the question-and-answer pairs later, strict requirements are placed on the format of the generated pairs; they must be output according to the specified format. For example, the output requirements of the field question-and-answer prompt instruction may include the following:
[0089] (1) Consistency requirement: Each set of questions and answers corresponds to the field value, analyzes the characteristics of the original data, the content does not conflict with the original data, and the value must be completely consistent with the original data;
[0090] (2) Language professionalism requirements: The language should be coherent and professional;
[0091] (3) Quantity requirement: Generate 5 similar question-and-answer pairs. The questions should be specific and clear, and the answers should be directly extracted from the original data.
[0092] (4) Format requirements: Please strictly follow the format of the target question and answer example and do not add any extra content;
[0093] (5) Certainty requirement: Avoid using words such as "similar" or "possibly";
[0094] (6) Scene adaptability requirement: The generated question-and-answer pairs should not contain words related to "decoding result".
[0095] The “Target Fields” section provides the fields that need to be considered, ensuring that the question-answer pairs generated by the large language model are diverse.
[0096] The “Target Question and Answer Example” sampled 5 sets of question and answer pairs from the preset field question and answer example library.
[0097] For example, the instruction to generate field question-and-answer prompts for the original data based on the target question-and-answer example is as follows:
[0098] #Decoding result
[0099] {}
[0100] #Target field:{}
[0101] #Task Description
[0102] Based on the signaling data decoding results and target fields above, please generate a batch of question-and-answer pairs related to communication services (such as network operation and maintenance, fault detection, traffic monitoring, etc.). Each question and answer corresponds to a specific protocol field or business scenario in the relevant fields.
[0103] #Output Requirements:
[0104] 1. For each set of questions and answers, the signaling data characteristics should be analyzed based on the field values. The content should not conflict with the given decoding results, and the values must be completely consistent with those in the decoding results.
[0105] 2. The language is coherent and professional;
[0106] 3. Generate 5 similar question-and-answer sets, no more than 5 sets. The questions should be specific and clear, and the answers should be directly extracted from the self-decoding results.
[0107] 4. Please strictly follow the output format in the example and do not add any extra content;
[0108] 5. Avoid using words like 'may';
[0109] 6. Since user input will not provide decoding results, the generated question-and-answer pairs should not contain words related to "decoding". It is necessary to assume that the user only inputs the raw signaling bitstream and the question.
[0110] #Example of target question and answer:
[0111] Question: What transport protocol is used for this signaling?
[0112] Answer: This signaling uses the <protocol type> protocol.
[0113] Question: What is the HTTP / 2 request method in this signaling?
[0114] Answer: The HTTP / 2 request method in this signaling is <request method>.
[0115] Question: Is the "Push" flag set in the signaling?
[0116] Answer: Yes, the TCP flag in the signaling is set to "Push".
[0117] Question: What protocol stack is used in this frame of data?
[0118] Answer: The protocol stack used by this frame data includes Ethernet, IPv6, TCP, HTTP / 2, and JSON.
[0119] Question: What is the content type of an HTTP / 2 frame?
[0120] Answer: The content type of the HTTP / 2 frame is application / json.
[0121] In some embodiments, the step of generating prompt word instructions corresponding to the original data based on the target example (step S12) includes the following steps:
[0122] Step S121: Obtain the field library based on the fields of the original data.
[0123] In this step, the fields of the original data are extracted, and a field library is generated based on each field.
[0124] Step S122: Randomly sample the field library to obtain the target field.
[0125] Step S123: Generate field question-and-answer prompt instructions corresponding to the original data based on the target field and the target question-and-answer example.
[0126] By randomly sampling target fields from the field library and generating prompt words corresponding to the original data based on the target fields, the question-answer pairs generated by the large language model can be guaranteed to be diverse.
[0127] In some embodiments, the thought chain prompt instructions used to generate thought chain data may include five components: raw data, task description, output requirements, reasoning results, and target thought chain example.
[0128] The "raw data" is the same as the raw data in the overall description prompt words and field question and answer prompt words. By filling in the raw data, the filled data serves as the factual basis for generating the mind chain data by the large language model, ensuring the factuality and authenticity of the mind chain data.
[0129] "Inference results" include intermediate results and final results, ensuring the accuracy of the thought chain data; for example, for raw data of signaling type, the interface type and process type of the signaling are filled in as intermediate results and final results of the thought chain data;
[0130] "Task Description" is the task description information for generating mind chain data. For example, the task description of the mind chain prompt instruction can be: "Based on the given raw data, please generate a question-and-answer pair to ask and answer the raw data. The answer should include detailed reasoning steps."
[0131] The "Output Requirements" are consistent with those in the overall description prompt and field question-and-answer prompt instructions. In addition, a new requirement related to thought chains is added. This requires the large language model to deduce step-by-step, ensuring that the thought chain data generated by the large language model includes reasoning steps, and is output in the form of a thought chain. For example, the output requirements of the thought chain prompt instruction include the following:
[0132] (1) Mind chain requirements: The generated answers are required to organize the language in the CoT (mind chain) way. Taking the original data as signaling data as an example, that is, how to deduce the process type of the signaling step by step based on the content contained in the original signaling code stream.
[0133] (2) Consistency requirement: The content must not conflict with the original data, and the values must be completely consistent with the original data;
[0134] (3) Language professionalism requirements: The language should be coherent and professional;
[0135] (4) Scene Adaptability Requirements: The generated question-and-answer pairs should not contain words related to "decoding results". It is necessary to assume that the user only inputs the original data and the question, so the thought process contained in the generated answer should not involve reasoning based on "decoding results". The reasoning process can be expressed as "Based on the original data, we know xxx".
[0136] (5) Certainty requirement: Avoid using words like "may";
[0137] (6) Format requirements: Please strictly follow the format in the example and do not add any extra content.
[0138] The "Target Thinking Chain Example" randomly samples a thinking chain from the preset thinking chain example library.
[0139] For example, the instructions for generating mind chain prompts corresponding to the original data based on the target mind chain example are as follows:
[0140] #Decoding result
[0141] {}
[0142] #Reasoning Result
[0143] <1> Interface type: {}
[0144] <2> Process type: {}
[0145] #Task Description
[0146] Based on the information provided above, please generate a question-and-answer pair to query and answer the original signaling flow type. The answer should include detailed reasoning steps.
[0147] #Output Requirements
[0148] 1. The generated answers are required to be organized using the CoT (CoT) method, that is, how to deduce the process type to which the signaling belongs step by step based on the content contained in the original signaling code stream;
[0149] 2. The content must not conflict with the given decoding result, and the value must be completely consistent with the decoding result;
[0150] 3. The language is coherent and professional;
[0151] 4. Since user input does not provide decoding results, the generated question-and-answer pairs should not contain words related to "decoding". It is necessary to assume that the user inputs the original signaling code stream and the question. Therefore, the thought process contained in the generated answer should not involve reasoning based on "decoding results". The reasoning process can be expressed as "According to the signaling data, we know xxx".
[0152] 5. Avoid using words like 'may';
[0153] 6. Please strictly follow the output format in the example and do not add any extra content.
[0154] #Example of the Goal-Oriented Thinking Chain
[0155] Question: What type of process does this signaling belong to?
[0156] Answer: Based on the signaling data, we can deduce the flow type of the signaling through the following steps:
[0157] 1. Interface Type Identification: First, the interface type used can be determined by the header information of the signaling data packet. Based on the protocol type and data transmission method in the signaling, it can be inferred that this is an S10 interface type. The S10 interface is used to carry management and control signaling in the core network and is commonly used for signaling interaction of the STP protocol.
[0158] 2. Signaling Protocol Analysis: Next, we see that the signaling data includes the GTP protocol, and the "message type" field is marked in the GTP data packet. This is key to analyzing the process type. The GTP protocol is a common protocol used for data transmission and control signaling in mobile communication networks, and the message type it typically carries can help identify the process type.
[0159] 3. Message Type Determination: The "message Type" field value extracted from the signaling indicates that this is an "Echo Request" type message. Echo Request messages are a standard message type in the GTP protocol, typically used for connectivity testing between network components, i.e., a request-response function.
[0160] 4. Process type deduction: Based on the above information and the "Echo Request" message type of GTP, it can be deduced that this signaling belongs to the Echo Request process.
[0161] In summary, this signaling belongs to the Echo Request process.
[0162] In some embodiments, before generating the prompt word instruction corresponding to the original data based on the target example (i.e., step S12), the corpus generation method for structured data may further include the following steps: when the original data is data of a preset type, decoding the data to be decoded corresponding to the original data to obtain the original data.
[0163] Taking signaling data as an example, in this step, the signaling to be decoded is decoded to obtain the decoding result, which is the original data. Specifically, tools such as Wireshark can be used to decode the signaling to be decoded. It should be noted that the embodiments of this disclosure are not limited to signaling data, and are equally applicable to other types of data in the field of communication, such as traffic data. The original data is also not limited to data in the field of communication; structured data from any field are equally applicable.
[0164] For example, the signaling to be decoded is:
[0165] 10 00 00 00 64 99 00 00 00 04 31 86 44 6c 00 00 00 00 58 84f9 24 0881 60 85 00 00 00 00 00 00 08 00 00 00 02 24 08 81 10 80ff ff 10 01 08ff 0600 0000 01 96 0c 96 0c 08 27 09c7 c2 12….
[0166] The following decoding result is obtained through signaling decoding:
[0167] UserSN=0
[0168] [Node:1][PreNode:0][IeId:54801]Frame 0:499bytes on wire(3992bits),499bytes captured
[0169] (3992bits)[0:3992]
[0170] [Node:2][PreNode:1][IeId:54853]Encapsulation type:Ethernet(1)[0:0]
[0171] [Node:3][PreNode:1][IeId:54811]Frame Number:0[0:0]
[0172] [Node:4][PreNode:1][IeId:54812]Frame Length:499bytes(3992bits)[0:0]
[0173] [Node:5][PreNode:1][IeId:54813]Capture Length:499bytes(3992bits)[0:0]
[0174] [Node:6][PreNode:1][IeId:54818][Frame is marked:False][0:0]
[0175] [Node:7][PreNode:1][IeId:54819][Frame is ignored:False][0:0]
[0176] [Node:8][PreNode:1][IeId:54820][Protocols in frame:eth:ethertype:ipv6.udp.pfcp][0:0]
[0177] The decoding result is used as raw data to generate overall description prompts, field question-and-answer prompts, and thought chain prompts.
[0178] This disclosure proposes a method for generating multimodal corpora based on a large language model and structured data. By randomly sampling and injecting a small number of high-quality text example seeds into various types of prompt word instructions, high-quality multimodal corpora are generated in batches, addressing the problems of scarce and low-quality multimodal corpora. This disclosure inputs the original structured data, in context, along with the designed prompt word instructions, into a large language model. Leveraging the powerful semantic understanding and text generation capabilities of the large language model, high-quality multimodal corpora are generated on a large scale.
[0179] This disclosure presents three types of prompt word instructions designed for the entire training process of multimodal models in the communication field, covering the entire training process. By randomly sampling examples, the randomness and diversity of the prompt word instructions are increased, ensuring the richness of the generated multimodal corpus. It solves the problem that expert-annotated corpus sample data is difficult to generate in large quantities, enabling automated large-scale generation of multimodal corpus of structured communication data; it also addresses the problem of monotonous corpus generation based on predefined rules, improving the diversity of corpus samples; and by combining a small number of high-quality text examples with prompt word instructions, high-quality communication multimodal corpus sample data can be generated.
[0180] This disclosure also provides an electronic device, such as... Figure 3 As shown, it includes a memory 1 and a processor 2; the memory 1 stores a computer program that can be executed by the processor 2, and when the computer program is executed by the processor, it implements any of the structured data corpus generation methods of the present disclosure embodiments.
[0181] Among them, processor 2 is a device with data processing capabilities, including but not limited to a central processing unit (CPU); memory is a device with data storage capabilities, including but not limited to random access memory (RAM, more specifically SDRAM, DDR, etc.), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory (FLASH); I / O interface (read-write interface) is connected between processor and memory, enabling information exchange between memory 1 and processor 2, including but not limited to data bus (Bus).
[0182] This disclosure also provides a computer-readable medium having a computer program stored thereon, wherein the computer program, when executed by the processor, implements any of the structured data corpus generation methods of this disclosure.
[0183] This disclosure also provides a computer program product, which includes a computer program that, when executed by a processor, implements any of the structured data corpus generation methods of this disclosure.
[0184] Among them, the processor is a device with data processing capabilities, including but not limited to the central processing unit (CPU); the memory is a device with data storage capabilities, including but not limited to random access memory (RAM, more specifically SDRAM, DDR, etc.), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), and flash memory (FLASH); the I / O interface (read-write interface) is connected between the processor and the memory, enabling information exchange between the memory and the processor, including but not limited to the data bus (Bus).
[0185] Those skilled in the art will understand that all or some of the steps, systems, and devices disclosed above, as functional modules / units, can be implemented as software, firmware, hardware, or suitable combinations thereof.
[0186] In hardware implementations, the division between functional modules / units mentioned in the above description does not necessarily correspond to the division of physical components; for example, a physical component may have multiple functions, or a function or step may be executed by several physical components working together.
[0187] Some or all of the physical components may be implemented as software executed by a processor, such as a central processing unit (CPU), digital signal processor, or microprocessor, or as hardware, or as an integrated circuit, such as an application-specific integrated circuit (ASIC). Such software may be distributed on a computer-readable medium, which may include computer storage media (or non-transitory media) and communication media (or transient media). As is known to those skilled in the art, the term computer storage media includes volatile and non-volatile, removable and non-removable media implemented in any method or technique for storing information (such as computer-readable instructions, data structures, program modules, or other data). Computer storage media include, but are not limited to, random access memory (RAM, more specifically SDRAM, DDR, etc.), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory (FLASH) or other disk storage; read-only optical disc (CD-ROM), digital versatile disc (DVD) or other optical disc storage; magnetic cartridges, magnetic tapes, disk storage or other magnetic storage; and any other media that can be used to store desired information and can be accessed by a computer. Furthermore, as is known to those skilled in the art, communication media typically contain computer-readable instructions, data structures, program modules, or other data in modulated data signals such as carrier waves or other transmission mechanisms, and may include any information delivery medium.
[0188] This disclosure has disclosed exemplary embodiments, and although specific terminology has been used, it is for general illustrative purposes only and should not be construed as limiting. In some instances, it will be apparent to those skilled in the art that features, characteristics, and / or elements described in conjunction with particular embodiments may be used alone, or in combination with features, characteristics, and / or elements described in conjunction with other embodiments, unless otherwise expressly indicated. Therefore, those skilled in the art will understand that various changes in form and detail may be made without departing from the scope of this disclosure as set forth by the appended claims.
Claims
1. A method for generating a corpus of structured data, comprising: Obtain target examples and raw data, wherein the target examples are labeled examples and the raw data are structured data; Generate prompt words corresponding to the original data based on the target example; By using a pre-defined large language model, target data corresponding to the original data is obtained according to the prompt word instructions, and the target data is used to generate corpus sample data.
2. The method according to claim 1, wherein, The example of obtaining the target includes: Target examples are obtained by randomly sampling from a preset example library.
3. The method according to claim 2, wherein, The preset example library includes at least one of the following: a preset overall description example library, a preset field question-and-answer example library, and a preset thought chain example library; the target example includes at least one of the following: a target description example, a target question-and-answer example, and a target thought chain example; the random sampling of the target example from the preset example library includes at least one of the following: The target description example is obtained by randomly sampling from the preset overall description example library; The target question-and-answer example is obtained by randomly sampling from the preset field question-and-answer example library; The target mind chain example is obtained by randomly sampling from the preset mind chain example library.
4. The method according to claim 1, wherein, The target example includes at least one of the following: target description example, target question and answer example, target thought chain example; the prompt word instruction includes at least one of the following: overall description prompt word instruction, field question and answer prompt word instruction, thought chain prompt word instruction; the prompt word instruction for generating the original data based on the target example includes at least one of the following: Generate the overall description prompt word instruction corresponding to the original data based on the target description example; Generate the field question-and-answer prompt instructions corresponding to the original data based on the target question-and-answer example; Generate the thought chain prompt instruction corresponding to the original data based on the target thought chain example.
5. The method according to claim 4, wherein, The overall description prompt includes: the original data, task description, output requirements, and example of the target description.
6. The method according to claim 4, wherein, The field question-and-answer prompt instructions include: the original data, task description, output requirements, target field, and target question-and-answer example.
7. The method according to claim 6, wherein, The step of generating the field question-and-answer prompt word instruction corresponding to the original data based on the target question-and-answer example includes: A field library is obtained based on the fields of the original data; The target field is obtained by randomly sampling the field library; Based on the target field and the target question-and-answer example, generate field question-and-answer prompt instructions corresponding to the original data.
8. The method according to claim 4, wherein, The thought chain prompts include: the original data, task description, output requirements, reasoning results, and the target thought chain example.
9. The method according to claim 1, wherein, The target data includes at least one of the following: overall description data, field question-and-answer data at each level of the original data, and thought chain data; the prompt word instructions include at least one of the following: overall description prompt word instructions, field question-and-answer prompt word instructions, and thought chain prompt word instructions; obtaining the target data corresponding to the original data based on the prompt word instructions through a preset large language model includes at least one of the following: By using a preset large language model, the overall description data corresponding to the original data is obtained according to the overall description prompt word instruction; By using a pre-defined large language model, the question-and-answer data for each level of the original data is obtained according to the field question-and-answer prompt words. By using a pre-defined large language model, the thought chain data corresponding to the original data is obtained based on the thought chain prompt word instructions.
10. The method according to any one of claims 1-9, wherein, After obtaining the target data corresponding to the original data based on the prompt word instruction using a preset large language model, the process further includes: Based on the original data and the target data, corpus sample data is generated.
11. The method according to claim 10, wherein, The step of generating corpus sample data based on the original data and the target data includes: Text information is extracted from the target data according to preset rules; Based on the original data and the text information, corpus sample data is generated.
12. An electronic device comprising a memory and a processor; the memory storing a computer program executable by the processor, wherein the computer program, when executed by the processor, implements the corpus generation method for structured data as described in any one of claims 1 to 11.
13. A computer-readable medium having a computer program stored thereon, which, when executed by a processor, implements the corpus generation method for structured data according to any one of claims 1 to 11.
14. A computer program product comprising a computer program that, when executed by a processor, implements the corpus generation method for structured data as described in any one of claims 1 to 11.
