Method and system for fine-tuning a pre-trained language large model based on structured data

By fine-tuning the pre-trained large language model with structured data, the problem of fine-tuning structured data in the industrial field is solved, thereby reducing the difficulty of conversation generation and improving the adaptability of the model in the industrial field.

CN117271734BActive Publication Date: 2026-04-07CHONGQING CHANGAN TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-09-25
Publication Date
2026-04-07

AI Technical Summary

Technical Problem

Existing technologies cannot effectively address the need for fine-tuning structured data in industrial applications, resulting in significant challenges in session generation. Furthermore, pre-trained language models are unable to capture the semantic relationships between complex structured data.

Method used

By setting the input and output data of a pre-trained large language model, the features of structured data are obtained, preprocessed and converted into text data, generating training corpus containing output data, and then the model is fine-tuned using adaptive fine-tuning methods such as P-Tuning v2 to improve its generalization ability.

Benefits of technology

It effectively reduces the difficulty of session generation, meets the needs of structured data fine-tuning in the industrial field, and improves the adaptability and generalization ability of pre-trained language large models in the industrial field.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117271734B_ABST
    Figure CN117271734B_ABST
Patent Text Reader

Abstract

The application provides a method and system for fine-tuning a pre-trained language large model based on structured data, relates to the technical field of voice interaction, solves the fine-tuning requirement of structured data in the industrial field, and reduces the difficulty of conversation generation. First, the input data and output data of the pre-trained language large model are set. Then, the structured data containing the features of the input data is obtained. The structured data is preprocessed to obtain text data. Then, the training corpus containing the features of the output data is generated based on the text data. The pre-trained language large model is fine-tuned using the training corpus to obtain the fine-tuned pre-trained language large model for conversation generation. The application meets the fine-tuning requirement of structured data in the industrial field, improves the generalization ability of the pre-trained language large model, and effectively reduces the difficulty of conversation generation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the technical field of voice interaction, and in particular to a method and system for fine-tuning a pre-trained large language model based on structured data. Background Technology

[0002] In the field of natural language processing, conversation generation is an important task, aiming to generate human-like dialogues or responses through computer systems. To achieve more natural and fluent conversation generation, fine-tuning pre-trained language models has received widespread attention.

[0003] Currently, pre-trained language models have a certain ability to understand and recognize traditional text. However, in vertical fields, they cannot yet be applied to various product functions and require fine-tuning. At present, there are some excellent fine-tuning solutions, such as LORA and P-Tuning v2. However, in industrial scenarios, the data is usually related to various sensor signals, equipment parameters, and environmental parameters. For pre-trained language models, they have a certain cognitive ability to understand language, but for industrial data, or table data, they cannot associate the relationships between related data in the table, and therefore cannot utilize their learned knowledge.

[0004] Existing technology discloses a fine-tuning method for a pre-trained model. The pre-trained model comprises N Transformer layers and N fully connected layers, with each Transformer layer connected to a fully connected layer. The parameters of each fully connected layer are determined based on the parameters of the Transformer layers. The method identifies prompt words corresponding to the target downstream task based on a pre-trained database. The prompt words and the input text corresponding to the target downstream task are input into the pre-trained model to obtain the output. A loss value is calculated based on the output, and the parameters of the N fully connected layers are updated based on the loss value. However, this method only addresses the fine-tuning needs of prompt words and text data, failing to capture the relationships between complex structured data in industrial applications. It struggles to address the fine-tuning needs of structured data, particularly in the challenging task of recognizing and generating conversations using structured data. The existing technology also discloses a method for optimizing large models in dialogue scenarios. Based on keywords in a given descriptive domain, it obtains relevant corpora of the keywords and expands the concept set, aggregating resources to provide relevant knowledge resources. Based on user conversation history, it selects conversation rounds related to the keywords, extracts concepts from the dialogue in the conversation rounds, searches for relevant resources in the knowledge resource base based on the extracted concepts, and concatenates and integrates the conversation round text and the resources to construct a guiding text, which is used as input to a large-scale pre-trained language model. The output is the dialogue response for the corresponding conversation round. However, this method solves the fine-tuning needs of keyword data. When facing complex structured data in the industrial field, it cannot capture the complex semantic relationships between structured data, nor can it solve the fine-tuning needs of structured data. Summary of the Invention

[0005] To address the problem that existing conversation generation methods based on fine-tuning pre-trained language models cannot meet the fine-tuning requirements of structured data in industrial fields, thus making conversation generation difficult, this invention aims to provide a method and system for fine-tuning pre-trained language models based on structured data. This method meets the fine-tuning requirements of structured data in industrial fields and effectively reduces the difficulty of conversation generation by improving the generalization ability of the pre-trained language model.

[0006] To achieve the above-mentioned technical effects, the technical solution of the present invention is as follows:

[0007] A method for fine-tuning a pre-trained large language model based on structured data includes the following steps:

[0008] Define the input and output data for the pre-trained large language model;

[0009] Obtain structured data containing features of the input data;

[0010] The structured data is preprocessed to obtain text data;

[0011] Based on the text data, a training corpus containing features of the output data is generated;

[0012] The pre-trained language model is fine-tuned using the training corpus to obtain a fine-tuned pre-trained language model for conversation generation.

[0013] Furthermore, the input data consists of environmental parameters; the output data consists of corresponding conversation recommendations generated based on the input environmental parameters.

[0014] Furthermore, the structured data is tabular data, which contains features of the environmental parameters.

[0015] Furthermore, the environmental parameters include outside temperature, inside temperature, dew point temperature, windshield temperature, left-side light intensity, right-side light intensity, and relative humidity.

[0016] Furthermore, the preprocessing of the structured data specifically involves converting each piece of data in the structured data into contextual text data, which includes descriptive text of environmental parameters and dialogue description text.

[0017] Furthermore, the generation of training corpus containing features of the output data specifically includes:

[0018] Obtain the description text of the environmental parameters and the dialogue description text from the text data;

[0019] Based on the description text of the environmental parameters and the statements in the dialogue description text, execute the corresponding recommended actions;

[0020] The recommended action is converted into a conversation recommendation corresponding to the input environment parameters, and the conversation recommendation is denoted as the training corpus.

[0021] Furthermore, the training corpus is used as the training set for fine-tuning the pre-trained language model. An adaptive fine-tuning method is used to fine-tune the pre-trained language model using the training corpus, and the fine-tuned pre-trained language model is used for conversation generation.

[0022] Furthermore, conversation generation is performed using a finely tuned pre-trained language model, specifically including:

[0023] Obtain the structured data to be processed;

[0024] The individual data points in the structured data to be processed are converted into contextualized text data.

[0025] The text data obtained from the previous step is input into the fine-tuned pre-trained language model to output the conversation recommendation results.

[0026] This invention also proposes a system for fine-tuning a pre-trained large language model based on structured data, the system comprising:

[0027] The data setting module is used to set the input and output data of the pre-trained language large model;

[0028] The acquisition module is used to acquire structured data containing features of the input data;

[0029] The preprocessing module is used to preprocess the structured data to obtain text data;

[0030] The training corpus generation module is used to generate training corpus containing features of the output data based on the text data.

[0031] The fine-tuning module is used to fine-tune the pre-trained language model using the training corpus to obtain a fine-tuned pre-trained language model for conversation generation.

[0032] The present invention also proposes a computer device, comprising: a processor, a memory, a communication interface, and a communication bus, wherein the processor, the memory, and the communication interface communicate with each other through the communication bus;

[0033] The memory is used to store at least one executable instruction that causes the processor to perform operations as described in the method for fine-tuning a pre-trained language large model based on structured data.

[0034] Compared with the prior art, the beneficial effects of the technical solution of the present invention are:

[0035] This invention proposes a method and system for fine-tuning a pre-trained language model based on structured data. First, the input and output of the pre-trained language model are defined to determine which data should be used as input and output. Then, structured data containing features of the input data is acquired. This structured data is preprocessed to obtain text data, compensating for any gaps or inconsistencies between the structured data and the spoken text. Next, training corpus containing features of the output data is generated using the text data. This training corpus is then used to fine-tune the pre-trained language model. This invention transfers the problem of structured data in industry to the problem of spoken text, and then uses the pre-trained language model to assist in completing related functions. It transfers the capabilities of the pre-trained language model to the industrial field for related diagnostic, classification, or recommendation tasks. Compared to the fixed number of input features of traditional pre-trained language models, this invention can reduce or increase the number of input features, meeting the fine-tuning needs of structured data in the industrial field. By improving the generalization ability of the pre-trained language model, the difficulty of conversation generation is effectively reduced. Attached Figure Description

[0036] Figure 1 This is a flowchart illustrating a method for fine-tuning a pre-trained language large model based on structured data, as proposed in an embodiment of the present invention.

[0037] Figure 2 This is a schematic diagram illustrating the structure of a system based on fine-tuning a pre-trained language model using structured data, as proposed in this embodiment of the invention.

[0038] Figure 3 This is a schematic diagram of the structure of a computer device proposed in an embodiment of the present invention;

[0039] 210. Data setting module; 220. Acquisition module; 230. Preprocessing module; 240. Training corpus generation module; 250. Fine-tuning module; 301. Processor; 302. Memory; 303. Communication interface; 304. Communication bus; 305. Executable instructions. Detailed Implementation

[0040] The accompanying drawings are for illustrative purposes only and should not be construed as limiting the scope of this patent.

[0041] To better illustrate this embodiment, some parts of the accompanying drawings may be omitted, enlarged, or reduced, and do not represent actual dimensions. The descriptions of directions such as "up" and "down" are not intended to limit this patent.

[0042] It is understandable to those skilled in the art that some well-known details may be omitted from the accompanying drawings;

[0043] The positional relationships depicted in the accompanying drawings are for illustrative purposes only and should not be construed as limiting this patent.

[0044] The technical solution of the present invention will be further described below with reference to the accompanying drawings and embodiments.

[0045] like Figure 1 As shown, this embodiment proposes a method for fine-tuning a pre-trained large language model based on structured data, including the following steps:

[0046] S1: Set the input and output data for the pre-trained large language model;

[0047] In step S1, the input data is environmental parameters; the output data is the corresponding conversation recommendations generated based on the input environmental parameters. The main purpose of this step is to define which environmental parameters or knowledge the pre-trained language model uses as input, and which parameters the pre-trained language model needs to generate corresponding conversation recommendations based on the input environmental parameters, i.e., to provide relevant recommendations or results.

[0048] S2: Obtain structured data containing the features of the input data;

[0049] In step S2, referring to Table 1, the structured data is tabular data, which contains the characteristics of the environmental parameters. The environmental parameters include outside temperature AC_EnvironmentalTemp, inside temperature AC_IntemalTemp, dew point temperature RLSDewPoint, windshield temperature RLS_WindshieldTemp, left-side illuminance RLS_SolarLeft, right-side illuminance RLS_SolarRight, and relative humidity RLS_relativeHumidity. Table 1 only lists some signals and values, and is only used as an example in this embodiment. It does not list all signals. In actual applications, it includes but is not limited to the above tabular data. For example, the structured data in this embodiment also includes in-vehicle carbon dioxide concentration, in-vehicle PM2.5 concentration, vehicle speed, month, date, time, outside rainfall, and outside PM2.5 concentration.

[0050] Table 1. Structured Data Format

[0051] AC_EnvironmentalTemp AC_IntemalTemp RLS_DewPoint RLS_WindshieldTemp RLS_SolarLeft RLS_SolarRight RLS_relativeHumidity 3.5 3.5 -5.1 7.5 0 0 39 3.5 3.5 -5.1 7.5 0 0 39 3.5 10 -5.1 7.5 0 0 39 2 11.5 -5.1 7.5 0 0 39 3 13 -5.1 7.5 0 0 39 0.5 25 -5.8 1.5 5 5 57 1.5 26.5 -2.3 7 5 5 50 36.5 5.5 -4.9 3.5 0 0 52.5 2 27 -0.7 4 0 0 70 2.5 24.5 -0.3 4 0 0 70.5 2.5 24.5 -0.3 4 0 0 70.5 2.5 18.5 0 4 0 0 72 2 18.5 0 4 0 0 72 2 18.5 0 4 0 0 72 2 18.5 0 4 0 0 72 3 18.5 0 4 0 0 72 3.5 18.5 0 4 0 0 72 3.5 18.5 0.7 5 0 0 72 34 25 -3 5 0 0 55.5 5 19.5 1.5 5 0 0 61 4.5 19.5 -1.4 5 0 0 61.5 4 19.5 -1.4 5 0 0 61.5 3.5 19.5 -1 5.5 0 0 62 3 19.5 -1 5.5 0 0 62

[0052] S3: Preprocess the structured data to obtain text data;

[0053] In step S3, the Table-to-text method is used. This method converts tabular data into natural language text. In this method, the table is considered structured data, and the goal of text generation is to generate meaningful descriptive text based on the content and structure of the table. The structured data is preprocessed as follows: the Table-to-text method is used to convert each piece of data in the structured data into contextualized text data. This text data includes descriptive text of environmental parameters and dialogue description text. The descriptive text of environmental parameters is a contextualized description of the environmental parameters, and the dialogue description text is a dialogue description. Taking the environmental parameters in the second row of Table 1 as an example: the environmental parameters 3.5, 3.5, -5.1, 7.5, 0, 0, 39 in the second row of Table 1 are converted into contextualized text. The text data, "I am in a car. The original outside temperature is 1.0 degrees Celsius, the inside temperature is 3.5 degrees Celsius, the light intensity on the left is 0.0 lux, the light intensity on the right is 0.0 lux, the windshield temperature is 7.5 degrees Celsius, the engine is off, the dew point temperature inside the car is -5.1 degrees Celsius, the relative humidity inside the car is 39.0 RH, the carbon dioxide concentration inside the car is 0.0 ppm, the PM2.5 concentration inside the car is 1023.0 ug / m3, the car speed is 0.0 km / h, the current month is January, the current date is the 9th, the current hour is 3 o'clock, the outside rainfall intensity is 0.0 level, and the outside PM2.5 concentration is 1023.0 ug / m3. Please recommend a suitable car air conditioning setting for me.", is used as input to a pre-trained language model.

[0054] S4: Based on the text data, generate training corpus containing features of the output data;

[0055] Step S4, generating training corpus containing features of the output data, specifically includes:

[0056] S41: Obtain the description text of the environment parameters and the dialogue description text from the text data;

[0057] S42: Based on the description of environmental parameters and the statements in the dialogue description text, "I am currently in a car. The original outside temperature is 1.0 degrees Celsius, the outside temperature is 3.5 degrees Celsius, the inside temperature is 3.5 degrees Celsius, the left-side light intensity is 0.0 lux, the right-side light intensity is 0.0 lux, the windshield temperature is 7.5 degrees Celsius, the engine is off, the inside dew point temperature is -5.1 degrees Celsius, the inside relative humidity is 39.0 RH, the inside carbon dioxide concentration is 0.0 ppm, the inside PM2.5 concentration is 1023.0 ug / m3, the car speed is 0.0 KM / H, and the current month is..." In January, the current date is the 9th, the current hour is 3:00, the rainfall intensity outside the car is 0.0, and the PM2.5 concentration outside the car is 1023.0 ug / m3. Please recommend a suitable car air conditioning setting for me. Execute the corresponding recommended action; executing the corresponding recommended action means setting the air conditioning data in Table 2. In Table 2, AC_DriverReqTemp is the driver's temperature setting, AC_FrReqWindLevel is the driver's fan speed setting, AC_FrBlowType is the driver's airflow mode setting, AC_RecycleType is the air conditioning internal / external circulation setting, and AC_ACSt is the AC on status.

[0058] Table 2 Air Conditioner Setting Data Table

[0059] AC_D_riverReqTemp AC_FrReqWind_Level AC_FrBlowType AC_RecycleType AC_ACSt 25 0 1 1 0 25 0 1 1 0 25 0 1 1 0 25 0 1 1 0 25 0 1 1 0 25 6 1 1 0 25 0 1 1 0 25 0 1 0 0 25 6 1 1 1 25 6 1 1 1 25 6 1 1 1 25 6 1 1 1 25 6 1 1 1 25 6 1 1 1 25 6 1 1 1 25 6 1 1 1 25 6 1 1 1

[0060] S43: The recommended action, i.e., the air conditioning setting data in Table 2, taking the second row of data in Table 2 as an example, is converted into a conversation recommendation corresponding to the input environmental parameters: "Based on your description, the current recommended car air conditioning settings for you are: air conditioning is off, driver fan speed is 0.0, driver temperature is 25.0 degrees Celsius, air conditioning compressor is off, driver airflow mode is blowing on face and feet, air conditioning internal / external circulation mode is external circulation, defrost status is off. The above are the recommended air conditioning settings for you." This is the answer from the pre-trained language model. All data in Table 2 is converted using this method until all data in Table 2 is converted. The conversation recommendation is then referred to as the training corpus.

[0061] In step S4, based on the meaning of each environmental parameter in Table 1, the Chinese meaning of each environmental parameter in Table 1 is told to the pre-trained language model. Then, the pre-trained language model is told that in the state of Table 1, the corresponding air conditioning setting data state in Table 2 should be output, so that the pre-trained language model knows what kind of air conditioning setting state in Table 2 should be output in the state of Table 1.

[0062] S5: Fine-tune the pre-trained language model using the training corpus to obtain a fine-tuned pre-trained language model for conversation generation.

[0063] In pre-trained language models, the training corpora all have certain logical relationships. When the same word appears in different positions in a sentence, the pre-trained language model can understand the resulting change in meaning. However, for structured data (tabular data), the presentation of features does not have a logical relationship. It is only necessary to ensure that each column and row is consistent with the title. Pre-trained language models have general world cognition capabilities, but for vertical domains, fine-tuning is required to obtain better performance. Pre-trained language models are trained using sequential language sequences. However, in most industrial fields, data is presented as structured data. Traditional pre-trained language models are trained using an autoregressive approach. Structured data differs from traditional pre-trained language models; directly using tables in a traditional model would result in significant gaps, preventing the model from utilizing its existing knowledge and understanding new information. Therefore, this embodiment uses training corpus obtained after processing structured data to fine-tune the pre-trained language model. Specifically, the training corpus is used as the training set for fine-tuning the model, and the P-Tuning v2 adaptive fine-tuning method is employed. P-Tuning v2 is a fine-tuning technique for pre-trained language models designed to improve their adaptability and generalization performance. In P-Tuning v2, the pre-trained language model is fine-tuned using a small number of labeled samples for one or more specific tasks to enhance its learning ability for those tasks. Unlike traditional fine-tuning methods, P-Tuning v2 employs a parameterized approach to fine-tuning the pre-trained language model. Specifically, P-Tuning v2 introduces a dedicated fine-tuning network that connects to the pre-trained language model by sharing its embedding layers and some parameters. This ensures that the parameters of the pre-trained language model remain unchanged during fine-tuning, while only the parameters of the fine-tuning network are adjusted. This parameterized approach allows the pre-trained language model to better adapt to task-specific data and features, while reducing its dependence on large-scale labeled data and improving its generalization performance. The fine-tuned pre-trained language model is then used for conversation generation, specifically including:

[0064] Obtain the structured data to be processed;

[0065] The individual data points in the structured data to be processed are converted into contextualized text data.

[0066] The text data obtained from the previous step is input into the fine-tuned pre-trained language model to output the conversation recommendation results.

[0067] See Figure 3 Before fine-tuning, the pre-trained language model was given the following text data: "I am in a car. The original outside temperature is 28.0 degrees Celsius, the inside temperature is 47.0 degrees Celsius, the light intensity on the left is 300.0 lux, the light intensity on the right is 300.0 lux, the windshield temperature is 18.0 degrees Celsius, the engine operating status is unknown, the dew point temperature inside the car is 22.0 degrees Celsius, the relative humidity inside the car is 49.0 RH, the carbon dioxide concentration inside the car is 0.0 ppm, the PM2.5 concentration inside the car is 0.0 ug / m3, the car speed is 0.0 KM / H, the current month is July, the current date is the 19th, the current hour is 3 o'clock, the outside rainfall intensity is level 1.0, and the outside PM2.5 concentration is 0.0 ug / m3. Please recommend a suitable car air conditioning setting for me." The pre-trained language model responded as follows:

[0068] "Based on the information provided, a suitable car air conditioning setting should be able to maintain the comfort and dryness of the vehicle's interior temperature to the maximum extent. Here are some suggestions:"

[0069] 1. Temperature Adjustment: Adjust the interior temperature to the most comfortable range. Depending on the vehicle model and driving speed, it is recommended to set the temperature control system between 25-30 degrees Celsius.

[0070] 2. Wind Speed: Choosing an appropriate wind speed can keep the air fresh and comfortable. It is recommended to choose a low-speed, natural wind mode and avoid using high-speed, strong wind modes to prevent the air inside the car from becoming too dry.

[0071] 3. Humidity control: The humidity control system of the air conditioner is also very important to maintain the comfort and dryness of the air inside the car. It is recommended to select medium speed and horizontal humidity control mode, and avoid using high speed and high humidity mode to prevent the air inside the car from becoming too humid.

[0072] 4. Air freshener: Using an air freshener can increase the freshness and comfort of the air inside the car. It is recommended to choose air fresheners and perfumes to meet the needs of different people.

[0073] 5. Turn off the air conditioner when parking: If the parking time exceeds a certain period of time, it is recommended to turn off the air conditioner to prevent the air inside the car from becoming humid and stale.

[0074] Hopefully, these suggestions will help you choose the right car air conditioning settings and enjoy a more comfortable driving experience.

[0075] It is evident that the answers provided by the pre-trained language model are not specific and cannot guide actual production and daily life. After fine-tuning using the method proposed in this embodiment, which is based on structured data to fine-tune the pre-trained language model, the conversation generation of the pre-trained language model is as follows:

[0076] When the input text data to the pre-trained language model is: "I am in a car. The current original outside temperature is 16.0 degrees Celsius, the inside temperature is 21.0 degrees Celsius, the light intensity on the left is 300.0 lux, the light intensity on the right is 300.0 lux, the windshield temperature is 18.0 degrees Celsius, the engine operating status is unknown, the inside dew point temperature is 22.0 degrees Celsius, the relative humidity inside the car is 49.0 RH, the carbon dioxide concentration inside the car is 0.0 ppm, the PM2.5 concentration inside the car is 0.0 ug / m3, the car speed is 0.0 KM / H, the current month is April, the current date is the 2nd, the current hour is 1 o'clock, the outside rainfall intensity is 0.0 level, and the outside PM2.5 concentration is 0.0 ug / m3. Please recommend a suitable car air conditioning setting for me."

[0077] The pre-trained language model responded to the above input text data as follows: "Based on your description, the recommended car air conditioning settings are: air conditioning is on / off, driver fan speed is 0.0, driver temperature is 27.0 degrees Celsius, air conditioning compressor is off, front airflow mode is unknown, air conditioning internal / external circulation is external circulation, defrost is off. These are the recommended air conditioning settings for you."

[0078] When the input text data to the pre-trained language model is: "I am in a car. The current outside temperature is 16.0 degrees Celsius, the inside temperature is 21.0 degrees Celsius, and the inside temperature is 26.0 degrees Celsius. Please recommend a suitable car air conditioning setting for me."

[0079] The pre-trained language model responded to the above input text data as follows: "Based on your description, the recommended car air conditioning settings are as follows: air conditioning is off, driver fan speed is 0.0, driver temperature is 25.5 degrees Celsius, air conditioning compressor is off, front airflow mode is unknown, air conditioning internal / external circulation mode is external circulation, and defrost is off. These are the recommended air conditioning settings for you."

[0080] The fine-tuned pre-trained language model can provide specific settings and is already able to guide the input of the downstream controller based on these values.

[0081] This embodiment proposes a method and system for fine-tuning a pre-trained language model based on structured data. First, the input and output of the pre-trained language model are defined to determine which data should be used as input and output. Then, structured data containing features of the input data is obtained. This structured data is preprocessed to obtain text data, which compensates for any gaps or inconsistencies between the structured data and the language text, thus solving the problem of gaps or discrepancies between them. Next, training corpus containing features of the output data is generated using the text data. The pre-trained language model is then fine-tuned using the training corpus, and finally, the fine-tuned pre-trained language model is used for conversation generation. This invention transfers the structured data problem in industry to the language and text problem, and then uses a pre-trained language model to assist in completing related functions. It transfers the capabilities of the pre-trained language model to the industrial field for related diagnostic, classification, or recommendation tasks. Compared to the fixed number of input features of traditional pre-trained language models, this invention can reduce or increase the number of input features, meeting the fine-tuning needs of structured data in the industrial field. By improving the generalization ability of the pre-trained language model, it effectively reduces the difficulty of conversation generation. It should be noted that the method of fine-tuning a pre-trained language model based on structured data proposed in this embodiment has the advantage of being applicable to any industrial field, as all signals can be expressed through Chinese meaning. Furthermore, using the pre-trained language model, some prior knowledge can be used to correct noisy data or provide reasonable answers. And because tabular data is converted into sequence-to-sequence form for input and output, the pre-trained language model does not require a fixed number of input features, and can provide a relatively reasonable recommendation result even with limited signals. Similarly, additional auxiliary signals beyond the current training data can be provided, allowing the pre-trained language model to use extra information to assist in result inference.

[0082] This embodiment also proposes a system 200 based on fine-tuning a pre-trained language large model using structured data, see [link to system 200]. Figure 2 The system includes:

[0083] The data setting module 210 is used to set the input and output data of the pre-trained language large model;

[0084] The acquisition module 220 is used to acquire structured data containing features of the input data;

[0085] Preprocessing module 230 is used to preprocess the structured data to obtain text data;

[0086] The training corpus generation module 240 is used to generate training corpus containing features of the output data based on the text data.

[0087] The fine-tuning module 250 is used to fine-tune the pre-trained language model using the training corpus to obtain a fine-tuned pre-trained language model for conversation generation.

[0088] In this embodiment, the input and output of the pre-trained language model are first defined to determine which data serves as the input and output. Then, structured data containing features of the input data is acquired. This structured data is preprocessed to obtain text data, compensating for any gaps or inconsistencies between the structured data and the spoken text. Next, training corpus containing features of the output data is generated using the text data. The pre-trained language model is then fine-tuned using this training corpus, and finally, conversation generation is performed using the fine-tuned pre-trained language model. This invention transfers the problem of structured data in industry to the problem of spoken text, and then uses the pre-trained language model to assist in completing related functions. It transfers the capabilities of the pre-trained language model to the industrial field, enabling related diagnostic, classification, or recommendation tasks in the industrial domain. Compared to the fixed number of input features of traditional pre-trained language models, this invention can reduce or increase the number of input features, meeting the fine-tuning needs of structured data in the industrial field. By improving the generalization ability of the pre-trained language model, the difficulty of conversation generation is effectively reduced.

[0089] This embodiment also proposes a computer device, see [link to documentation]. Figure 3 It includes: a processor 301, a memory 302, a communication interface 303 and a communication bus 304, wherein the processor 301, the memory 302 and the communication interface 303 communicate with each other through the communication bus 304;

[0090] The processor 301, memory 302, and communication interface 303 communicate with each other via communication bus 304. Communication interface 303 is used to communicate with other network elements, such as clients or other servers. The processor 301 executes executable instructions 305, specifically the relevant steps in the above-described method embodiment based on fine-tuning a pre-trained language model using structured data.

[0091] Specifically, executable instructions 305 may include program code. Processor 301 may be a central processing unit (CPU), an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement embodiments of the present invention. The computer device may include one or more processors of the same type, such as one or more CPUs; or it may include processors of different types, such as one or more CPUs and one or more ASICs.

[0092] Memory 302 is used to store executable instructions 305. Memory 302 may include high-speed RAM memory, and may also include non-volatile memory, such as at least one disk storage device.

[0093] Executable instruction 305 can be invoked by processor 301 to cause the computer device to perform the following operations:

[0094] Define the input and output data for the pre-trained large language model;

[0095] Obtain structured data containing features of the input data;

[0096] The structured data is preprocessed to obtain text data;

[0097] Based on the text data, a training corpus containing features of the output data is generated;

[0098] The pre-trained language model is fine-tuned using the training corpus to obtain a fine-tuned pre-trained language model for conversation generation.

[0099] Conversation generation is performed using a finely tuned pre-trained language model.

[0100] In this embodiment, the input and output of the pre-trained language model are first defined to determine which data serves as the input and output. Then, structured data containing features of the input data is acquired. This structured data is preprocessed to obtain text data, compensating for any gaps or inconsistencies between the structured data and the spoken text. Next, training corpus containing features of the output data is generated using the text data. The pre-trained language model is then fine-tuned using this training corpus, and finally, conversation generation is performed using the fine-tuned pre-trained language model. This invention transfers the problem of structured data in industry to the problem of spoken text, and then uses the pre-trained language model to assist in completing related functions. It transfers the capabilities of the pre-trained language model to the industrial field, enabling related diagnostic, classification, or recommendation tasks in the industrial domain. Compared to the fixed number of input features of traditional pre-trained language models, this invention can reduce or increase the number of input features, meeting the fine-tuning needs of structured data in the industrial field. By improving the generalization ability of the pre-trained language model, the difficulty of conversation generation is effectively reduced.

[0101] Obviously, the above embodiments of the present invention are merely examples for clearly illustrating the present invention, and are not intended to limit the implementation of the present invention. Those skilled in the art will recognize that other variations or modifications can be made based on the above description. It is neither necessary nor possible to exhaustively describe all possible implementations here.

Claims

1. A method for fine-tuning a pre-trained large language model based on structured data, characterized in that, Includes the following steps: The input and output data of the pre-trained language model are defined. The input data consists of environmental parameters, including outside temperature, inside temperature, dew point temperature, windshield temperature, left-side light intensity, right-side light intensity, and relative humidity. The output data consists of corresponding conversation recommendations generated based on the input environmental parameters. Obtain structured data containing features of the input data, wherein the structured data is tabular data and the tabular data contains features of the environmental parameters; The structured data is preprocessed to obtain text data. The specific preprocessing process is as follows: each piece of data in the structured data is converted into text data with context. The text data includes descriptive text of environmental parameters and dialogue descriptive text. Based on the text data, a training corpus containing features of the output data is generated, specifically including: Obtain the description text of the environmental parameters and the dialogue description text from the text data; Based on the description text of the environmental parameters and the statements in the dialogue description text, execute the corresponding recommended actions; The recommended action is converted into a conversation recommendation corresponding to the input environment parameters, and the conversation recommendation is denoted as the training corpus. The pre-trained language model is fine-tuned using the training corpus to obtain a fine-tuned pre-trained language model for conversation generation.

2. The method for fine-tuning a pre-trained language model based on structured data according to claim 1, characterized in that, The training corpus is used as the training set for fine-tuning the pre-trained language model. An adaptive fine-tuning method is used to fine-tune the pre-trained language model using the training corpus. The fine-tuned pre-trained language model is then used for conversation generation.

3. The method for fine-tuning a pre-trained language model based on structured data according to claim 2, characterized in that, Conversation generation is performed using a finely tuned pre-trained language model, specifically including: Obtain the structured data to be processed; The individual data points in the structured data to be processed are converted into contextualized text data. The text data obtained from the previous step is input into the fine-tuned pre-trained language model to output the conversation recommendation results.

4. A system for fine-tuning a pre-trained language model based on structured data, characterized in that, The system includes: The data setting module is used to set the input and output data of the pre-trained language model. The input data are environmental parameters, including outside temperature, inside temperature, dew point temperature, windshield temperature, left-side light intensity, right-side light intensity, and relative humidity. The output data is the generation of corresponding conversation recommendations based on the input environmental parameters. The acquisition module is used to acquire structured data containing features of the input data, wherein the structured data is tabular data and the tabular data contains features of the environmental parameters; The preprocessing module is used to preprocess the structured data to obtain text data. The specific preprocessing process is as follows: convert each piece of data in the structured data into text data with context. The text data includes descriptive text of environmental parameters and dialogue descriptive text. The training corpus generation module is used to generate training corpus containing features of the output data based on the text data, specifically including: Obtain the description text of the environmental parameters and the dialogue description text from the text data; Based on the description text of the environmental parameters and the statements in the dialogue description text, execute the corresponding recommended actions; The recommended action is converted into a conversation recommendation corresponding to the input environment parameters, and the conversation recommendation is denoted as the training corpus. The fine-tuning module is used to fine-tune the pre-trained language model using the training corpus to obtain a fine-tuned pre-trained language model for conversation generation.

5. A computer device, characterized in that, include: The processor, memory, communication interface, and communication bus are provided, wherein the processor, memory, and communication interface communicate with each other via the communication bus. The memory is used to store at least one executable instruction that causes the processor to perform the operation of the method for fine-tuning a pre-trained language large model based on structured data as described in any one of claims 1-3.

Citation Information

Patent Citations

  • Knowledge base query method and device, electronic equipment and storage medium

    CN116737879A