Training data generation method and device, equipment and storage medium
By analyzing and identifying original teaching data and unstructured knowledge acquisition and compilation processing, combined with intent recognition models and large model tools, training data is automatically generated and adjusted, solving the problems of low efficiency and poor quality in the existing technology, and achieving high efficiency, Accurate training data generation to adapt to business changes.
Patent Information
- Application Number
- CN202410875032.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-01
- Publication Date
- 2024-10-18
AI Technical Summary
In the existing technology, manually constructing simulation training data is inefficient and of poor quality, and cannot quickly adapt to changes in frontline business, resulting in the need for frequent updates of simulation training courses.
By parsing and identifying the original teaching data, dense vector representations and sparse representations are generated, and the intent recognition model and large model tools are used to automatically retrieve and generate training data. Users can interactively adjust it until it matches the intent.
It improves the efficiency and quality of training data generation, can quickly adapt to business changes, saves training manpower and time costs, and ensures the fit between data and user intentions.
Smart Images

Figure CN118798337A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of artificial intelligence technology, in particular to the field of business training technology, and specifically to a training data generation method, device, equipment and storage medium. Background Art
[0002] Compared with traditional training courses, simulation training is more widely used in some front-line business areas. Simulation training is closer to the actual process of front-line business and pays more attention to the participation and practice of trainees. Therefore, it is often necessary to build simulation training courses suitable for front-line business.
[0003] At present, in the prior art, the method of constructing simulation courses is generally based on manual construction, that is, the training personnel manually compile the training according to various forms of original training materials such as product manuals and terms and conditions documents to obtain training data that can be used for simulation training.
[0004] However, the inventors have discovered that the prior art has at least the following technical problems: with the updating of business and the increase in business types, front-line business will frequently change, and the simulation training courses of these front-line businesses will also need to change accordingly. Therefore, the manual construction of training data will result in low efficiency and poor quality of the generated training data. Summary of the invention
[0005] The embodiments of the present application provide a training data generation method, apparatus, device and storage medium, which are used to solve the problem of low efficiency when manually constructing training data and poor quality of generated training data.
[0006] In a first aspect, an embodiment of the present application provides a training data generation method, which is applied to a server, comprising:
[0007] Acquire original training teaching data, and perform parsing and identification processing on the original training teaching data to obtain to-be-processed files of various file format types;
[0008] Perform unstructured knowledge collection and editing on each file to be processed, generate dense vector representation for knowledge segmentation and sparse representation of knowledge keywords, and store them in a preset knowledge base;
[0009] In response to an interactive operation performed by a user through a preset large model tool, obtaining user description data;
[0010] Input the user description data into the intention recognition model to obtain target intention data, and input the target intention data into the pre-stored large model tool to extract the target prompt template from the preset course template library;
[0011] Performing a search process on the preset knowledge base according to the user description data, so as to retrieve the knowledge required for the training data from the preset knowledge base through a multi-way recall rearrangement strategy;
[0012] Input the knowledge required for the training data and the target prompt template into the pre-stored large model tool to obtain the data to be adjusted, and display the data to be adjusted for viewing by the user;
[0013] In response to the interactive operation performed by the user through the preset large model tool after viewing the data to be adjusted, the adjusted user description data is obtained, and the process jumps to the step of inputting the user description data into the intent recognition model to obtain the target intent data, so as to adjust the data to be adjusted and output the target training data.
[0014] In a possible implementation, the original teaching data for training includes multiple formal materials; accordingly, the original teaching data for training is parsed and identified to obtain files to be processed of multiple file format types, including: determining the file format of each formal material according to each formal material; determining a pre-stored parsing strategy corresponding to the target file format according to the target file format; performing format parsing on the formal material according to the pre-stored parsing strategy and based on the pre-stored parsing strategy to obtain a format parsed file; returning to the step of determining the file format of each formal material according to each formal material until each formal material in the original teaching data is format parsed to obtain all format parsed files; identifying and classifying all format parsed files to obtain files to be processed of multiple file format types.
[0015] In a possible implementation, all the format parsed files are subjected to secondary parsing processing to obtain to-be-processed files of various file layout types, including: determining the layout type of the format parsed file according to each format parsed file; marking the format parsed file as a to-be-processed file of a file layout type according to the layout type; until all the format parsed files are marked to obtain to-be-processed files of various file layout types, wherein the file layout types include clause type, description type and text type.
[0016] In a possible implementation, the unstructured knowledge collection and editing process is performed on each file to be processed, and a dense vector representation of block knowledge and a sparse representation of knowledge keywords are generated and stored in a preset knowledge base, including: for each different file format type of file to be processed, a semantic segmentation model combined with a customized regular expression knowledge segmentation strategy is used to perform block processing on the file to be processed of each file format type to obtain block knowledge; a dense vector representation of the block knowledge is generated based on a semantic vectorization model for the block knowledge, and the block knowledge is synchronously extracted to obtain a sparse representation of knowledge keywords of the block knowledge; and the dense vector representation and sparse representation of each block knowledge are stored in a preset knowledge base.
[0017] In a possible implementation, the preset course template library is a prompt template pre-constructed by a training course instructor, wherein the construction process of the prompt template includes: responding to the course design operation of the training course instructor to determine at least one course link of each standardized training course and the interactive data configuration required for each course link according to different course types, and obtaining multiple initial course templates; testing each initial course template, and determining all initial course templates that have passed the test as prompt templates.
[0018] In a possible implementation, the retrieval processing of the preset knowledge base according to the user description data is performed to retrieve the knowledge required for training data from the preset knowledge base through a multi-way recall rearrangement strategy, including: performing vector conversion processing on the user description data to obtain description vector data, and performing vector retrieval processing from the preset knowledge base through a vector retrieval method to obtain multiple first required block knowledge, wherein the dense vector representation of the first required block knowledge and the description vector data have a matching degree greater than a first threshold; determining description keywords according to the user description data, and performing keyword retrieval processing from the preset knowledge base through a keyword retrieval method to obtain multiple second required block knowledge, wherein the sparse representation of the knowledge keywords of the second required block knowledge and the description keywords have a matching degree greater than a second threshold; inputting the multiple first required block knowledge and the multiple second required block knowledge into a rearrangement model together to obtain at least one first required block knowledge whose dense vector representation and the description vector data are ranked in a front preset position in matching degree and / or a second required block knowledge whose sparse representation of the knowledge keywords and the description keywords are ranked in a front preset position in matching degree, and determine them as the knowledge required for training data.
[0019] In a possible implementation, after displaying the data to be adjusted for viewing by a user, the method further includes: in response to a confirmation operation of the user, directly determining the data to be adjusted as target training data and outputting the target training data.
[0020] In a second aspect, an embodiment of the present application provides a training data generating device, which is applied to a server, including:
[0021] An acquisition module is used to acquire original training teaching data, and parse and identify the original training teaching data to obtain to-be-processed files of various file format types;
[0022] The knowledge collection and editing module is used to collect and edit unstructured knowledge for each file to be processed, generate dense vector representations for knowledge segmentation and sparse representations of knowledge keywords, and store them in a preset knowledge base;
[0023] An interactive module, for obtaining user description data in response to an interactive operation performed by a user through a preset large model tool;
[0024] A template extraction module, used for inputting the user description data into an intention recognition model to obtain target intention data, and inputting the target intention data into a pre-stored large model tool to extract a target prompt template from a preset course template library;
[0025] A knowledge retrieval module, used to perform retrieval processing on the preset knowledge base according to the user description data, so as to retrieve the knowledge required for training data from the preset knowledge base through a multi-way recall rearrangement strategy;
[0026] A training data generation module, used for inputting the knowledge required for the training data and the target prompt template into the pre-stored large model tool to obtain the data to be adjusted, and displaying the data to be adjusted for viewing by the user;
[0027] The training data generation module is also used to obtain adjusted user description data in response to the interactive operation performed by the user through the preset large model tool after viewing the data to be adjusted, and jump to the step of inputting the user description data into the intent recognition model to obtain target intent data, so as to adjust the data to be adjusted and output target training data.
[0028] In a third aspect, an embodiment of the present application provides a training data generating device, including: at least one processor and a memory;
[0029] The memory stores computer-executable instructions;
[0030] The at least one processor executes the computer-executable instructions stored in the memory, so that the at least one processor performs the training data generation method described in the first aspect above.
[0031] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer-executable instruction. When a processor executes the computer-executable instruction, the training data generation method described in the first aspect above is implemented.
[0032] The present application provides a training data generation method, device, equipment and storage medium. The method first parses and identifies the original teaching data for training to obtain files of various file version types to be processed, and then performs non-institutional knowledge collection and editing on the files to be processed, generates dense vector representations and sparse representations of knowledge keywords and stores them in a preset knowledge base, and is used for subsequent retrieval of the knowledge required for training data from the preset knowledge base through a multi-way recall rearrangement strategy. Vector retrieval can improve efficiency, and sparse representation can use as few knowledge keywords as possible to represent the original block knowledge, which helps to reduce the dimension and complexity of the data while retaining the key information of each block knowledge. Then, based on the user's interactive operation and intention recognition model, user description data representing the user's intention is obtained, and the corresponding target prompt template is selected according to the user description data, and then the knowledge required for the training data and the target prompt target are input into the preset large model tool to obtain the data to be adjusted and display it. After viewing, the user can continue to make adjustments based on the interactive operation until the target training data is output. It not only solves the problem of traditional large models generating hallucinations and difficulty in processing long documents, but also improves the fit between the generated target training data and the user's real intention, improves the accuracy of the training data while ensuring efficiency. Automatically generating training data can quickly adapt to business changes and save training manpower and time costs. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, a brief introduction will be given below to the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0034] Figure 1 A schematic diagram of an application scenario of the training data generation method provided in an embodiment of the present application;
[0035] Figure 2 A flowchart of a training data generation method provided in an embodiment of the present application;
[0036] Figure 3 A schematic diagram of the structure of a training data generating device provided in an embodiment of the present application;
[0037] Figure 4A schematic diagram of the hardware structure of a training data generating device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0038] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0039] At present, with the increasing number and demand of front-line businesses, in order to improve the level of manual business, simulation training courses will be used to train business personnel. Existing simulation training courses are generally composed of different "links", and there are multiple "dialogues" in each link to simulate the interaction in the link. Take the maternity leave for the promotion of electronic products in the front-line business as an example: these links can include "self-introduction", "demand inquiry", and "product introduction"; in the "demand inquiry" link, there may be several inquiries and answers around customer personal information. Therefore, how to inquire and obtain information that is beneficial to product promotion more quickly with the permission of the customer, all require simulation training for business personnel using simulation training courses in advance. Simulation training courses pay more attention to the participation and practice of learners. In the prior art, in addition to the method of manually constructing simulation training courses, there is also a method of recombining the real exchange data of business personnel and customers accumulated in the historical front-line business promotion process into simulation training courses. Or use a large model to directly interact with users, and extract corresponding words from these interaction processes to generate training data for simulation training.
[0040] However, the inventors found that purely manual construction of training data is time-consuming and laborious, and the training data generated by the large model may not follow the original text or be inconsistent with the facts, resulting in poor quality of the generated training data. In addition, due to the frequent changes in the number and nature of front-line business, the simulation training courses also need to change and adjust accordingly. Therefore, due to the changes in training data, whether it is manually constructed or constructed with a large model, it is impossible to take into account both the efficiency of training data generation and the quality of training data.
[0041] In order to solve the above technical problems, the embodiment of the present application provides the following technical conception to solve the problem: by parsing and identifying the original teaching materials to obtain files of various file formats, and then generating dense and sparse representations of knowledge through knowledge collection and editing, and then obtaining user description data in response to interactive operations, and obtaining target intent data based on the user description data and the intent recognition model, and then determining the target prompt template, and using the multi-way recall rearrangement strategy to retrieve the most important knowledge required for the training data, and finally injecting the knowledge required for the training data into the target prompt template based on the large model tool to obtain the data to be adjusted. If adjustment is required, the user can repeat the above operation until the training data that matches the user's intent is obtained. Not only is the generation efficiency high, but the quality of the training data is also higher.
[0042] Figure 1 A schematic diagram of an application scenario of the training data generation method provided in an embodiment of the present application, such as Figure 1 As shown, it includes: a terminal 101 and a server 102.
[0043] The terminal 101 is used for users to input the required data of business training and display the generated training data of business training. The server 102 is used to receive the original training data and user input, and generate the training data of business training and send it to the terminal for display. When the user finds that the training data of business training needs to be adjusted again, the user can interact with the big model through the terminal 101 to adjust the training data of business training again.
[0044] Figure 2 This is a flow chart of the training data generation method provided in the embodiment of the present application. The execution subject of this embodiment can be Figure 1 The server 102 in the illustrated embodiment may also be other computer-related devices, and there is no particular limitation on this embodiment.
[0045] like Figure 2 As shown, the training data generation method includes:
[0046] S201: Acquire original training teaching data, and parse and identify the original training teaching data to obtain to-be-processed files of various file format types.
[0047] In this embodiment, the original training teaching data may be business training materials uploaded by users or business training materials pre-stored in the teaching database. For example, business training materials may include product introduction manuals, professional knowledge texts, traditional course PPTs, business terms or conditions, etc.
[0048] In this embodiment, parsing and identifying the original training teaching data is a process of parsing and identifying the business training materials to obtain the file formats of the business training materials and the layout style of the file content corresponding to each file format.
[0049] Based on the above embodiment, in an optional embodiment of the present application, the original training teaching data includes multiple forms of materials. Accordingly, in step S201, the original training teaching data is parsed and identified to obtain multiple file format types of to-be-processed files, including:
[0050] S201a: According to each form material, determine the file format of each form material.
[0051] In this embodiment, each form material corresponds to a file in the original training teaching data. The file format of the form material can include PDF format, word format, TXT format, PPT format, picture format and XML format, etc., which are used to store teaching data.
[0052] S201b: According to the target file format, determine a pre-stored parsing strategy corresponding to the target file format.
[0053] In this embodiment, the different target file formats mean that the target file formats correspond to different parsing strategies. The pre-stored parsing strategy here can be software or tools that open the formal material in the target file format and extract the teaching data in the formal material.
[0054] S201c: Perform format parsing processing on the formal material according to the pre-stored parsing strategy and based on the pre-stored parsing strategy to obtain a format parsing file.
[0055] S201d: Return to the step of determining the file format of each formal material according to each formal material, until each formal material in the original teaching data is subjected to format parsing processing to obtain all format parsed files.
[0056] In this embodiment, the format parsing file refers to a file of a specific format whose content can be directly identified. Format parsing processing refers to the process of using parsing software or tools to open or convert the format of the form material, so that the form material becomes a format parsing file whose content can be directly identified. For example, some PDF files cannot directly extract and identify the content, so the PDF file can be converted into a word file first.
[0057] S201e: Identify and classify all format parsed files to obtain files of various file format types to be processed.
[0058] In this embodiment, the file format type refers to the typesetting method or layout style of the file. Identification and classification processing refers to the process of identifying the content in the format parsing file and determining the layout style of the format parsing file based on the identified content. The layout style can be a tree structure type.
[0059] Specifically, in an optional embodiment of the present application, step S201e includes the following steps:
[0060] e1: Parse the file according to each format and determine the layout type of the parsed file.
[0061] e2: According to the layout type, mark the parsed file as a file to be processed of a certain file layout type.
[0062] e3: until all parsed files are classified to obtain to-be-processed files of various file format types, wherein the file format types include clause type, description type and text type.
[0063] In this embodiment, after opening the format parsing file using a tool or software, the content in the format parsing file is identified to determine the layout type of the parsed file. For example, if it is identified that more than a certain percentage of the content in the format parsing file, such as 50%, is business-related text segment content, the layout type of the format parsing file can be determined to be text.
[0064] In this embodiment, all parsed files are classified to obtain files to be processed of various file format types, as shown in the following examples: the files to be processed are format parsed files after classification, for example, there are 100 format parsed files, and among the files to be processed obtained after classification, there are 30 clause files, 40 description files, and 30 text files.
[0065] S202: Perform unstructured knowledge collection and editing processing on each file to be processed, generate dense vector representation for knowledge segmentation and sparse representation of knowledge keywords, and store them in a preset knowledge base.
[0066] In this embodiment, the unstructured knowledge collection and editing process can be a process of dividing the file to be processed into knowledge blocks according to the file format type of the file to be processed, using the collection and editing strategy corresponding to each file format type, obtaining block knowledge, vectorizing the knowledge points in each block knowledge, and extracting the sparse representation of the knowledge keywords in each block knowledge. For example: for the file to be processed corresponding to the clause type, the knowledge content is collected one by one and divided into blocks according to each major clause.
[0067] In an optional embodiment of the present application, step S202 includes:
[0068] S202a: For each file format type to be processed, a semantic segmentation model combined with a customized regular expression knowledge segmentation strategy is used to segment the file format type to be processed into blocks to obtain segmented knowledge.
[0069] In this embodiment, the semantic segmentation model can be a model that can understand the text content and divide it into blocks or areas with specific semantics, and is used to divide the files to be processed into different semantic units or knowledge blocks. Regular expressions are text processing tools used to match, find and replace patterns in text. Generally, regular expressions consist of ordinary characters and special characters (also known as metacharacters), and can match text according to user-defined rules. Regular expressions can be customized according to the requirements of the file layout type. For different file layout types, different regular expression patterns can be designed to match and extract key information in the text. For example: a regular expression for processing financial statements may involve terms for identifying numbers, special symbols, and specific financial report calculations.
[0070] S202b: Generate a dense vector representation of the block knowledge based on the semantic vectorization model, and perform synchronous extraction processing on the block knowledge to obtain a sparse representation of knowledge keywords of the block knowledge.
[0071] In the present embodiment, the semantic vectorization model can be a natural language processing NLP model, which is used to convert text data into vector representations in a vector space to capture the semantic meaning of these text data. Through vectorization representation, the similarity between texts can be efficiently calculated or other operations can be performed. Synchronous extraction processing can be to use the language processing NLP model to perform parallel or sequential keyword extraction on each block knowledge, ensuring that the corresponding keywords can be obtained simultaneously or in order when processing each block knowledge. These keywords are more in line with the business training data required by the user. Sparse representation refers to using as few knowledge keywords as possible to represent the original block knowledge, which helps to reduce the dimension and complexity of the data while retaining the key information of each block knowledge.
[0072] S202c: Storing the dense vector representation and sparse representation of each block of knowledge into a preset knowledge base.
[0073] In this embodiment, the preset knowledge base can be used as an external knowledge base for subsequent training data generation operations.
[0074] S203: In response to the interactive operation performed by the user through the preset large model tool, user description data is obtained.
[0075] In this embodiment, the preset large model tool can be an artificial intelligence model specifically used to understand and generate human language, such as a large language model LLM. LLM can perform a wider range of natural language processing tasks by training the model on a large amount of text data to have more parameters and more accurate expression effects. The interactive operation can be a process of user description of the training data required for business training. For example: product introductions, promotional terms, words, hospitality etiquette drills, etc., which are input by users through the interactive interface, and these contents represent the user's intentions.
[0076] S204: Input the user description data into the intention recognition model to obtain the target intention data, and input the target intention data into the pre-stored large model tool to extract the target prompt template from the preset course template library.
[0077] In this embodiment, the user description data input into the intention recognition model can be the target intention data of obtaining the user's requirements for the type of training data based on the intention recognition model matching semantics. The target intention data is input into the pre-stored large model tool, enters the call (function call) process, and extracts the target prompt template from the preset course template library configured in the background. In this embodiment, the preset course template library can be an existing course template or a template for generating training data constructed by a training instructor based on experience.
[0078] In an optional embodiment of the present application, the preset course template library in step S204 is a reminder template pre-built by the training course instructor, wherein the construction process of the reminder template includes:
[0079] S204a: In response to the course design operation of the training course instructor, at least one course link of each standardized training course and the interactive data configuration required for each course link are determined according to different course types, and a plurality of initial course templates are obtained.
[0080] In this embodiment, the training course instructor refers to an experienced course instructor for business training. The initial course template can be a prompt template. The course links can include training, interaction, practice, and acceptance. Among them, the prompt template can be a text input into the preset large model tool, which can be a question, a sentence, or a paragraph. The function of the prompt template is to guide the artificial intelligence model to generate text content that meets the requirements.
[0081] S204b: Perform a test on each initial course template, and determine all initial course templates that pass the test as prompt templates.
[0082] In this embodiment, the initial course template requires the instructor to perform a test on the generation of training data for business training. After injecting the prepared knowledge into the initial course template, the training data is generated, and the instructor checks whether the training data meets the requirements of business training. If it does, it means that the initial course template has passed the test, and the initial course template that has passed the test is a prompt template for the generation of subsequent course data.
[0083] S205: performing a search process on the preset knowledge base according to the user description data, so as to retrieve the knowledge required for the training data from the preset knowledge base through a multi-way recall rearrangement strategy.
[0084] In this embodiment, the retrieval process refers to retrieving knowledge points with a high matching degree from a preset knowledge base as the knowledge required for training data according to the user description data. The multi-way recall rearrangement strategy refers to the process of representing this way based on dense vectors and this way based on sparse representation of knowledge point keywords, and finally using the rearrangement method to obtain knowledge points whose rankings meet the requirements.
[0085] Specifically, in an optional embodiment of the present application, step S205 includes:
[0086] S205a: Perform vector conversion processing on the user description data to obtain description vector data, and perform vector retrieval processing from a preset knowledge base through a vector retrieval method to obtain multiple first required block knowledge, wherein the dense vector representation of the first required block knowledge has a matching degree with the description vector data greater than a first threshold.
[0087] In this embodiment, the first threshold may be a preset value of similarity with the dense vector, such as 95% or 98%, etc., reflecting that the retrieved first required block knowledge can be used to generate a matching value of training data.
[0088] S205b: Determine description keywords based on user description data, and perform keyword search processing from a preset knowledge base through a keyword search method to obtain multiple second required block knowledge, wherein the sparse representation of the knowledge keywords of the second required block knowledge and the match of the description keywords are both greater than a second threshold.
[0089] In this embodiment, the second threshold may be a preset lower limit of the term frequency-inverse document frequency TF-IDF value of the sparsely represented knowledge keywords, and knowledge point keywords above the upper limit may be regarded as important and sparse.
[0090] S205c: Input multiple first required block knowledge and multiple second required block knowledge into the rearrangement model together to obtain at least one first required block knowledge whose dense vector representation and description vector data are ranked in a front preset position in terms of matching degree and / or one second required block knowledge whose sparse representation of knowledge keywords and description keywords are ranked in a front preset position in terms of matching degree, and determine them as the knowledge required for training data.
[0091] In this embodiment, the pre-preset ranking refers to a judgment boundary value in which the matching degree is pre-involved and sorted from high to low, such as the top 5 or top 3. The first required block knowledge and / or the second required block knowledge of the training data obtained in this way are the most important and sparse data when subsequently generating training data, as well as data with more similar semantic vectors, which helps to reduce the dimension and complexity of the data while retaining key information, and has high efficiency, flexibility and semantics. For example: there are 10 first required block knowledge and 10 second required block knowledge, which are input into the rearrangement model together. The first five are No. 1 first required block knowledge, No. 2 first required block knowledge, No. 3 second required block knowledge, No. 4 first required block knowledge and No. 5 second required block knowledge, which can be determined as the required knowledge for training data.
[0092] In this embodiment, both vector retrieval processing and keyword retrieval processing can adopt RAG (Retrieval-Augmented Generation). RAG is a technology that combines information retrieval and natural language generation. It aims to improve the instructions for generating retrieval answers by utilizing the knowledge base of vector databases and large language models, alleviate the phenomenon of hallucination generated by large models, provide better data support for subsequent training data generation, and thus improve the quality of generated training data.
[0093] S206: input the knowledge required for the training data and the target prompt template into the pre-stored large model tool to obtain the data to be adjusted, and display the data to be adjusted for viewing by the user.
[0094] In this embodiment, in the pre-stored large model tool, the knowledge required for the training data is injected into the target prompt target, and the pre-stored large model tool automatically generates preliminary training data, i.e., data to be adjusted, based on the injected knowledge required for the training data. These data to be adjusted need to be confirmed by the user as the training data for the business training required by the user before the subsequent steps are skipped.
[0095] In an optional embodiment of the present application, after step S206, the following further includes:
[0096] Step A: In response to the user's confirmation operation, the data to be adjusted is directly determined as the target training data and outputted.
[0097] In this embodiment, the user's confirmation operation can be to confirm the training data completed by gestures such as clicking or checking on the interactive interface of the terminal as training data that does not need to be modified or adjusted, and determine the data to be adjusted as the target training data output.
[0098] In this embodiment, the output may be directly sent to the user end or stored in a storage space of the server for courses related to business training.
[0099] S207: In response to the interactive operation performed by the user through the preset large model tool after viewing the data to be adjusted, the adjusted user description data is obtained, and the process jumps to the step of inputting the user description data into the intent recognition model to obtain the target intent data, so as to adjust the data to be adjusted and output the target training data.
[0100] In this embodiment, the target training data may be the content of a simulation training course related to the business. After the user has viewed the generated data to be adjusted, the process may return to step S203, so that the user may continue to select the large model tool for natural language interaction through the terminal to obtain the adjusted user description data until the target training data is obtained. In this embodiment, the adjusted content may be data similar to the user's real intention, such as the type of training course, the training focus, and the knowledge points involved in the training for the business training.
[0101] In summary, the training data generation method provided by the embodiment of the present application first obtains the to-be-processed files of various file version types by parsing and identifying the original teaching data for training, and then performs non-institutional knowledge collection and editing on the to-be-processed files, generates dense vector representations and sparse representations of knowledge keywords and stores them in a preset knowledge base, and is used for subsequent retrieval of the required knowledge for training data from the preset knowledge base through a multi-way recall rearrangement strategy. Vector retrieval can improve efficiency, and sparse representation can use as few knowledge keywords as possible to represent the original block knowledge, which helps to reduce the dimension and complexity of the data while retaining the key information of each block knowledge. Then, based on the user's interactive operation and intention recognition model, user description data representing the user's intention is obtained, and the corresponding target prompt template is selected according to the user description data, and then the required knowledge for the training data and the target prompt target are input into the preset large model tool to obtain the data to be adjusted and display processing. After viewing, the user can continue to adjust based on the interactive operation until the target training data is output. Not only does it solve the problem of the traditional large model generation environment and the difficulty in processing long documents, but it also improves the fit between the generated target training data and the user's true intention, improves the accuracy of the training data, and ensures high efficiency. Automatically generating training data can quickly adapt to business changes, saving training manpower and time costs.
[0102] At the same time, the present application can also divide the knowledge into blocks, so that the training data generation method provided in the embodiment of the present application can be used to process long documents with more content, thereby improving the quality of the generated training data.
[0103] Figure 3 This is a structural diagram of a training data generating device provided in an embodiment of the present application, the device comprising: an acquisition module 31, a knowledge collection and editing module 32, an interaction module 33, a template extraction module 34, a knowledge retrieval module 35 and a training data generating module 36.
[0104] The acquisition module 31 is used to acquire original training teaching data, and parse and identify the original training teaching data to obtain to-be-processed files of various file format types.
[0105] The knowledge collection and editing module 32 is used to perform unstructured knowledge collection and editing processing on each file to be processed, generate dense vector representation for knowledge segmentation and sparse representation of knowledge keywords and store them in a preset knowledge base.
[0106] The interaction module 33 is used to obtain user description data in response to the interaction operation performed by the user through the preset large model tool.
[0107] The template extraction module 34 is used to input the user description data into the intention recognition model to obtain the target intention data, and input the target intention data into the pre-stored large model tool to extract the target prompt template from the preset course template library.
[0108] The knowledge retrieval module 35 is used to perform retrieval processing on the preset knowledge base according to the user description data, so as to retrieve the knowledge required for the training data from the preset knowledge base through a multi-way recall rearrangement strategy.
[0109] The training data generation module 36 is used to input the knowledge and target prompt template required for the training data into the pre-stored large model tool to obtain the data to be adjusted, and display the data to be adjusted for users to watch.
[0110] The training data generation module 36 is also used to respond to the interactive operations performed by the user through the preset large model tool after viewing the data to be adjusted, obtain the adjusted user description data, and jump to the step of inputting the user description data into the intent recognition model to obtain the target intent data, so as to adjust the data to be adjusted and output the target training data.
[0111] In an optional embodiment of the present application, the original teaching data for training includes multiple formal materials. Accordingly, the acquisition module 31 is specifically used to: determine the file format of each formal material according to each formal material; determine the pre-stored parsing strategy corresponding to the target file format according to the target file format; perform format parsing on the formal material according to the pre-stored parsing strategy and based on the pre-stored parsing strategy to obtain a format parsed file; return to the step of determining the file format of each formal material according to each formal material, until each formal material in the original teaching data is format parsed to obtain all format parsed files; identify and classify all format parsed files to obtain files to be processed of multiple file format types.
[0112] In an optional embodiment of the present application, the acquisition module 31 is further specifically used to: determine the layout type of the format parsed file according to each format parsed file; mark the format parsed file as a file to be processed of a file layout type according to the layout type; until all format parsed files are marked, to obtain files to be processed of multiple file layout types, wherein the file layout types include clause type, description type and text type.
[0113] In an optional embodiment of the present application, the knowledge collection and editing module 32 is specifically used to: use a semantic segmentation model combined with a customized regular expression knowledge segmentation strategy for each different file format type of files to be processed, perform block processing on the files to be processed of each file format type to obtain block knowledge; generate a dense vector representation of the block knowledge based on the semantic vectorization model for the block knowledge, and synchronously extract and process the block knowledge to obtain a sparse representation of knowledge keywords of the block knowledge; store the dense vector representation and sparse representation of each block knowledge into a preset knowledge base.
[0114] In an optional embodiment of the present application, the interactive module 33 is also used to construct a preset course template library. The preset course template library is a prompt template pre-constructed by the training course instructor, wherein the construction process of the prompt template includes: responding to the course design operation of the training course instructor to determine at least one course link of each standardized training course and the interactive data configuration required for each course link according to different course types, and obtaining multiple initial course templates; testing each initial course template, and determining all initial course templates that have passed the test as prompt templates.
[0115] In an optional embodiment of the present application, the knowledge retrieval module 35 is specifically used to: perform vector conversion processing on the user description data to obtain description vector data, and perform vector retrieval processing from a preset knowledge base through a vector retrieval method to obtain multiple first required block knowledge, wherein the dense vector representation of the first required block knowledge and the description vector data have a matching degree greater than a first threshold; determine the description keyword based on the user description data, and perform keyword retrieval processing from the preset knowledge base through a keyword retrieval method to obtain multiple second required block knowledge, wherein the sparse representation of the knowledge keyword of the second required block knowledge and the description keyword have a matching degree greater than a second threshold; input the multiple first required block knowledge and the multiple second required block knowledge into the rearrangement model together to obtain at least one first required block knowledge whose dense vector representation and the description vector data are ranked in a front preset position in terms of matching degree and / or one second required block knowledge whose sparse representation of the knowledge keyword and the description keyword are ranked in a front preset position in terms of matching degree, and determine them as the knowledge required for training data.
[0116] In an optional embodiment of the present application, the training data generation module 36 is used to display the data to be adjusted for viewing by the user, and is also used to: in response to the user's confirmation operation, directly determine the data to be adjusted as the target training data and output it.
[0117] The training data generating device provided in this embodiment can be used to execute the technical solution of the above method embodiment. Its implementation principle and technical effect are similar, and this embodiment will not be repeated here.
[0118] Figure 4 A schematic diagram of the hardware structure of the training data generating device provided in the embodiment of the present application is shown in FIG. Figure 4 As shown, the device includes: at least one processor 401 and a memory 402 .
[0119] The memory 402 is used to store computer-executable instructions.
[0120] The processor 401 is used to execute the computer-executable instructions stored in the memory 402 to implement the various steps involved in the above method embodiment. For details, please refer to the relevant description in the above method embodiment.
[0121] Optionally, the memory 402 may be independent or integrated with the processor 401 .
[0122] When the memory 402 is independently provided, the device further includes a bus 403 for connecting the memory 402 and the processor 401 .
[0123] An embodiment of the present application also provides a computer-readable storage medium, in which computer-executable instructions are stored. When a processor executes the computer-executable instructions, the above training data generation method is implemented.
[0124] An embodiment of the present application also provides a computer program product, including a computer program, which implements the above training data generation method when executed by a processor.
[0125] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the above modules is only a logical function division. There may be other division methods in actual implementation, such as multiple modules can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or modules, which can be electrical, mechanical or other forms.
[0126] The modules described above as separate components may or may not be physically separated, and the components shown as modules may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to implement the solution of this embodiment.
[0127] In addition, each functional module in each embodiment of the present invention may be integrated into one processing unit, each module may exist physically separately, or two or more modules may be integrated into one unit. The unit composed of the above modules may be implemented in the form of hardware or in the form of hardware plus software functional units.
[0128] The above-mentioned integrated module implemented in the form of a software function module can be stored in a computer-readable storage medium. The above-mentioned software function module is stored in a storage medium, including a number of instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor to perform some steps of the method of each embodiment of the present application.
[0129] It should be understood that the processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), etc. A general-purpose processor may be a microprocessor or any conventional processor. The steps of the method disclosed in the invention may be directly implemented as being executed by a hardware processor, or may be implemented by a combination of hardware and software modules in the processor.
[0130] The memory may include a high-speed RAM memory, and may also include a non-volatile storage NVM, such as at least one disk memory, and may also be a USB flash drive, a mobile hard disk, a read-only memory, a magnetic disk or an optical disk, etc.
[0131] The bus may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, the bus in the drawings of the present application is not limited to only one bus or one type of bus.
[0132] The above storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk. The storage medium can be any available medium that can be accessed by a general or special purpose computer.
[0133] An exemplary storage medium is coupled to a processor so that the processor can read information from the storage medium and write information to the storage medium. Of course, the storage medium can also be a component of the processor. The processor and the storage medium can be located in an application specific integrated circuit (ASIC). Of course, the processor and the storage medium can also exist as discrete components in an electronic device or a main control device.
[0134] Those skilled in the art can understand that all or part of the steps of implementing the above-mentioned method embodiments can be completed by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, the steps of the above-mentioned method embodiments are executed; and the aforementioned storage medium includes: ROM, RAM, disk or optical disk and other media that can store program codes.
[0135] The present invention is intended to illustrate the technical solution of the present application rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some or all of the technical features may be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solution from the scope of the technical solutions of the embodiments of the present application.
Claims
1. A training data generation method, It is characterized in that Applicable to servers, including: Acquire original training teaching data, and perform parsing and identification processing on the original training teaching data to obtain to-be-processed files of various file format types; Perform unstructured knowledge collection and editing on each file to be processed, generate dense vector representation for knowledge segmentation and sparse representation of knowledge keywords, and store them in a preset knowledge base; In response to an interactive operation performed by a user through a preset large model tool, obtaining user description data; Input the user description data into the intention recognition model to obtain target intention data, and input the target intention data into the pre-stored large model tool to extract the target prompt template from the preset course template library; Performing a search process on the preset knowledge base according to the user description data, so as to retrieve the knowledge required for the training data from the preset knowledge base through a multi-way recall rearrangement strategy; Input the knowledge required for the training data and the target prompt template into the pre-stored large model tool to obtain the data to be adjusted, and display the data to be adjusted for viewing by the user; In response to the interactive operation performed by the user through the preset large model tool after viewing the data to be adjusted, the adjusted user description data is obtained, and the process jumps to the step of inputting the user description data into the intent recognition model to obtain the target intent data, so as to adjust the data to be adjusted and output the target training data.
2. The method according to claim 1, It is characterized in that The original training teaching data includes multiple forms of materials; Accordingly, the original training teaching data is parsed and identified to obtain files to be processed of various file format types, including: According to each form material, determine the file format of each form material; According to the target file format, determining a pre-stored parsing strategy corresponding to the target file format; According to the pre-stored parsing strategy, and based on the pre-stored parsing strategy, the formal material is format parsed to obtain a format parsed file; Returning to the step of determining the file format of each form material according to each form material, until each form material in the original teaching data is subjected to format parsing processing to obtain all format parsed files; All format parsed files are identified and classified to obtain files to be processed of various file format types.
3. The method according to claim 2, It is characterized in that The secondary parsing process is performed on all the format parsed files to obtain files to be processed of various file format types, including: According to each format parsed file, determining the layout type of the format parsed file; According to the layout type, marking the format parsed file as a to-be-processed file of a file layout type; Until all the format parsed files are marked, to-be-processed files of various file format types are obtained, wherein the file format types include clause type, description type and text type.
4. The method according to claim 1, It is characterized in that The unstructured knowledge collection and editing process is performed on each to-be-processed file, and a dense vector representation of block knowledge and a sparse representation of knowledge keywords are generated and stored in a preset knowledge base, including: For each type of to-be-processed file of different file format, a semantic segmentation model combined with a customized regular expression knowledge segmentation strategy is used to segment the to-be-processed file of each file format type to obtain segmentation knowledge; Generating a dense vector representation of the block knowledge based on a semantic vectorization model for the block knowledge, and performing synchronous extraction processing on the block knowledge to obtain a sparse representation of knowledge keywords of the block knowledge; The dense vector representation and the sparse representation of each block of knowledge are stored in a preset knowledge base.
5. The method according to claim 1, It is characterized in that The preset course template library is a reminder template pre-built by the training course instructor, wherein the construction process of the reminder template includes: In response to the course design operation of the training course instructor, at least one course link of each standardized training course and the interactive data configuration required for each course link are determined according to different course types, and a plurality of initial course templates are obtained; Each initial course template is tested, and all initial course templates that pass the test are determined as prompt templates.
6. The method according to claim 1, It is characterized in that The retrieving process of the preset knowledge base according to the user description data to retrieve the knowledge required for the training data from the preset knowledge base through a multi-way recall rearrangement strategy includes: Performing vector conversion processing on the user description data to obtain description vector data, and performing vector retrieval processing from the preset knowledge base in a vector retrieval manner to obtain a plurality of first required block knowledge, wherein the dense vector representation of the first required block knowledge has a matching degree with the description vector data greater than a first threshold; Determine description keywords according to the user description data, and perform keyword search processing from the preset knowledge base through a keyword search method to obtain a plurality of second required block knowledge, wherein the sparse representation of the knowledge keywords of the second required block knowledge and the match of the description keywords are greater than a second threshold; Multiple first required block knowledge and multiple second required block knowledge are input into the rearrangement model together to obtain at least one first required block knowledge whose dense vector representation is ranked in a front preset position in terms of matching degree with the description vector data and / or a second required block knowledge whose sparse representation of knowledge keywords is ranked in a front preset position in terms of matching degree with the description keywords, and determine them as the knowledge required for training data.
7. The method according to any one of claims 1 to 6, It is characterized in that After displaying the data to be adjusted for viewing by the user, the method further includes: In response to a confirmation operation by the user, the data to be adjusted is directly determined as target training data and output.
8. A training data generating device, It is characterized in that Applicable to servers, including: An acquisition module is used to acquire original training teaching data, and parse and identify the original training teaching data to obtain to-be-processed files of various file format types; The knowledge collection and editing module is used to collect and edit unstructured knowledge for each file to be processed, generate dense vector representations for knowledge segmentation and sparse representations of knowledge keywords, and store them in a preset knowledge base; An interactive module, for obtaining user description data in response to an interactive operation performed by a user through a preset large model tool; A template extraction module, used for inputting the user description data into an intention recognition model to obtain target intention data, and inputting the target intention data into a pre-stored large model tool to extract a target prompt template from a preset course template library; A knowledge retrieval module, used to perform retrieval processing on the preset knowledge base according to the user description data, so as to retrieve the knowledge required for training data from the preset knowledge base through a multi-way recall rearrangement strategy; A training data generation module, used for inputting the knowledge required for the training data and the target prompt template into the pre-stored large model tool to obtain the data to be adjusted, and displaying the data to be adjusted for viewing by the user; The training data generation module is also used to obtain adjusted user description data in response to the interactive operation performed by the user through the preset large model tool after viewing the data to be adjusted, and jump to the step of inputting the user description data into the intent recognition model to obtain target intent data, so as to adjust the data to be adjusted and output target training data.
9. A training data generating device, It is characterized in that include: at least one processor and memory; The memory stores computer-executable instructions; The at least one processor executes the computer-executable instructions stored in the memory, so that the at least one processor performs the training data generating method according to any one of claims 1 to 7.
10. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores computer-executable instructions. When the processor executes the computer-executable instructions, the training data generation method according to any one of claims 1 to 4 is implemented.
Citation Information
Patent Citations
Content generation method and device, equipment and storage medium
CN118035430A
High performance big data computing system and platform
US20160299944A1
Cited By
Data slicing method, system and equipment and storage medium
CN119557427A
Intelligent drilling system and method based on RAG technology, medium, terminal and program product
CN119991306A
Intelligent drill system, method, medium, terminal and program product based on RAG technology
CN119991306B
Initial electromagnetic environment generation system and method based on element feedback correction
CN121413212A
