Large model training method, data processing method and device
By employing large-scale model training and data processing methods, standard operating procedure (SOP) texts are converted into visual flowcharts, resolving the issue of unclear logical expression in SOP documents and enabling efficient verification and accurate flowchart generation.
Patent Information
- Application Number
- CN202512015083.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-29
- Publication Date
- 2026-01-30
AI Technical Summary
Existing technologies often suffer from unclear logical expressions and insufficient consideration of logical branches when writing standard operating procedure (SOP) documents, resulting in low verification efficiency and accuracy, and unsatisfactory results when relying on manual verification.
By using a large model training method, standard operating procedure text samples are converted into flowchart code that adapts to the syntax rules of the target editor. Error messages from the target editor are used to construct a loss function, and a target large model is trained to correct logical errors. Finally, a visual flowchart is generated through the target editor.
It improves the accuracy and efficiency of standard operating procedure text checking, and utilizes the editor's syntax verification capabilities to train more accurate large models, reducing the need for training data.
Smart Images

Figure CN121434792A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of computer technology, and in particular to a large model training method and a data processing method and device. BACKGROUND
[0002] A standard operating procedure (SOP) is a file that describes work and its workflow and steps in detail. In the process of writing an SOP file, there are problems such as unclear logical expression and lack of logical branch consideration. Such problems currently only rely on human experience for checking, and the checking efficiency and accuracy are relatively low. SUMMARY
[0003] One or more embodiments of the present specification provide a large model training method and a data processing method and device to at least partially solve the above technical problems.
[0004] In a first aspect, a large model training method is provided, comprising: obtaining a standard operating procedure text sample; inputting the standard operating procedure text sample into a target large model, and converting the standard operating procedure text sample into flowchart code that adapts to the syntax rules of a target editor using the target large model; determining a first loss function according to the flowchart code generated by the target large model and the standard flowchart code of the standard operating procedure text sample; generating a flowchart according to the flowchart code generated by the target large model using the target editor, and constructing a second loss function according to error information of the target editor when generating the flowchart; training the target large model using the first loss function and the second loss function.
[0005] As an optional implementation of the method of the first aspect, the second loss function is constructed according to the error information of the target editor when generating the flowchart, specifically comprising: if the target editor generates an error when generating the flowchart, it is determined that the value of the second loss function is X, X is a constant greater than zero; if the target editor does not generate an error when generating the flowchart, it is determined that the value of the second loss function is 0.
[0006] As an optional implementation of the method of the first aspect, the method further comprises: obtaining initial flowchart code of the standard operating procedure text sample; verifying the initial flowchart code using the target editor and generating a corresponding flowchart; Obtaining a logical error of the initial flowchart code checked by the target editor; According to the logical error, modifying the initial flowchart code, and generating a new flowchart according to the modified flowchart code through the target editor; repeating the step until the logic represented by the generated new flowchart is consistent with the logic of the standard operating procedure text sample, and taking the flowchart code at this time as the standard flowchart code of the standard operating procedure text sample.
[0007] As an optional implementation of the method of the first aspect, training the target large model by using the first loss function and the second loss function, specifically comprising: Weighting the first loss function and the second loss function to obtain a total loss function; Training the target large model by using the total loss function.
[0008] Secondly, a data processing method is provided, comprising: Obtaining a standard operating procedure text to be processed; Inputting the standard operating procedure text into a target large model pre-trained by using the above-mentioned large model training method, and converting the standard operating procedure text into flowchart code adapting to the syntax rules of a target editor by using the target large model; Generating a flowchart by using the target editor according to the flowchart code generated by the target large model.
[0009] Thirdly, a large model training device is provided, comprising: A first data acquisition module for acquiring a standard operating procedure text sample; A training module for inputting the standard operating procedure text sample into a target large model, converting the standard operating procedure text sample into flowchart code adapting to the syntax rules of a target editor by using the target large model, determining a first loss function according to the flowchart code generated by the target large model and the standard flowchart code of the standard operating procedure text sample, generating a flowchart by using the target editor according to the flowchart code generated by the target large model, constructing a second loss function according to the error information of the target editor when generating the flowchart, and training the target large model by using the first loss function and the second loss function.
[0010] As an optional implementation of the device of the third aspect, the training module is specifically configured to: If the target editor generates an error when generating the flowchart, it is determined that the value of the second loss function is X, X is a constant greater than zero; If the target editor does not report an error when generating the flowchart, then the value of the second loss function is determined to be 0.
[0011] As an optional embodiment of the apparatus described in the third aspect, the first data acquisition module is specifically used for: Obtain the initial flowchart code of the standard operating procedure text sample; The target editor is used to verify the initial flowchart code and generate the corresponding flowchart. Obtain logical errors in the initial flowchart code verified by the target editor; Modify the initial flowchart code according to the logical error, and generate a new flowchart using the target editor based on the modified flowchart code; repeat this step until the logic represented by the generated new flowchart is consistent with the logic of the standard operating procedure text sample, and use the flowchart code at this time as the standard flowchart code of the standard operating procedure text sample.
[0012] As an optional implementation of the apparatus described in the third aspect, the training module is specifically used for: The first loss function and the second loss function are weighted to obtain the total loss function; The target large model is trained using the total loss function.
[0013] Fourthly, a data processing apparatus is provided, comprising: The second data acquisition module is used to acquire the text of the standard operating procedure to be processed. The code generation module is used to input the standard operating procedure text into a target large model pre-trained using the large model training method described above, and then use the target large model to convert the standard operating procedure text into flowchart code that adapts to the syntax rules of the target editor. The flowchart generation module is used to generate flowcharts based on the flowchart code generated by the target large model using the target editor.
[0014] Fifthly, a computer-readable storage medium is provided, the computer-readable storage medium storing a computer program that, when the computer program is run on an electronic device, causes the electronic device to perform the above-described large model training method, or to perform the above-described data processing method.
[0015] Sixthly, an electronic device is provided, comprising: At least one memory for storing programs; At least one processor is configured to execute a program stored in the memory, wherein when the program stored in the memory is executed, the processor is configured to execute the large model training method described above, or to execute the data processing method described above.
[0016] The beneficial effects of the large model training method, data processing method, and apparatus described in the embodiments of this specification are as follows: The large-scale model training method described above trained a large model that can accurately convert standard operating procedure text into flowchart code that can be successfully recognized by the editor and generate flowcharts. During training, this method fully utilizes the editor's syntax checking capabilities, incorporating error messages from the editor during the transcoding process into the loss function of the large model, thereby enabling the training of a more accurate large model with less training data.
[0017] The data processing method described above uses a pre-trained large model to accurately convert standard operating procedure text into flowchart code that is compatible with the editor's syntax rules. Then, the editor generates a visual flowchart based on the flowchart code, thereby improving the verification efficiency of standard operating procedure text checkers.
[0018] The large model training device and data processing device described in the embodiments of this specification also have the above-mentioned beneficial effects. Attached Figure Description
[0019] To more clearly illustrate the technical solutions in the embodiments or prior art of this specification, the drawings used in the description of the embodiments or prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this specification. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0020] Figure 1 A schematic flowchart of a large model training method described in an embodiment of this specification is shown as an example.
[0021] Figure 2 A schematic flowchart of a data processing method described in an embodiment of this specification is shown as an example.
[0022] Figure 3 A schematic diagram of the structure of a large model training device described in an embodiment of this specification is shown as an example.
[0023] Figure 4 A schematic diagram of the structure of a data processing apparatus according to an embodiment of this specification is shown as an example.
[0024] Figure 5 An exemplary schematic diagram of the structure of an electronic device provided in an embodiment of this specification is shown. Detailed Implementation
[0025] First, it should be noted that the terminology used in the embodiments of this invention is for the purpose of describing specific embodiments only and is not intended to limit the invention. The singular forms “a,” “the,” and “the” used in the embodiments of this invention and the appended claims are also intended to include the plural forms, unless the context clearly indicates otherwise.
[0026] To enable those skilled in the art to better understand the technical solutions in this specification, the technical solutions in the embodiments of this specification will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments in this specification, and not all of the embodiments. Therefore, those skilled in the art should recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of the invention. Similarly, for clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.
[0027] It should be noted that the steps of the corresponding methods are not necessarily performed in the order shown and described in this specification in other embodiments. In some other embodiments, the methods may include more or fewer steps than described in this specification. Furthermore, a single step described in this specification may be broken down into multiple steps in other embodiments; and multiple steps described in this specification may be combined into a single step in other embodiments.
[0028] This specification provides one or more embodiments of a large model training method, data processing method, and apparatus.
[0029] The large model training method, data processing method, and apparatus described in one or more embodiments of this specification will be further described in detail below with reference to the accompanying drawings and specific embodiments. However, this detailed description does not constitute a limitation on the embodiments of this specification.
[0030] Please refer to Figure 1 , Figure 1 This diagram illustrates a large model training method proposed in one or more embodiments of this specification. The method aims to train code capable of accurately converting standard operating procedure text (hereinafter referred to as SOP text) into flowchart code that can be recognized by an editor and generate flowcharts. It should be noted that this large model training method can be implemented using the large model training apparatus described in one or more embodiments of this specification, but is not limited to this apparatus.
[0031] like Figure 1 As shown, the method includes steps S100 to S108.
[0032] S100: Obtain a sample of the standard operating procedure text.
[0033] Standard Operating Procedures (SOPs) are documents that describe in detail a task, its workflow, and steps. They are standardized process guidelines for internal organization operations, typically containing detailed procedures for a specific business, product, or service, for reference and adherence by internal personnel. SOPs primarily include standardized processes, clearly defined responsibilities and authorities, emergency response measures, quality standards and assessments, and document management.
[0034] The tags mentioned above for obtaining standard operating procedure (SOP) text samples are the standard flowchart codes for those SOP text samples. Standard flowchart codes refer to codes that accurately represent the logic of the SOP text sample. It should be noted that the fact that the standard flowchart codes accurately represent the logic of the SOP text sample does not mean that the logic of the SOP text sample is error-free, but rather that the logic represented by the standard flowchart codes is consistent with the logic of the SOP text sample's processing flow for a specific business, product, or service.
[0035] It should be noted that this embodiment does not impose any restrictions on the method of obtaining the standard flowchart code of the above-mentioned standard operating procedure text sample.
[0036] In some implementations, the flowchart codes of standard operating procedure (SOP) text samples can be manually edited. These flowchart codes can be manually verified to ensure that there are no logical errors and that the logic they represent is consistent with the logic of the SOP text samples. The verified flowchart codes can then be used as the aforementioned standard flowchart codes.
[0037] In some implementations, the initial flowchart code of the standard operating procedure (SOP) text sample can be obtained first. This initial flowchart code can be manually edited or generated using code generation tools such as large model libraries. Then, a target editor is used to verify the initial flowchart code and generate the corresponding flowchart. This target editor is an editor tool capable of verifying flowchart code and generating flowcharts from it, such as the PlantUML syntax editor or the Mermaid syntax editor. Next, logical errors in the initial flowchart code verified by the target editor are identified. The initial flowchart code is modified based on these errors, and a new flowchart is generated using the target editor based on the modified flowchart code. This process is repeated until the logic represented by the newly generated flowchart matches that of the SOP text sample. The flowchart code at this point is then used as the standard flowchart code for the SOP text sample.
[0038] S102: Input the standard operating procedure text sample into the target large model, and use the target large model to convert the standard operating procedure text sample into flowchart code that adapts to the syntax rules of the target editor.
[0039] The target large model here can be a randomly selected large language model with the ability to convert standard operating procedure text samples into flowchart code that adapts the syntax rules to the target editor, such as deepseek, quen, etc.
[0040] S104: Determine the first loss function based on the flowchart code generated by the target large model and the standard flowchart code of the standard operating procedure text sample.
[0041] The first loss function described above is used to describe the difference between the flowchart code generated by the target large model and the standard flowchart code of the standard operating procedure text sample.
[0042] In some implementations, cross-entropy can be used to construct the first loss function described above.
[0043] S106: Use the target editor to generate a flowchart based on the flowchart code generated by the target large model, and construct a second loss function based on the error information of the target editor when generating the flowchart.
[0044] Current target editors, such as PlantUML and Mermaid syntax editors, all have code verification functions. During the process of generating a flowchart from the flowchart code, the target editor uses this function to check for logical and / or syntactic errors in the flowchart code, which could prevent the target editor from generating a flowchart or generate an incorrect flowchart. If an error is found, the target editor will generate an error message.
[0045] In this step, error messages from the target editor are incorporated into the loss function, prompting the large model to correct errors during code generation. Specifically, the second loss function can be determined based on whether the target editor reports an error when generating the flowchart. For example, if the target editor reports an error during flowchart generation, the value of the second loss function is determined to be X, where X is a constant greater than zero, typically set to 1. If the target editor does not report an error during flowchart generation, the value of the second loss function is determined to be 0.
[0046] S108: Train the target large model using the first loss function and the second loss function.
[0047] In some implementations, the first loss function and the second loss function can be weighted to obtain a total loss function, which can then be used to train the target large model.
[0048] The total loss function can be expressed as:
[0049] in, and The coefficients are positive real numbers. Denotes the first loss function. This is the second loss function.
[0050] The above describes a large model training method as illustrated in one or more embodiments of this specification. This method fully utilizes the syntax verification capabilities of the target editor during the training of the large model, incorporating error messages from the target editor during transcoding into the loss function of the large model. This allows for the training of a more accurate large model using less training data.
[0051] Corresponding to the large model training methods described above, one or more embodiments of this specification propose a data processing method. For example... Figure 2 As shown, the method includes steps S200 to S206.
[0052] S200: Obtain the text of the standard job procedure to be processed.
[0053] S202: Input the standard operating procedure text into the target large model pre-trained using the large model training method described above, and use the target large model to convert the standard operating procedure text into flowchart code that adapts to the syntax rules of the target editor.
[0054] S204: Use the target editor to generate a flowchart based on the flowchart code generated from the target large model.
[0055] The large model used in the above data processing method is pre-trained using the large model training method described above. The training process and working principle of the large model have been described in detail in the large model training method section above, and will not be repeated here.
[0056] This data processing method, when generating visual flowcharts from new standard operating procedure (SOP) texts, first uses a large model to generate accurate flowchart code that conforms to the target editor's syntax rules. Then, the target editor generates the visual flowchart based on this code. This method allows the logic of the SOP text to be intuitively presented to reviewers in the form of flowcharts, facilitating the identification of logical errors and improving the efficiency of SOP text review.
[0057] Corresponding to the aforementioned large model training methods, one or more embodiments of this specification propose a large model training apparatus. For example... Figure 3 As shown, the large model training device includes: The first data acquisition module 301 is used to acquire standard operating procedure text samples.
[0058] Training module 302 is used to input standard operating procedure text samples into the target large model, and use the target large model to convert the standard operating procedure text samples into flowchart code that adapts to the syntax rules of the target editor; determine the first loss function based on the flowchart code generated by the target large model and the standard flowchart code of the standard operating procedure text samples; use the target editor to generate a flowchart based on the flowchart code generated by the target large model, and construct a second loss function based on the error information of the target editor when generating the flowchart; and train the target large model using the first loss function and the second loss function.
[0059] Optionally, the training module 302 described above is specifically used to: if the target editor reports an error when generating the flowchart, determine that the value of the second loss function is X, where X is a constant greater than zero; if the target editor does not report an error when generating the flowchart, determine that the value of the second loss function is 0.
[0060] Optionally, the first data acquisition module 301 described above is specifically used for: acquiring the initial flowchart code of the standard operating procedure text sample; verifying the initial flowchart code using a target editor and generating a corresponding flowchart; acquiring the logical errors in the initial flowchart code verified by the target editor; modifying the initial flowchart code according to the logical errors, and generating a new flowchart using the target editor based on the modified flowchart code; repeating this step until the logic represented by the generated new flowchart is consistent with the logic of the standard operating procedure text sample, and using the flowchart code at this time as the standard flowchart code of the standard operating procedure text sample.
[0061] Optionally, the training module 302 described above is specifically used to: weight the first loss function and the second loss function to obtain the total loss function; and train the target large model using the total loss function.
[0062] Below, with Figure 3The implementation principle of this device is illustrated using the large model training device shown as an example. Taking a module as a software functional unit as an example, the first data acquisition module 301 may include code running on a computing instance. The computing instance may include at least one of a physical host (computing device), a virtual machine, and a container. Further, the aforementioned computing instance may be one or more. For example, the first data acquisition module 301 may include code running on multiple hosts / virtual machines / containers. The multiple hosts / virtual machines / containers used to run the code may be distributed in the same region or in different regions. Further, the multiple hosts / virtual machines / containers used to run the code may be distributed in the same availability zone (AZ) or in different AZs, each AZ including one or more geographically proximate data centers. Typically, a region may include multiple AZs.
[0063] Similarly, multiple hosts / virtual machines / containers used to run this code can be distributed within the same Virtual Private Cloud (VPC) or across multiple VPCs. Typically, a VPC is set up within a region. Communication between two VPCs within the same region, as well as between VPCs in different regions, requires a communication gateway to be set up within each VPC to enable interconnection between VPCs.
[0064] As an example of a hardware functional unit, the first data acquisition module 301 may include at least one computing device, such as a server. Alternatively, the first data acquisition module 301 may also be a device implemented using an application-specific integrated circuit (ASIC) or a programmable logic device (PLD). The PLD may be implemented using a complex programmable logical device (CPLD), a field-programmable gate array (FPGA), generic array logic (GAL), or any combination thereof.
[0065] The multiple computing devices included in the first data acquisition module 301 can be distributed in the same region or in different regions. Similarly, the multiple computing devices included in the first data acquisition module 301 can be distributed in the same Availability Zone (AZ) or in different AZs. Likewise, the multiple computing devices included in the first data acquisition module 301 can be distributed in the same Virtual Private Cloud (VPC) or in multiple VPCs. These multiple computing devices can be any combination of computing devices such as servers, ASICs, PLDs, CPLDs, FPGAs, and GALs.
[0066] In other embodiments, the first data acquisition module 301 can be used to execute any step in the above-described large model training method, and the training module 302 can be used to execute any step in the above-described large model training method. The steps implemented by the first data acquisition module 301 and the training module 302 can be specified as needed. By implementing different steps in the above-described large model training method through the first data acquisition module 301 and the training module 302 respectively, all the functions of the above-described large model training device can be realized.
[0067] In this implementation, the device can also be applied to computing devices such as computers and servers, or to a cluster of computing devices including at least one computing device, to implement a specific large model training process.
[0068] Corresponding to the data processing method described above, one or more embodiments of this specification propose a data processing apparatus. For example... Figure 4 As shown, the data processing device includes: The second data acquisition module 401 is used to acquire the standard operating procedure text to be processed.
[0069] The code generation module 402 is used to input the standard operating procedure text into the target large model pre-trained using the large model training method described above, and to use the target large model to convert the standard operating procedure text into flowchart code that adapts to the syntax rules of the target editor.
[0070] The flowchart generation module 403 is used to generate flowcharts based on the flowchart code generated by the target large model using the target editor.
[0071] Below, with Figure 4The implementation principle of the device is illustrated using the data processing apparatus shown as an example. Taking a module as a software functional unit as an example, the second data acquisition module 401 may include code running on a computing instance. The computing instance may include at least one of a physical host (computing device), a virtual machine, and a container. Further, the aforementioned computing instance may be one or more. For example, the second data acquisition module 401 may include code running on multiple hosts / virtual machines / containers. The multiple hosts / virtual machines / containers used to run the code may be distributed in the same region or in different regions. Further, the multiple hosts / virtual machines / containers used to run the code may be distributed in the same availability zone (AZ) or in different AZs, each AZ including one or more geographically proximate data centers. Typically, a region may include multiple AZs.
[0072] Similarly, multiple hosts / virtual machines / containers used to run this code can be distributed within the same Virtual Private Cloud (VPC) or across multiple VPCs. Typically, a VPC is set up within a region. Communication between two VPCs within the same region, as well as between VPCs in different regions, requires a communication gateway to be set up within each VPC to enable interconnection between VPCs.
[0073] As an example of a hardware functional unit, the second data acquisition module 401 may include at least one computing device, such as a server. Alternatively, the second data acquisition module 401 may also be a device implemented using an application-specific integrated circuit (ASIC) or a programmable logic device (PLD). The PLD may be implemented using a complex programmable logical device (CPLD), a field-programmable gate array (FPGA), generic array logic (GAL), or any combination thereof.
[0074] The multiple computing devices included in the second data acquisition module 401 can be distributed in the same region or in different regions. Similarly, the multiple computing devices included in the second data acquisition module 401 can be distributed in the same Availability Zone (AZ) or in different AZs. Likewise, the multiple computing devices included in the second data acquisition module 401 can be distributed in the same Virtual Private Cloud (VPC) or in multiple VPCs. These multiple computing devices can be any combination of computing devices such as servers, ASICs, PLDs, CPLDs, FPGAs, and GALs.
[0075] In other embodiments, the second data acquisition module 401 can be used to execute any step in the above-described data processing method, the code generation module 402 can be used to execute any step in the above-described data processing method, and the flowchart generation module 403 can be used to execute any step in the above-described data processing method. The steps implemented by the second data acquisition module 401, the code generation module 402, and the flowchart generation module 403 can be specified as needed. By implementing different steps in the above-described data processing method through the second data acquisition module 401, the code generation module 402, and the flowchart generation module 403, all the functions of the above-described data processing device can be realized.
[0076] In this implementation, the device can also be applied to computing devices such as computers and servers, or to a cluster of computing devices including at least one computing device, to implement a specific data processing method.
[0077] One or more embodiments described in this specification also provide an electronic device. Please refer to... Figure 5 The electronic device includes a bus 501, a processor 502, a memory 503, and a communication interface 504. The processor 502, memory 503, and communication interface 504 communicate via the bus 501. This electronic device can be a server or a terminal device. It should be understood that this application does not limit the number of processors and memories in the electronic device.
[0078] Bus 501 can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. Buses can be categorized as address buses, data buses, control buses, etc. For ease of representation, Figure 5 The bus 501 may be represented by a single line, but this does not mean that there is only one bus or one type of bus. The bus 501 may include a path for transmitting information between various components of an electronic device (e.g., processor 502, memory 503, and communication interface 504).
[0079] Processor 502 may include any one or more processors such as CPU, graphics processing unit (GPU), microprocessor (MP), or digital signal processor (DSP).
[0080] Memory 503 may include volatile memory, such as random access memory (RAM). Memory 503 may also include non-volatile memory, such as read-only memory (ROM), flash memory, hard disk drive (HDD), or solid state drive (SSD).
[0081] The memory 503 stores executable program code, and the processor 502 executes the executable program code to implement the aforementioned large model training method, or to implement the aforementioned data processing method.
[0082] Communication interface 504 uses transceiver modules, such as, but not limited to, network interface cards and transceivers, to enable communication between electronic devices and other devices or communication networks.
[0083] One or more embodiments of this specification provide a computer-readable storage medium storing a computer program that, when run on an electronic device, causes the electronic device to perform the large model training method described above, or to perform the data processing method described above.
[0084] The computer-readable storage medium can be any available medium that an electronic device can store, or a data storage device such as a data center that contains one or more available media. The available media can be magnetic media (e.g., floppy disks, hard disks, magnetic tapes), optical media (e.g., DVDs), or semiconductor media (e.g., solid-state drives). The computer-readable storage medium includes instructions that instruct the electronic device to perform the large model training method described above, or to perform the data processing method described above.
[0085] It is understood that the structures illustrated in the embodiments of this specification do not constitute a specific limitation on the system of the embodiments of this specification. In other embodiments of the specification, the above system may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0086] The various embodiments in this specification are described in a progressive manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the apparatus embodiments are basically similar to the method embodiments, so the description is relatively simple; relevant parts can be referred to the descriptions of the method embodiments.
[0087] The foregoing has described specific embodiments of this specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims may be performed in a different order than that shown in the embodiments and may still achieve the desired result. Furthermore, the processes depicted in the drawings do not necessarily require the specific or sequential order shown to achieve the desired result. In some embodiments, multitasking and parallel processing are possible or may be advantageous.
[0088] It should be noted that the above examples are merely specific embodiments of the present invention, and the present invention is obviously not limited to the above embodiments, with many similar variations. All modifications that can be directly derived or conceived by those skilled in the art from the content disclosed in this invention should fall within the protection scope of this invention.
Claims
1. A large model training method, comprising: obtaining a standard operating procedure text sample; inputting the standard operating procedure text sample into a target large model, and converting the standard operating procedure text sample into flowchart code adapted to syntax rules of a target editor by using the target large model; determining a first loss function according to flowchart code generated by the target large model and standard flowchart code of the standard operating procedure text sample; generating a flowchart according to the flowchart code generated by the target large model by using the target editor, and constructing a second loss function according to error information of the target editor when generating the flowchart; training the target large model by using the first loss function and the second loss function.
2. The method of claim 1, wherein the second loss function is constructed according to error information of the target editor when generating the flowchart, and specifically comprises: if the target editor generates an error when generating the flowchart, determining that a value of the second loss function is X, X being a constant greater than zero; if the target editor does not generate an error when generating the flowchart, determining that the value of the second loss function is 0.
3. The method of claim 1, further comprising: obtaining initial flowchart code of the standard operating procedure text sample; verifying the initial flowchart code by using the target editor and generating a corresponding flowchart; obtaining a logic error of the initial flowchart code verified by the target editor; modifying the initial flowchart code according to the logic error, and generating a new flowchart by the target editor according to the modified flowchart code; repeating the step until a logic represented by the new flowchart is consistent with a logic of the standard operating procedure text sample, and taking flowchart code at this time as standard flowchart code of the standard operating procedure text sample.
4. The method of claim 1, wherein the target large model is trained by using the first loss function and the second loss function, and specifically comprises: weighting the first loss function and the second loss function to obtain a total loss function; training the target large model by using the total loss function.
5. A data processing method, comprising: obtaining a standard operating procedure text to be processed; inputting the standard operating procedure text into a target large model pre-trained by using the method of any one of claims 1 to 4, and converting the standard operating procedure text into flowchart code adapted to syntax rules of a target editor by using the target large model; generating a flowchart by using the target editor according to flowchart code generated by the target large model.
6. A large model training device, comprising: a first data acquisition module configured to obtain a standard operating procedure text sample; The training module is configured to input the standard operating procedure text sample into a target large model, convert the standard operating procedure text sample into flowchart code adaptive to syntax rules of a target editor by using the target large model, determine a first loss function according to flowchart code generated by the target large model and standard flowchart code of the standard operating procedure text sample, generate a flowchart by using the target editor according to the flowchart code generated by the target large model, construct a second loss function according to error information of the target editor when the flowchart is generated, and train the target large model by using the first loss function and the second loss function.
7. The apparatus of claim 6, wherein the training module is specifically configured to: if the target editor generates an error when generating the flowchart, determine that a value of the second loss function is X, X being a constant greater than zero; if the target editor does not generate an error when generating the flowchart, determine that the value of the second loss function is 0.
8. The apparatus of claim 6, wherein the first data acquisition module is specifically configured to: acquire initial flowchart code of the standard operating procedure text sample; verify the initial flowchart code by using the target editor and generate a corresponding flowchart; acquire a logic error of the initial flowchart code verified by the target editor; modify the initial flowchart code according to the logic error and generate a new flowchart by using the target editor according to the modified flowchart code; repeat the step until a logic of the new flowchart generated is consistent with a logic of the standard operating procedure text sample, and acquire flowchart code at this time as standard flowchart code of the standard operating procedure text sample.
9. The apparatus of claim 6, wherein the training module is specifically configured to: weight the first loss function and the second loss function to obtain a total loss function; train the target large model by using the total loss function.
10. A data processing apparatus, comprising: a second data acquisition module configured to acquire a standard operating procedure text to be processed; a code generation module configured to input the standard operating procedure text into a target large model pre-trained by using a method in any one of claims 1 to 4, and convert the standard operating procedure text into flowchart code adaptive to syntax rules of a target editor by using the target large model; a flowchart generation module configured to generate a flowchart by using the target editor according to flowchart code generated by the target large model.
11. A computer readable storage medium, the computer readable storage medium storing a computer program, when the computer program is executed on an electronic device, causes the electronic device to execute a method in any one of claims 1 to 4, or execute a method in claim 5.
12. An electronic device, comprising: at least one memory configured to store a program; at least one processor configured to perform a program stored in the memory, the processor configured to perform the method of any one of claims 1 to 4, or the method of claim 5, when the program stored in the memory is executed.
Citation Information
Patent Citations
Code generation model training method based on feedback information
CN118860869A
Code generation model training method and electronic equipment
CN120822039A
Method and system for providing adaptive SOP according to emergent situation during SOP training
KR102395448B1