Context sensing model generation method and system based on natural language interaction
By generating structured intent and business logic data from multimodal data and combining it with reinforcement learning to optimize model parameters, the problem of multimodal data not being integrated in low-code platforms is solved, and efficient and accurate code generation and context awareness are achieved.
Patent Information
- Application Number
- CN202511300763.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-12
- Publication Date
- 2025-10-17
- Estimated Expiration
- 2045-09-12
AI Technical Summary
Existing low-code platforms only support text input when developing code and do not integrate multimodal data such as images and voice, resulting in low accuracy and efficiency.
By acquiring multimodal input data (text, images, voice), we generate structured intent data, and based on this, we generate structured business logic data. Finally, we build a context-aware model, use Transformer, BERT, GPT and other models for data preprocessing and intent recognition, and combine reinforcement learning to optimize model parameters.
It significantly improves the model's understanding accuracy and code generation efficiency in complex interactive environments, enhances the model's flexibility and generalization capabilities, and improves the accuracy and efficiency of multimodal data.
Smart Images

Figure CN120804636A_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, which solves 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: 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; generating structured intent data based on the multi-modal input data; the structured intent data refers to the result obtained after structuring the multi-modal input data; generating structured business logic data based on the 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; generating a context-aware model based on the structured business logic data and the real-time business data.
[0006] The 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 processes.
[0007] Further, the structured intent data is generated based on the multi-modal input data, including: using a Transformer algorithm to uniformly encode the multi-modal input data to obtain a multi-modal feature vector; performing data preprocessing and standardization operations on the multi-modal feature vector to obtain a preprocessed multi-modal feature vector; the data preprocessing and standardization operations include tokenization, cleaning and vectorization operations; inputting the preprocessed multi-modal feature vector 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; inputting the preprocessed multi-modal feature vector 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; determining the structured intent data according to the intent category and the intent feature.
[0008] When analyzing the input multi-modal data, the 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. 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.
[0009] Further, the structured business logic data is generated based on the structured intent data, including: extracting the intent category in the structured intent data; obtaining a business rule library and historical approval records based on the intent category; splicing the structured intent data, the business rule library and the historical approval records into intent analysis data; Input the intent analysis data into the intent model to obtain a business logic vector; the business logic vector quantifies the decision factors of the 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; Extract the specification target in the intent feature; Determine the specification syntax constraint based on the specification target; Splice the structured intent data, the business logic vector and the specification syntax constraint into logic analysis data; Input the logic analysis data into the 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.
[0010] The application obtains the business rule library and other data corresponding to the current intent category, and obtains the business logic vector corresponding to the current structured intent data through the pre-trained intent model. These business logic vectors constrain the subsequently generated structured business logic data, improve the accuracy of the structured business logic data, and dynamically adjust the activation function of the pre-trained business logic generation model when generating the structured business logic data, so that the structured business logic data can better meet the actual demand and improve the accuracy of the structured business logic data.
[0011] Further, the intent model is constructed by the following methods, including: Obtain a plurality of historical intent analysis data and corresponding historical business logic vectors; Divide the plurality of historical intent analysis data and corresponding historical business logic vectors into training data, validation data and test data; perform data preprocessing on the training data, validation data and test data to obtain a training set, a validation set and a test set; Select an artificial intelligence 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; Verify the pre-trained model on the test set to finally obtain an intent model with input of intent analysis data and output of business logic vector.
[0012] Further, the specification syntax constraint is determined based on the specification target, including: The specification target includes SQL and REST API; When the specification target is SQL, set the specification syntax constraint as SQL specification constraint; When the specification target is REST API, set the specification syntax constraint as REST API specification constraint.
[0013] Further, the business logic generation model is constructed by a GPT model, comprising: acquiring a plurality of historical logic analysis data and corresponding historical structured business logic data; dividing the plurality of historical logic analysis data and corresponding historical structured business logic data into training data, validation data and test data; and performing data preprocessing on the training data, validation data and test data to obtain a training set, a validation set and a test set; selecting a GPT model as a base model; training the base model by the training set, and adjusting the learning rate and hyperparameters on the validation set to obtain a pre-trained model; verifying the pre-trained model on the test set to finally obtain a business logic generation model with logic analysis data as input and structured business logic data as output.
[0014] Further, the input of the logic analysis data into the business logic generation model to obtain the structured business logic data, comprising: extracting the specification syntax constraint in the logic analysis data; extracting a plurality of Transformer decoders in the business logic generation model; the Transformer decoder comprises a multi-head attention layer and a feedforward neural network layer; when the specification syntax constraint is a SQL specification constraint, determining 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; when the specification syntax constraint is a REST API specification constraint, determining 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.
[0015] In the process of generating structured business logic data, the application dynamically adjusts the activation function of the business logic generation model according to 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 problem of insufficient flexibility caused by the use of fixed structure and static conversion rules in traditional model-driven development, effectively supports the generation of structured business logic across scenes and targets; 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 logic expression, thereby significantly enhancing the simplicity and accuracy of the generated results, and providing a more adaptive technical path for building an efficient and intelligent context-aware system.
[0016] Furthermore, generating a context-aware model based on structured business logic data and real-time business data includes: Get the intent model and its corresponding business logic vector; Load the business logic vector of the intent model as the initial parameters of the context-aware model; Compile structured business logic data into executable components and associate them with context-aware models; Performing a state vector normalization operation on the real-time business data to obtain a state vector; the real-time business data includes inventory status and approval authority; Generate state action from state vector according to PPO algorithm; The context-aware model is obtained by parsing state actions and modifying the initial parameters of the context-aware model through the PPO algorithm.
[0017] The ultimate goal of this application is to obtain a comprehensive and efficient context-aware model. By combining real-time generated structured business logic data and real-time business data, the parameters of the existing intent model are optimized through reinforcement learning methods to obtain the final context-aware model, so that the context-aware model can be adjusted to the optimal state in real time, thereby improving the generalization ability and accuracy of the context-aware model, and providing strong support for the accurate and efficient generation of structured business logic data.
[0018] A second aspect of the present invention 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; The data acquisition module acquires multimodal input data and real-time business data through data acquisition equipment; The data analysis module includes a data analysis unit and a model generation unit; The data analysis unit generates structured intent data based on the multimodal input data and generates structured business logic data based on the structured intent data. The model generation unit generates a context-aware model based on structured business logic data and real-time business data.
[0019] Another aspect of the present invention provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the context-aware model generation system based on natural language interaction according to the second aspect of the present invention.
[0020] Compared with the prior art, the present invention has the following advantages: 1. The application generates structured intent data based on multi-modal input data; generates structured business logic data based on structured intent data; generates context-aware model based on structured business logic data and real-time business data, analyzes multi-modal data such as text, image and voice, determines 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 thus improves the accuracy and efficiency of the model during code development.
[0021] 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 cross-target structured business logic data generation, avoids the efficiency loss caused by static model conversion in traditional model-driven development, and improves the simplicity and accuracy of structured business logic data.
[0022] 3. 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. BRIEF DESCRIPTION OF DRAWINGS
[0023] In order to more clearly illustrate the technical solutions in the embodiments of the application or the prior art, the drawings needed in the embodiment or prior art description will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the application, and those skilled in the art can obtain other drawings according to these drawings without creative labor.
[0024] Figure 1 The flow chart of the context-aware model generation method based on natural language interaction of the application; Figure 2 The principle schematic diagram of the context-aware model generation system based on natural language interaction of the application. DETAILED DESCRIPTION
[0025] The technical solutions of the application will be described below in conjunction with the embodiments. Obviously, the described embodiments are only some of the embodiments of the application, not all. Based on the embodiments in the application, all other embodiments obtained by those skilled in the art without creative labor are within the scope of protection of the application.
[0026] Please refer to Figure 1 The first aspect of the embodiment of the application provides a context perception model generation method based on natural language interaction, comprising the following steps: obtaining multi-modal input data and real-time business data; the multi-modal input data refers to input data of different modalities, including text, image and voice; generating structured intent data based on the multi-modal input data; the structured intent data refers to a result obtained by performing a structured operation on the multi-modal input data; generating structured business logic data based on the structured intent data; the structured business logic data refers to business logic data obtained by the structured intent data according to a corresponding standard; generating a context perception model based on the structured business logic data and the real-time business data.
[0027] In the embodiment, the structured intent data is generated based on the multi-modal input data, comprising the following steps: using a Transformer algorithm to uniformly encode the multi-modal input data to obtain a multi-modal feature vector; performing data preprocessing and standardization operation on the multi-modal feature vector to obtain a preprocessed multi-modal feature vector; the data preprocessing and standardization operation includes word segmentation, cleaning and vectorization operation; in the embodiment, the data preprocessing and standardization operation is performed to convert unstructured data into a processable format, so as to facilitate subsequent fast and accurate operation; inputting the preprocessed multi-modal feature vector 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; in the embodiment, the intent recognition model is a pre-trained model, and its training process is consistent with that of a general classification model; inputting the preprocessed multi-modal feature vector 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; in the embodiment, the sequence labeling model is obtained by adding a task-specific linear layer to the pre-trained BERT model and then fine-tuning in related data; determining the structured intent data according to the intent category and the intent feature.
[0028] When performing intent analysis on the input multimodal data, this embodiment first performs preliminary cleaning and regularization on the original data through operations such as data preprocessing, effectively improving the standardization and consistency of the data, making the multimodal information more concise, efficient and accurate in subsequent processing; on this basis, the pre-trained intent recognition model and sequence labeling model are called separately to jointly analyze the processed data to accurately identify the intent category and fine-grained intent features corresponding to the input content; these two types of information together constitute structured intent data, which serves as the key input for the subsequent generation of 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 a high-precision context-aware model.
[0029] Generating structured business logic data based on structured intent data in this embodiment includes: Extract intent categories from structured intent data; Obtain business rule libraries and historical approval records based on intent categories; Combine structured intent data, business rule base, and historical approval records into intent analysis data; Input the intent analysis data into the intent model to obtain the business logic vector. The business logic vector is a decision factor that quantifies the business scenario and provides dynamic parameter constraints for subsequent business logic generation. The intent model is used to generate the business logic vector corresponding to the current structured intent data. Extracting the specification target from the intent feature; in this embodiment, the specification target refers to the desired target result, such as generating the required SQL statement from the multimodal input data, or generating the REST API statement from the multimodal input data; Determine the specification grammatical constraints based on the specification target. In this embodiment, different specification targets have unique grammatical constraints. When generating the required structured business logic data, it is necessary to rely on the specification grammatical constraints corresponding to the specification target to make the final structured business logic data more accurate, thereby improving the accuracy and efficiency of the final context-aware model. Combine structured intent data, business logic vectors, and standard grammatical constraints into logical analysis data; The logical analysis data is input into the business logic generation model to obtain structured business logic data; the business logic generation model is constructed through the GPT model 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.
[0030] The embodiment obtains relevant information such as a business rule library matched with the current intent category, and combines a pre-trained intent model to convert structured intent data into a corresponding business logic vector; the business logic vector is used as a key constraint condition to effectively guide the generation process of subsequent structured business logic data, and ensure that the structured business logic data meets the semantic and rule requirements of a specific business scenario, thereby significantly improving the accuracy and compliance of the generation result; meanwhile, when the structured business logic data is output by using a pre-trained business logic generation model, a dynamic model adjustment mechanism is further introduced to adjust the activation function of the model in real time according to the current context and business requirements, enhance the expression ability and adaptability of the model to complex logical relationships, and make the generated structured business logic data more suitable for actual application scenarios, thereby further improving the accuracy and practicability of the output result, and providing strong support for constructing a context-aware interactive system with high reliability and strong generalization.
[0031] The intent model in the embodiment is constructed in the following manner, including: Obtaining a plurality of historical intent analysis data and corresponding historical business logic vectors; 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, verification data and test data are preprocessed to obtain a training set, a verification set and a test set; the ratio between the training set, the test set and the verification set is 7:2:1; An artificial intelligence model is selected as a base model; in the embodiment, the artificial intelligence model is a GNN-Transformer model; The base model is trained by using the training set, and the 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 intent analysis data and output of business logic vector is obtained.
[0032] In the embodiment, the specification target is determined to determine the specification syntax constraint, including: The specification target includes SQL and REST API; When the specification target is SQL, the specification syntax constraint is set as a SQL specification constraint; in the embodiment, the SQL specification constraint includes SELECT, WHERE and JOIN, etc. When the specification target is REST API, the specification syntax constraint is set as a REST API specification constraint; in the embodiment, the REST API specification constraint includes GET and POST, etc.
[0033] The business logic generation model in the embodiment is constructed by using a GPT model, including: Obtaining a plurality of historical logical analysis data and corresponding historical structured business logic data; Dividing the plurality of historical logical analysis data and corresponding historical structured business logic data into training data, validation data and test data; performing data preprocessing on the training data, validation data and test data 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; Selecting a GPT model as a base model; Training the base model through the training set, and adjusting the learning rate and hyperparameters on the validation set to obtain a pre-trained model; Through the validation of the pre-trained model on the test set, a business logic generation model with input of logical analysis data and output of structured business logic data is finally obtained.
[0034] In the embodiment, inputting the logical analysis data into the business logic generation model to obtain the structured business logic data, comprising: Extracting the specification syntax constraint in the logical analysis data; Extracting 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 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; 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, and this dynamic selection mechanism makes the structure of the finally obtained context-aware model optimal.
[0035] In the embodiment, the context-aware model is generated based on the structured business logic data and real-time business data, comprising: Obtaining an intent model and a corresponding business logic vector; Loading the business logic vector of the intent model as the initial parameters of the context-aware model; Compiling the structured business logic data into an executable component and associating it with the context-aware model; The real-time business data is subjected to a state vector standardization operation to obtain a state vector; the real-time business data in this embodiment includes inventory status and approval authority; 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; The state action is analyzed, and the initial parameters of the context perception model are modified by the PPO algorithm to obtain the context perception model.
[0036] 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 real-time generation of structured business logic data, 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 self-evolution ability.
[0037] 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; 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; The data analysis module includes a data analysis unit and a model generation unit; The data analysis unit: generates structured intent data based on multi-modal input data; generates structured business logic data based on structured intent data; The model generation unit: generates a context perception model based on structured business logic data and real-time business data.
[0038] 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.
[0039] Part of the data in the above formula is the numerical value calculated by removing the dimension, and the formula is obtained by software simulation of a large amount of collected data to obtain a formula 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.
[0040] The working principle of the present application: by acquiring multi-modal input data and real-time business data; generating structured intent data based on multi-modal input data; generating structured business logic data based on structured intent data; generating context awareness model based on structured business logic data and 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 awareness model that can meet the needs of multiple businesses, improving the flexibility and generalization ability of the model, and then 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.
[0041] 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, those skilled in the art should understand that the technical method of the present application can be modified or replaced by equivalent, without departing from the spirit and scope of the technical method of the present application.
Claims
1. A context-aware model generation method based on natural language interaction, characterized in that: include: Acquire multimodal input data and real-time business data; The multimodal input data refers to input data of different modalities, including text, image and voice; Generate structured intent data based on multimodal input data; The structured intent data refers to the result obtained after performing structured operations on multimodal input data; Generate structured business logic data based on structured intent data; the structured business logic data refers to business logic data obtained by converting structured intent data according to corresponding standards; Generate context-aware models based on structured business logic data and real-time business data.
2. The method for generating a context-aware model based on natural language interaction according to claim 1, characterized in that: Generating structured intent data based on multimodal input data includes: Use the Transformer algorithm to uniformly encode multimodal input data to obtain a multimodal feature vector; Performing data preprocessing and standardization operations on the multimodal feature vector to obtain a preprocessed multimodal feature vector; the data preprocessing and standardization operations include word segmentation, cleaning, and vectorization operations; Inputting the preprocessed multimodal feature vector into an intent recognition model to obtain an intent category; the intent recognition model is constructed using the ChatGLM3 model to identify the intent category of the multimodal input data; The preprocessed multimodal feature vector is input into a sequence labeling model to obtain intent features; the sequence labeling model is constructed using the BERT model to extract intent features corresponding to the current intent category; Determine structured intent data based on intent categories and intent features.
3. The method for generating a context-aware model based on natural language interaction according to claim 1, wherein: Generating structured business logic data based on structured intent data includes: Extract intent categories from structured intent data; Obtain business rule libraries and historical approval records based on intent categories; Combine structured intent data, business rule base, and historical approval records into intent analysis data; Input the intent analysis data into the 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 normative goals from intention features; Determine the specification grammar constraints based on the specification goals; Combine structured intent data, business logic vectors, and standard grammatical constraints into logical analysis data; The logical analysis data is input into the business logic generation model to obtain structured business logic data; the business logic generation model is constructed through the GPT model to generate structured business logic data corresponding to the structured intent data.
4. The method for generating a context-aware model based on natural language interaction according to claim 3, characterized in that: The intent model is constructed in the following ways, including: Obtain some historical intent analysis data and its corresponding historical business logic vectors; Divide a number of historical intent analysis data and their corresponding historical business logic vectors into training data, verification data, and test data; perform data preprocessing on the training data, verification data, and test data to obtain a training set, a verification set, and a test set; Select an artificial intelligence model as the base model; Train the basic model using the training set, and adjust the learning rate and hyperparameters on the validation set to obtain the pre-trained model; By verifying the pre-trained model on the test set, we finally obtain an intent model whose input is intent analysis data and output is a business logic vector.
5. The method for generating a context-aware model based on natural language interaction according to claim 3, wherein: The specification targets include SQL and REST API; and determining the specification syntax constraints based on the specification targets includes: When the specification target is SQL, the specification syntax constraint is set to SQL specification constraint; When the specification target is a REST API, set the specification syntax constraint to the REST API specification constraint.
6. The method for generating a context-aware model based on natural language interaction according to claim 3, characterized in that: The business logic generation model is constructed through the GPT model, including: Obtain some historical logical analysis data and its corresponding historical structured business logic data; Divide a number of historical logic analysis data and their corresponding historical structured business logic data into training data, verification data, and test data; perform data preprocessing on the training data, verification data, and test data to obtain a training set, a verification set, and a test set; Select the GPT model as the base model; Train the basic model using the training set, and adjust the learning rate and hyperparameters on the validation set to obtain the pre-trained model; By verifying the pre-trained model on the test set, we finally obtain a business logic generation model whose input is logic analysis data and output is structured business logic data.
7. The method for generating a context-aware model based on natural language interaction according to claim 3, wherein: The step of inputting the logic analysis data into the business logic generation model to obtain structured business logic data includes: Extracting standardized grammatical constraints from logical analysis data; Extracting several Transformer decoders from 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 an SQL specification constraint, determine whether the activation function in the current feedforward neural network layer is a linear activation function; if yes, do nothing; if no, set the activation function corresponding to the feedforward neural network layer to a linear activation function; When the specification syntax constraint is a REST API specification constraint, determine whether the activation function in the current feedforward neural network layer is a nonlinear activation function. If yes, do nothing. If no, set the activation function corresponding to the feedforward neural network layer to a nonlinear activation function.
8. The method for generating a context-aware model based on natural language interaction according to claim 1, wherein: Generating a context-aware model based on structured business logic data and real-time business data includes: Get the intent model and its corresponding business logic vector; Load the business logic vector of the intent model as the initial parameters of the context-aware model; Compile structured business logic data into executable components and associate them with context-aware models; Perform state vector normalization on real-time business data to obtain a state vector; Generate state action from state vector according to PPO algorithm; The context-aware model is obtained by parsing state actions and modifying the initial parameters of the context-aware model through the PPO algorithm.
9. A context-aware model generation system based on natural language interaction, characterized in that: include: Interconnected data acquisition module and data analysis module; The data acquisition module acquires multimodal input data and real-time business data through data acquisition equipment; The data analysis module includes a data analysis unit and a model generation unit; The data analysis unit generates structured intent data based on multimodal input data; Generate structured business logic data based on structured intent data; The model generation unit generates a context-aware model based on structured business logic data and real-time business data.
10. A computer-readable storage medium, applied to the context-aware model generation system based on natural language interaction according to claim 9, characterized in that: The computer-readable storage medium stores a computer program.
Citation Information
Patent Citations
Business logic code-free development method based on natural language understanding and conversion
CN113791791A
Generative question answering method and device based on AI
CN119322831A
Dynamic data pipeline construction method based on artificial intelligence and multi-modal data processing
CN119830200A
Intelligent operation and maintenance method fusing multi-modal data and active learning
CN120198106A
Intelligent programming auxiliary method and system based on multi-mode AI language model
CN120315685A