Context-aware model generation method and system based on natural language interaction
By processing multimodal data and dynamically adjusting the model, the problem of insufficient multimodal data integration in low-code platforms is solved, and efficient and accurate code generation and context-aware model construction are achieved.
Patent Information
- Application Number
- CN202511300763.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-12
- Publication Date
- 2025-12-09
- Estimated Expiration
- 2045-09-12
AI Technical Summary
Existing low-code platforms only support text input during code development and do not integrate multimodal data such as images and voice, resulting in low accuracy and efficiency.
By acquiring multimodal input data (text, image, voice), structured intent data is generated, which is then used to generate structured business logic data. A context-aware model is built based on real-time business data, and models such as Transformer, ChatGLM3, BERT, and GPT are used for data processing and logic generation. The activation function is dynamically adjusted to adapt to different business needs.
It significantly improves the model's flexibility and generalization ability, enhances the accuracy of understanding in complex interactive environments and the efficiency of code generation, and ensures the simplicity and accuracy of the generated results.
Smart Images

Figure CN120804636B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application belongs to the technical field of model-driven development and artificial intelligence integration, and specifically relates to a context-aware model generation method and system based on natural language interaction. BACKGROUND
[0002] In today's increasingly intelligent human-computer interaction, natural language interaction has become the core bridge connecting humans and digital systems. However, traditional interaction models are often limited to literal understanding of isolated sentences, lacking deep perception of context information such as user intent, environmental state, and conversation history, resulting in rigid interaction experience and inaccurate responses. With the development of technology, the combination of low-code platforms and AI model-driven development has entered a mature stage, but it has not yet fully realized the complete automation of "what you say, you get". Currently, some low-code platforms can support natural language processing functions, allowing users to generate forms or processes through natural language descriptions of requirements. Some low-code platforms have implemented model-driven development, shortening the development cycle through visual modeling and automated code generation.
[0003] The prior art often only supports text input when developing a low-code platform, without integrating the input of multi-modal data such as images and speech, resulting in low accuracy and efficiency when developing code. Therefore, the model for low-code generation still needs further improvement. SUMMARY
[0004] The present application aims to at least solve one of the technical problems existing in the prior art. To this end, the present application proposes a context-aware model generation method and system based on natural language interaction to solve the technical problem that the prior art often only supports text input, without integrating the input of multi-modal data such as images and speech, resulting in low accuracy and efficiency when developing code.
[0005] To achieve the above-mentioned purpose, the first aspect of the present application provides a context-aware model generation method based on natural language interaction, comprising:
[0006] Obtaining multi-modal input data and real-time business data; the multi-modal input data refers to input data of different modalities, including text, images, and speech;
[0007] Generating structured intent data based on multi-modal input data; the structured intent data refers to the result obtained after structuring the multi-modal input data;
[0008] Generating structured business logic data based on structured intent data; the structured business logic data refers to business logic data obtained by structuring the structured intent data according to the corresponding standard;
[0009] Generate a context-aware model based on structured business logic data and real-time business data.
[0010] The present application fuses and analyzes multi-modal data such as text, images, and voice through the above steps, extracts structured intent information and business logic data, optimizes and iterates the model based on this, and finally constructs a context-aware model that can adapt to various business scenarios, significantly enhancing the flexibility and generalization ability of the model, not only improving its understanding accuracy in complex and dynamic interactive environments, but also effectively improving the efficiency and reliability of the model in code generation and development.
[0011] Further, the structured intent data based on the multi-modal input data comprises:
[0012] The multi-modal input data is uniformly encoded using a Transformer algorithm to obtain a multi-modal feature vector;
[0013] The multi-modal feature vector is preprocessed and standardized to obtain a preprocessed multi-modal feature vector; the data preprocessing and standardization operation includes tokenization, cleaning, and vectorization operation;
[0014] The preprocessed multi-modal feature vector is input into an intent recognition model to obtain an intent category; the intent recognition model is constructed by a ChatGLM3 model and is used to identify the intent category of the multi-modal input data;
[0015] The preprocessed multi-modal feature vector is input into a sequence labeling model to obtain an intent feature; the sequence labeling model is constructed by a BERT model and is used to extract the intent feature corresponding to the current intent category;
[0016] The structured intent data is determined according to the intent category and the intent feature.
[0017] When analyzing the intent of the input multi-modal data, the present application uses data preprocessing and other operations to preliminarily process the multi-modal data, so that the multi-modal data can be more concise and accurate in subsequent processing. At the same time, two pre-trained intent recognition models and sequence labeling models are used to obtain the intent category and intent feature corresponding to the multi-modal input data, and the intent category and intent feature together constitute the structured intent data, providing standardized data support for the generation of subsequent structured business logic data, and improving the accuracy of the structured business logic data.
[0018] Further, the structured business logic data based on the structured intent data comprises:
[0019] Extracting the intent category in the structured intent data;
[0020] Obtaining a business rule base and historical approval records based on the intent category;
[0021] Splicing the structured intent data, the business rule base and the historical approval records into intent analysis data;
[0022] Inputting the intent analysis data into an intent model to obtain a business logic vector; the business logic vector is a quantitative decision factor of a business scenario, and provides dynamic parameter constraints for subsequent business logic generation; the intent model is used for generating a business logic vector corresponding to the current structured intent data;
[0023] Extracting a specification target in the intent feature;
[0024] Determining a specification syntax constraint based on the specification target;
[0025] Splicing the structured intent data, the business logic vector and the specification syntax constraint into logic analysis data;
[0026] Inputting the logic analysis data into a business logic generation model to obtain structured business logic data; the business logic generation model is constructed through a GPT model, and is used for generating structured business logic data corresponding to the structured intent data.
[0027] The application obtains data such as a business rule base corresponding to a current intent category, and obtains a business logic vector corresponding to current structured intent data through a pre-trained intent model. These business logic vectors play a constraint role on subsequently generated structured business logic data, improve the accuracy of the structured business logic data, and dynamically adjust the activation function of the model when generating structured business logic data by using a pre-trained business logic generation model, so that the structured business logic data is more in line with actual requirements, and the accuracy of the structured business logic data is improved.
[0028] Further, the intent model is constructed by the following methods, including:
[0029] Obtaining a plurality of historical intent analysis data and historical business logic vectors corresponding thereto;
[0030] Dividing the plurality of historical intent analysis data and the historical business logic vectors corresponding thereto into training data, verification data and test data; performing data preprocessing on the training data, the verification data and the test data to obtain a training set, a verification set and a test set;
[0031] Selecting an artificial intelligence model as a base model;
[0032] Training the base model through the training set, and adjusting the learning rate and the hyperparameters on the verification set to obtain a pre-trained model;
[0033] The pre-training model is verified on the test set, and finally an intent model with input of intent analysis data and output of business logic vector is obtained.
[0034] Further, the specification target-based specification syntax constraint includes:
[0035] The specification target includes SQL and REST API.
[0036] When the specification target is SQL, the specification syntax constraint is set to SQL specification constraint.
[0037] When the specification target is REST API, the specification syntax constraint is set to REST API specification constraint.
[0038] Further, the business logic generation model is constructed by a GPT model, including:
[0039] Obtain a plurality of historical logic analysis data and corresponding historical structured business logic data;
[0040] The plurality of historical logic analysis data and corresponding historical structured business logic data are divided into training data, validation data and test data; the training data, validation data and test data are preprocessed to obtain a training set, a validation set and a test set.
[0041] Select a GPT model as a base model.
[0042] The base model is trained by the training set, and the learning rate and hyperparameters are adjusted on the validation set to obtain a pre-training model.
[0043] The pre-training model is verified on the test set, and finally a business logic generation model with input of logic analysis data and output of structured business logic data is obtained.
[0044] Further, the input of the logic analysis data into the business logic generation model to obtain the structured business logic data includes:
[0045] Extract the specification syntax constraint in the logic analysis data.
[0046] Extract a plurality of Transformer decoders in the business logic generation model; the Transformer decoder includes a multi-head attention layer and a feedforward neural network layer.
[0047] When the specification syntax constraint is a SQL specification constraint, it is judged whether the activation function in the current feedforward neural network layer is a linear activation function; if yes, no operation is performed; if no, the activation function corresponding to the feedforward neural network layer is set to a linear activation function.
[0048] When the specification syntax constraint is a REST API specification constraint, it is determined whether the activation function in the current feedforward neural network layer is a nonlinear activation function; if yes, no operation is performed; if no, the activation function corresponding to the feedforward neural network layer is set to a nonlinear activation function.
[0049] In the process of generating structured business logic data, the application dynamically adjusts the activation function of the business logic generation model based on the specification target extracted from the multi-modal input data, realizes the adaptive regulation of the nonlinear expression ability of the model, breaks through the inflexibility problem caused by the use of fixed structure and static conversion rules in traditional model-driven development, effectively supports cross-scene and cross-target structured business logic generation; through the dynamic optimization of the activation function, the model can more accurately capture the subtle differences between different business requirements, improve the compactness and semantic consistency of the logic expression, thereby significantly enhancing the simplicity and accuracy of the generated results, providing a more adaptive technical path for building an efficient and intelligent context-aware system.
[0050] Further, the generation of the context-aware model based on the structured business logic data and the real-time business data comprises:
[0051] Obtaining an intent model and its corresponding business logic vector;
[0052] Loading the business logic vector of the intent model as the initial parameters of the context-aware model;
[0053] Compiling the structured business logic data into an executable component and associating it with the context-aware model;
[0054] Performing state vector standardization operation on the real-time business data to obtain a state vector; the real-time business data includes inventory status and approval authority;
[0055] Generating a state action according to the PPO algorithm;
[0056] Analyzing the state action and modifying the initial parameters of the context-aware model through the PPO algorithm to obtain the context-aware model.
[0057] The final purpose of the application is to obtain a comprehensive and efficient context-aware model, combine the real-time generated structured business logic data and real-time business data, and optimize the existing intent model through reinforcement learning method to obtain the final context-aware model, so that the context-aware model can be adjusted to the optimal state in real time, improve the generalization ability and accuracy of the context-aware model, and provide strong support for the accurate and efficient generation of structured business logic data.
[0058] The second aspect of the application provides a context-aware model generation system based on natural language interaction, comprising: a data acquisition module and a data analysis module; the data acquisition module and the data analysis module are connected;
[0059] The data acquisition module: acquires multi-modal input data and real-time business data through a data acquisition device;
[0060] The data analysis module comprises a data analysis unit and a model generation unit;
[0061] The data analysis unit: generates structured intent data based on multi-modal input data; generates structured business logic data based on structured intent data;
[0062] The model generation unit: generates a context-aware model based on structured business logic data and real-time business data.
[0063] Another aspect of the application provides a computer-readable storage medium, the computer-readable storage medium stores a computer program, the computer program is executed by a processor to realize the context-aware model generation system based on natural language interaction according to the second aspect of the application.
[0064] Compared with the prior art, the application has the following advantages:
[0065] 1、The application generates structured intent data based on multi-modal input data; generates structured business logic data based on structured intent data; generates a context-aware model based on structured business logic data and real-time business data, analyzes multi-modal data such as text, image and voice to determine structured intent data and business logic data, and optimizes the model to obtain a final context-aware model that can meet the needs of multiple businesses, improves the flexibility and generalization ability of the model, and further improves the accuracy and efficiency of the model during code development.
[0066] 2、In the process of generating structured business logic data, the application dynamically adjusts the activation function in the business logic generation model based on the specification target in the multi-modal input data, realizes the generation of structured business logic data across targets, avoids the efficiency loss caused by static model conversion in traditional model-driven development, and improves the simplicity and accuracy of the structured business logic data.
[0067] 3, The final purpose of the application is to obtain a comprehensive and efficient context awareness model, combine the real-time generated structured business logic data and real-time business data, optimize the existing intent model through reinforcement learning method to obtain the final context awareness model, so that the context awareness model can be adjusted to the optimal state in real time, improve the generalization ability and accuracy of the context awareness model, and provide strong support for accurate and efficient generation of structured business logic data. BRIEF DESCRIPTION OF DRAWINGS
[0068] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the drawings needed to be used in the embodiments or prior art description will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor.
[0069] Figure 1 The flow chart of the context awareness model generation method based on natural language interaction of the present application;
[0070] Figure 2 The principle schematic diagram of the context awareness model generation system based on natural language interaction of the present application. DETAILED DESCRIPTION
[0071] The technical solutions of the present application will be described in detail below in conjunction with the embodiments. Obviously, the described embodiments are only some of the embodiments of the present application, not all. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor are within the scope of protection of the present application.
[0072] Please refer to Figure 1 The first aspect embodiment of the present application provides a context awareness model generation method based on natural language interaction, comprising:
[0073] Obtaining multi-modal input data and real-time business data; multi-modal input data refers to input data of different modalities, including text, image and voice;
[0074] Generating structured intent data based on multi-modal input data; structured intent data refers to the result obtained after structured operation on multi-modal input data;
[0075] Generating structured business logic data based on structured intent data; structured business logic data refers to business logic data obtained by structured intent data according to corresponding standards;
[0076] Generating context awareness model based on structured business logic data and real-time business data.
[0077] The structured intent data is generated based on the multi-modal input data in this embodiment, which includes:
[0078] The multi-modal input data is uniformly encoded using a Transformer algorithm to obtain a multi-modal feature vector;
[0079] The multi-modal feature vector is pre-processed and standardized to obtain a pre-processed multi-modal feature vector. The data pre-processing and standardization operations include tokenization, cleaning, and vectorization operations. In this embodiment, data pre-processing and standardization operations are used to convert unstructured data into a format that can be processed to facilitate subsequent fast and accurate operations;
[0080] The pre-processed multi-modal feature vector is input into an intent recognition model to obtain an intent category. The intent recognition model is constructed by ChatGLM3 model, which is used to identify the intent category of the multi-modal input data. The intent recognition model in this embodiment is a pre-trained model, and its training process is consistent with the training process of a general classification model;
[0081] The pre-processed multi-modal feature vector is input into a sequence labeling model to obtain an intent feature. The sequence labeling model is constructed by a BERT model, which is used to extract the intent feature corresponding to the current intent category. In this embodiment, the sequence labeling model is obtained by adding a task-specific linear layer to the pre-trained BERT model and then fine-tuning it on relevant data;
[0082] The structured intent data is determined according to the intent category and the intent feature.
[0083] When analyzing the input multi-modal data, the original data is first pre-processed and standardized to effectively improve the standardization and consistency of the data, making the multi-modal information more concise, efficient and accurate in subsequent processing. On this basis, the pre-trained intent recognition model and sequence labeling model are called respectively to jointly analyze the processed data and accurately identify the intent category and its fine-grained intent feature corresponding to the input content. These two types of information together constitute structured intent data, which is a key input for generating structured business logic data. By introducing standardized and structured intent expressions, the accuracy and reliability of business logic data generation are significantly improved, laying a solid data foundation for building high-precision context-aware models.
[0084] The structured business logic data is generated based on the structured intent data in this embodiment, which includes:
[0085] The intent category in the structured intent data is extracted;
[0086] obtain a business rule base and historical approval records based on the intent category;
[0087] splice the structured intent data, the business rule base and the historical approval records into intent analysis data;
[0088] input the intent analysis data into an intent model to obtain a business logic vector; the business logic vector is a quantitative decision factor of a business scenario, and provides dynamic parameter constraints for subsequent business logic generation; the intent model is used to generate a business logic vector corresponding to the current structured intent data;
[0089] extract a specification target in the intent feature; in this embodiment, the specification target refers to a target result that needs which, for example, a SQL statement generated from the multi-modal input data, or a REST API statement generated from the multi-modal input data;
[0090] determine a specification syntax constraint based on the specification target; in this embodiment, different specification targets have unique syntax constraint conditions, because when generating the required structured business logic data, the specification syntax constraint corresponding to the specification target is needed to make the final structured business logic data more accurate, and improve the accuracy and efficiency of the final context-aware model;
[0091] splice the structured intent data, the business logic vector and the specification syntax constraint into logic analysis data;
[0092] input the logic analysis data into a business logic generation model to obtain structured business logic data; the business logic generation model is constructed by a GPT model, and is used to generate structured business logic data corresponding to the structured intent data; in this embodiment, the structured business logic data includes code and DSL, etc.
[0093] In this embodiment, relevant information such as a business rule base matched with the current intent category is obtained, and the structured intent data is converted into a corresponding business logic vector in combination with a pre-trained intent model; the business logic vector serves as a key constraint condition, effectively guiding the generation process of subsequent structured business logic data, ensuring that it meets the semantic and rule requirements of a specific business scenario, thereby significantly improving the accuracy and compliance of the generation result; at the same time, when using a pre-trained business logic generation model to output structured business logic data, a dynamic model adjustment mechanism is further introduced, the activation function of the model is adjusted in real time according to the current context and business requirements, the expression ability and adaptability of the model to complex logical relationships are enhanced, the structured business logic data generated is more in line with the actual application scenario, and the accuracy and practicality of the output result are further improved, thereby providing strong support for building a high-reliability and strong-generalization context-aware interactive system.
[0094] The intent model in the embodiment is constructed by the following methods, including:
[0095] Obtaining a plurality of historical intent analysis data and corresponding historical business logic vectors;
[0096] The plurality of historical intent analysis data and corresponding historical business logic vectors are divided into training data, validation data and test data; the training data, validation data and test data are preprocessed to obtain a training set, a validation set and a test set; the ratio between the training set, the test set and the validation set is 7:2:1;
[0097] Selecting an artificial intelligence model as a base model; in the embodiment, the artificial intelligence model is a GNN-Transformer model;
[0098] The base model is trained through the training set, and the learning rate and hyperparameters are adjusted on the validation set to obtain a pre-trained model;
[0099] The pre-trained model is verified on the test set, and finally an intent model with intent analysis data as input and business logic vector as output is obtained.
[0100] The specification target-based specification syntax constraint in the embodiment includes:
[0101] The specification target includes SQL and REST API;
[0102] When the specification target is SQL, the specification syntax constraint is set as SQL specification constraint; in the embodiment, the SQL specification constraint includes SELECT, WHERE and JOIN, etc.
[0103] When the specification target is REST API, the specification syntax constraint is set as REST API specification constraint; in the embodiment, the REST API specification constraint includes GET and POST, etc.
[0104] The business logic generation model in the embodiment is constructed by a GPT model, including:
[0105] Obtaining a plurality of historical logic analysis data and corresponding historical structured business logic data;
[0106] The plurality of historical logic analysis data and corresponding historical structured business logic data are divided into training data, validation data and test data; the training data, validation data and test data are preprocessed to obtain a training set, a validation set and a test set; the ratio between the training set, the test set and the validation set is 7:2:1;
[0107] Selecting a GPT model as a base model;
[0108] The base model is trained by the training set, and the pre-training model is obtained by adjusting the learning rate and hyperparameters on the validation set;
[0109] The business logic generation model with the input of logical analysis data and the output of structured business logic data is finally obtained by verifying the pre-training model on the test set.
[0110] In the embodiment, inputting the logical analysis data into the business logic generation model to obtain the structured business logic data includes:
[0111] Extracting the specification syntax constraint in the logical analysis data;
[0112] Extracting several Transformer decoders in the business logic generation model; the Transformer decoder includes a multi-head attention layer and a feedforward neural network layer;
[0113] When the specification syntax constraint is a SQL specification constraint, it is judged whether the activation function in the current feedforward neural network layer is a linear activation function; if yes, no operation is performed; if no, the activation function corresponding to the feedforward neural network layer is set to a linear activation function;
[0114] When the specification syntax constraint is a REST API specification constraint, it is judged whether the activation function in the current feedforward neural network layer is a nonlinear activation function; if yes, no operation is performed; if no, the activation function corresponding to the feedforward neural network layer is set to a nonlinear activation function; in the embodiment, the nonlinear activation function is selected as a ReLU activation function; in the embodiment, the selection of the activation function is adaptive selection, and a learnable activation function and a switching mechanism are introduced in each Transformer decoder in the model; this dynamic selection mechanism makes the structure of the finally obtained context-aware model optimal.
[0115] In the embodiment, the context-aware model is generated based on the structured business logic data and real-time business data, including:
[0116] Obtaining an intent model and a business logic vector corresponding to the intent model;
[0117] Loading the business logic vector of the intent model as the initial parameter of the context-aware model;
[0118] Compiling the structured business logic data into an executable component and associating the executable component with the context-aware model;
[0119] Performing a state vector standardization operation on real-time business data to obtain a state vector; in the embodiment, the real-time business data includes inventory status and approval authority;
[0120] The state vector is generated into a state action according to a PPO algorithm; the PPO algorithm used in this embodiment belongs to one of the reinforcement learning algorithms;
[0121] The state action is parsed, and initial parameters of the context perception model are modified by the PPO algorithm to obtain the context perception model.
[0122] The final goal of this embodiment is to build a comprehensive, efficient and continuously optimized context perception model; for this purpose, on the basis of generating structured business logic data in real time, further fusion of dynamically changing actual business data is made to build a closed-loop learning system; by introducing a reinforcement learning method, taking task completion degree, user feedback or business indicators as reward signals, online parameter optimization and policy iteration are made on the existing intent recognition model and related components, so that the context perception model can continuously self-tune according to the actual running environment and interaction feedback, and always remain in an optimal or near-optimal state; this method not only enhances the adaptability of the model to complex and dynamic scenarios, significantly improves its generalization performance and judgment accuracy in a changing context environment, but also reversely enables the generation process of structured business logic data, making it more accurate, efficient and in line with real business needs; the overall scheme realizes the closed-loop evolution of "perception - decision - optimization - feedback", and provides key technical support for building a context perception model with autonomous evolution capability.
[0123] Please refer to Figure 2 The second aspect embodiment of the present application provides a context perception model generation system based on natural language interaction, comprising: a data acquisition module and a data analysis module; the data acquisition module and the data analysis module are electrically and / or communicatively connected;
[0124] The data acquisition module: acquires multi-modal input data and real-time business data through a data acquisition device; the data acquisition device in this embodiment includes a plurality of sensors and the like;
[0125] The data analysis module includes a data analysis unit and a model generation unit;
[0126] The data analysis unit: generates structured intent data based on multi-modal input data; generates structured business logic data based on structured intent data;
[0127] The model generation unit: generates a context perception model based on structured business logic data and real-time business data.
[0128] Another aspect embodiment of the present application provides a computer readable storage medium, the computer readable storage medium stores a computer program, and the computer program is executed by a processor to implement the context perception model generation system based on natural language interaction according to the second aspect embodiment of the present application.
[0129] Part of the data in the above formula is calculated by removing the dimension, and the formula is obtained by software simulation of a large amount of collected data to be closest to the real situation; the preset parameters and the preset threshold in the formula are set by the person skilled in the art according to the actual situation or obtained by a large amount of data simulation.
[0130] The working principle of the present application is: acquiring multi-modal input data and real-time business data; generating structured intent data based on the multi-modal input data; generating structured business logic data based on the structured intent data; generating a context perception model based on the structured business logic data and the real-time business data, analyzing multi-modal data such as text, image and voice to determine structured intent data and business logic data, and optimizing the model to obtain a final context perception model that can meet the needs of multiple businesses, improving the flexibility and generalization ability of the model, and thereby improving the accuracy and efficiency of the model during code development, avoiding the problem that the prior art often only supports text input, does not integrate multi-modal data such as image and voice input, resulting in low accuracy and efficiency during code development.
[0131] The above embodiments are only used to illustrate the technical method of the present application and not to limit it. Although the present application has been described in detail with reference to the preferred embodiments, it should be understood by those skilled in the art that the technical method of the present application can be modified or replaced equivalently without departing from the spirit and scope of the technical method of the present application.
Claims
1. A method for context-aware model generation based on natural language interaction, characterized in that, The application relates to a method for generating a context-aware model based on multi-modal input data and real-time business data. The multi-modal input data refers to input data of different modalities, including text, images and voice. The structured intent data is obtained by structuring the multi-modal input data. The structured business logic data is obtained by structuring the structured intent data according to corresponding standards. The context-aware model is generated based on the structured business logic data and the real-time business data. The method for generating the structured business logic data based on the structured intent data comprises the following steps: An intent category in the structured intent data is extracted. A business rule library and historical approval records are obtained based on the intent category. The structured intent data, the business rule library and the historical approval records are spliced into intent analysis data. The intent analysis data is input into an intent model to obtain a business logic vector; the intent model is used to generate a business logic vector corresponding to the current structured intent data. A specification target in the intent feature is extracted. A specification syntax constraint is determined based on the specification target. The structured intent data, the business logic vector and the specification syntax constraint are spliced into logic analysis data. The logic analysis data is input into a business logic generation model to obtain the structured business logic data; the business logic generation model is constructed by using a GPT model and is used to generate the structured business logic data corresponding to the structured intent data. The method for generating the structured intent data based on the multi-modal input data comprises the following steps: A multi-modal feature vector is obtained by uniformly encoding the multi-modal input data by using a Transformer algorithm. 2.The natural language interaction based context awareness model generation method of claim 1, wherein, The multi-modal feature vector is subjected to data preprocessing and standardization operations to obtain a preprocessed multi-modal feature vector; the data preprocessing and standardization operations comprise word segmentation, cleaning and vectorization operations. The preprocessed multi-modal feature vector is input into an intent recognition model to obtain an intent category; the intent recognition model is constructed by using a ChatGLM3 model and is used to identify the intent category of the multi-modal input data. The preprocessed multi-modal feature vector is input into a sequence labeling model to obtain an intent feature; the sequence labeling model is constructed by using a BERT model and is used to extract an intent feature corresponding to the current intent category. The structured intent data is determined according to the intent category and the intent feature. The intent model is constructed by the following method, which comprises the following steps: A plurality of historical intent analysis data and corresponding historical business logic vectors are obtained. 3.The natural language interaction based context awareness model generation method of claim 1, wherein, The plurality of historical intent analysis data and corresponding historical business logic vectors are divided into training data, verification data and test data; the training data, the verification data and the test data are subjected to data preprocessing to obtain a training set, a verification set and a test set. An artificial intelligence model is selected as a base model. The base model is trained by using the training set, and a learning rate and hyperparameters are adjusted on the verification set to obtain a pre-trained model. The pre-trained model is verified on the test set, and finally an intent model with input of the intent analysis data and output of the business logic vector is obtained. 4.The natural language interaction based context awareness model generation method of claim 1, wherein, The specification target includes SQL and REST API; the specification syntax constraint is determined based on the specification target, including: When the specification target is SQL, the specification syntax constraint is set as the SQL specification constraint; When the specification target is REST API, the specification syntax constraint is set as the REST API specification constraint. 5.The natural language interaction based context awareness model generation method of claim 1, wherein, The business logic generation model is constructed by a GPT model, including: Obtaining a plurality of historical logic analysis data and corresponding historical structured business logic data; Divide the plurality of historical logic analysis data and corresponding historical structured business logic data into training data, validation data and test data; data preprocessing of training data, validation data and test data obtains training set, validation set and test set; Select a GPT model as a base model; Train the base model through the training set, and adjust the learning rate and hyperparameters on the validation set to obtain a pre-trained model; Through the pre-trained model on the test set, the final business logic generation model is obtained, which inputs logic analysis data and outputs structured business logic data. 6.The natural language interaction based context awareness model generation method of claim 1, wherein, The logic analysis data is input into the business logic generation model to obtain the structured business logic data, including: Extract the specification syntax constraint in the logic analysis data; Extract a plurality of Transformer decoders in the business logic generation model; the Transformer decoder includes a multi-head attention layer and a feedforward neural network layer; When the specification syntax constraint is the SQL specification constraint, determine whether the activation function in the current feedforward neural network layer is a linear activation function; yes, do nothing; no, set the activation function corresponding to the feedforward neural network layer to a linear activation function; When the specification syntax constraint is the REST API specification constraint, determine whether the activation function in the current feedforward neural network layer is a nonlinear activation function; yes, do nothing; no, set the activation function corresponding to the feedforward neural network layer to a nonlinear activation function. 7.The natural language interaction based context awareness model generation method of claim 1, wherein, The context-aware model is generated based on the structured business logic data and real-time business data, including: Obtaining an intent model and corresponding business logic vector; Load the business logic vector of the intent model as the initial parameters of the context-aware model; Compile the structured business logic data into an executable component and associate it with the context-aware model; Perform state vector standardization on the real-time business data to obtain a state vector; Generate state actions according to the PPO algorithm; Parse the state actions and modify the initial parameters of the context-aware model by the PPO algorithm to obtain the context-aware model.
8. A context-aware model generation system based on natural language interaction, characterized in that, Including: Interconnected data acquisition module and data analysis module; The data acquisition module: obtaining multi-modal input data and real-time business data through a data acquisition device; The data analysis module includes a data analysis unit and a model generation unit; The data analysis unit: generating structured intent data based on multi-modal input data; Generate structured business logic data based on structured intent data; The structured business logic data is generated based on the structured intent data, including: Extract the intent category in the structured intent data; Obtaining a business rule base and historical approval records based on the intent category; Splicing the structured intent data, the business rule base and the historical approval records into intent analysis data; Inputting the intent analysis data into an intent model to obtain a business logic vector; the intent model is used to generate a business logic vector corresponding to the current structured intent data; Extracting a specification target in the intent feature; Determining a specification syntax constraint based on the specification target; Splicing the structured intent data, the business logic vector and the specification syntax constraint into logic analysis data; Inputting the logic analysis data into a business logic generation model to obtain structured business logic data; the business logic generation model is constructed by a GPT model and is used to generate structured business logic data corresponding to the structured intent data; The model generation unit generates a context-aware model based on the structured business logic data and real-time business data.
9. A computer readable storage medium applied to the context-aware model generation system based on natural language interaction of claim 8, characterized in that, The computer program is stored on the computer readable storage medium.
Citation Information
Patent Citations
Dynamic data pipeline construction method based on artificial intelligence and multi-modal data processing
CN119830200A
Intelligent programming auxiliary method and system based on multi-mode AI language model
CN120315685A