Water conservancy professional model and large language model coupling method based on intention recognition
By coupling the large language model with the water conservancy professional model, and using an intention-based recognition method, users can interact with the water conservancy professional model through natural language, solve the problem of unintuitive information and support faster and more accurate decision-making.
Patent Information
- Application Number
- CN202411579778.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-07
- Publication Date
- 2025-02-25
AI Technical Summary
The prior art is difficult to enable users to interact with professional water conservancy models through natural language, resulting in unintuitive information and difficult to quickly gain insight.
The method based on intention recognition is adopted to couple the large language model with the water conservancy professional model. By identifying user intentions, matching professional model, interpreting input conditions, extracting coupling results and rendering and displaying, the interaction between natural language and water conservancy professional model is achieved.
This allows users to interact with professional water conservancy models through natural language input, obtain intuitive data rendering results, solves the problem of unintuitive information, and supports faster and more accurate decision-making.
Smart Images

Figure CN119514688A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of artificial intelligence technology, and in particular to a method for coupling a water conservancy professional model and a large language model based on intent recognition. Background Art
[0002] With the development and progress of the times, natural language processing technology has made significant breakthroughs. As one of the core technologies, large language models have demonstrated powerful language understanding and generation capabilities. They can learn and simulate human language patterns based on massive data, and provide intelligent language processing solutions for various application scenarios. This not only promotes the development of the field of artificial intelligence, but also makes people's interaction with technology more natural and efficient.
[0003] In the field of water conservancy, professional models are widely used in business scenarios such as reservoir scheduling, runoff calculation, estuary tide forecasting and flood forecasting. In order to improve the usability and operation convenience of these water conservancy professional models and make the expression of calculation results richer and more intuitive than pure text, it is necessary to design a method to couple water conservancy professional models with large language models. Summary of the invention
[0004] The problem to be solved by the present invention is to provide a method for coupling a water conservancy professional model and a large language model based on intention recognition, which can interact with the water conservancy professional model through natural language.
[0005] A technical solution adopted by the present invention to solve the above problem is: a method for coupling a water conservancy professional model with a large language model based on intention recognition, which specifically includes the following steps:
[0006] Identify user intent: The large language model determines the user intent in the question based on the question posed by the user's natural language input;
[0007] Matching professional models: Perform similarity analysis between user intent and the model intent of each water conservancy professional model, and select the water conservancy professional model with the best similarity match;
[0008] Interpret input conditions: Based on the parameters required by the optimal water conservancy professional model, the large language model interprets the input conditions given in the problem, identifies and extracts relevant parameters;
[0009] Extract coupling results: input relevant parameters into the optimal water conservancy professional model, execute and extract corresponding output results;
[0010] Result rendering display: query the rendering configuration output by the optimal water conservancy professional model, and display the rendering results based on the output results and rendering configuration.
[0011] Compared with the prior art, the advantage of the present invention is that, through the coupling of the large language model and the water conservancy professional model, the user can interact with the water conservancy professional model by inputting natural language, and query the water conservancy professional information they want to know; and through rendering results, complex water conservancy data can be converted into intuitive graphics and charts, so that users can understand and analyze data more easily, solving the problem of non-intuitive information and difficulty in quickly obtaining insights in traditional data analysis, making large amounts of complex data easy to understand and operate, thereby supporting faster and more accurate decision-making.
[0012] Preferably, the achievement rendering display includes:
[0013] Receive and obtain the output results after the execution of the water conservancy professional model;
[0014] According to the matched optimal water conservancy professional model ID, query and obtain the corresponding rendering type template;
[0015] Query and obtain the optimal water conservancy professional model to obtain the corresponding dynamic script;
[0016] The output result is used as the output parameter, the corresponding dynamic script is parsed and executed, and the processed data is filled into the queried rendering type template to obtain the final rendering data;
[0017] The client receives, parses and renders the final rendering data, and displays the corresponding rendering results. The rendering type templates include basic ones such as descriptive text and statistical charts, and complex ones such as two-dimensional rainfall grid maps and three-dimensional digital twin flooding UE scenes. They can be freely expanded to enrich the diversity of data rendering; dynamic scripts will test, filter and convert the model output results according to the specified logic; through digital twin visualization of virtual models of water conservancy facilities (such as reservoirs, gates, pipeline systems, etc.), their physical state is reflected in real time, allowing users to monitor the operation status of water conservancy facilities in real time and discover and deal with potential problems in a timely manner; through data rendering, the impact of extreme weather events (such as floods and droughts) on water conservancy systems is simulated, thereby helping to formulate emergency response plans and helping to reduce the risks brought by natural disasters.
[0018] Preferably, the interpretation input conditions specifically include: querying the input subject object field description required for the optimal water conservancy professional model, combining with the existing subject object field description, analyzing which subject objects are in the natural sentence of the recognition problem, and extracting those subject objects; querying the input time parameter object field description required for the optimal water conservancy professional model, combining with the existing time parameter object field description, analyzing which corresponding time parameters are in the natural sentence of the recognition problem, and extracting those corresponding time parameters; querying the input hydrological numerical parameter object field description required for the optimal water conservancy professional model, combining with the existing hydrological numerical parameter object field description, analyzing which corresponding hydrological numerical parameters are in the natural sentence of the recognition problem, and extracting those corresponding hydrological numerical parameters.
[0019] Preferably, the natural language of the question is pre-processed with text and then a semantic vector is used to represent the user's intention.
[0020] Preferably, the similarity is obtained by calculating a semantic vector of the user's intention and a semantic vector of the model's intention. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] Figure 1 It is the overall flow chart of the present invention.
[0022] Figure 2 It is a detailed flow chart of the present invention.
[0023] Figure 3 It is the interpretation flow chart of the present invention.
[0024] Figure 4 It is a flow chart of the rendering of the invention.
[0025] Figure 5 It is a display diagram of the rendering of the results of the present invention. DETAILED DESCRIPTION
[0026] The following is a description of exemplary embodiments of the present invention in conjunction with the accompanying drawings, including various details of the embodiments of the present invention to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present invention. Similarly, for clarity and conciseness, the description of well-known functions and structures is omitted in the following description.
[0027] This preferred embodiment is for example Figure 1 and Figure 2 The figure shows a coupling method of a water conservancy professional model and a large language model based on intention recognition, which specifically includes the following steps:
[0028] Identify user intent: The large language model determines the user intent in the question based on the natural language input by the user. The large language model outputs the user intent to be expressed by the question formed by the natural language based on the natural language input by the user through the guidance of prompt words. If the user intent of the question is unclear, the prompt "unable to identify" is returned to the user; if the user intent of the question is clear, the text content of the natural language of the question is sent to the semantic vector model for text processing to obtain the semantic vector of the user intent.
[0029] Matching professional models: Perform similarity analysis between user intent and the model intent of each water conservancy professional model, and select the water conservancy professional model with the best similarity match. Query the model intent and semantic vector pre-stored in each water conservancy professional model, and obtain the different similarities between the semantic vector of the user intent and the semantic vector of each water conservancy professional model by calculating the semantic vector of the model intent and the semantic vector of the user intent. If the similarities are all less than the set threshold, return a '404' prompt to the user, indicating that the model intent of the existing water conservancy professional model does not match the user intent of the question; if there is a similarity greater than the set threshold, return the relevant model intent of the first N water conservancy professional models with a similarity greater than the set threshold, N is a settable natural number. The large language model analyzes the matching degree between the question and the first N water conservancy professional models according to the similarity size and based on the user intent of the question and the model intent of the water conservancy professional model. If the matching degree does not reach the target value, return a '404' prompt to the user, indicating that the existing water conservancy professional model does not match the question, otherwise select the one with the largest matching degree as the optimal water conservancy professional model.
[0030] Interpret input conditions: Based on the parameters required by the optimal water conservancy professional model, the large language model interprets the input conditions given in the problem, identifies and extracts relevant parameters. Figure 3 As shown, the interpretation input conditions specifically include: querying the input subject object field description required for the optimal water conservancy professional model, combining with the existing subject object field description, analyzing which subject objects are in the natural sentence of the recognition problem, and extracting those subject objects; querying the input time parameter object field description required for the optimal water conservancy professional model, combining with the existing time parameter object field description, analyzing which corresponding time parameters are in the natural sentence of the recognition problem, and extracting those corresponding time parameters; querying the input hydrological numerical parameter object field description required for the optimal water conservancy professional model, combining with the existing hydrological numerical parameter object field description, analyzing which corresponding hydrological numerical parameters are in the natural sentence of the recognition problem, and extracting those corresponding hydrological numerical parameters.
[0031] Extract coupling results: input the relevant parameters into the optimal water conservancy professional model, execute and extract the corresponding output results; the relevant parameters include the above-mentioned main objects, time parameters and hydrological numerical parameters, etc.
[0032] Result rendering display: query the rendering configuration output by the optimal water conservancy professional model, and display the rendering results based on the output results and rendering configuration.
[0033] The rendering of the results is shown as follows Figure 4 Specifically shown include:
[0034] Receive and obtain the output results of the water conservancy professional model after execution as the basis for subsequent rendering.
[0035] According to the matched optimal water conservancy professional model ID, query and obtain the corresponding rendering type template. The rendering type templates include basic ones such as descriptive text and statistical charts, and complex ones such as two-dimensional rainfall grid maps and three-dimensional digital twin flooding UE scenes. They can be freely expanded to enrich the diversity of data rendering.
[0036] Query and obtain the optimal water conservancy professional model to obtain the corresponding dynamic script; query and obtain the corresponding dynamic script according to the water conservancy professional model ID matched by the previous large language model. The function of the dynamic script is to test, filter and convert the model output results according to the specified logic.
[0037] The output results are used as output parameters, the corresponding dynamic scripts are parsed and executed, and the processed data is filled into the queried rendering type template to obtain the final rendering data.
[0038] The client receives, parses and renders the final rendering data, and displays the corresponding rendering results to the user.
[0039] The following examples are given to illustrate the coupling method of the water conservancy professional model based on intent recognition and the large language model.
[0040] In the step of identifying user intent: the natural language of the user input question is "the water level process changes in a reservoir under the condition of 300mm rainfall in the next 24 hours"; the prompt word is "You are a Chinese language expert, please understand the intention of the question according to the question, just output the intention of the question, do not output other irrelevant information, please output in a standard JSON object string format, the field is intent, and make sure the returned string can be parsed by the JSON.parse method of JavaScript. If it cannot be recognized, please return 'unrecognized'". The large language model recognizes the user intent of the question, and the string returned according to the prompt word is:
[0041] {
[0042] "intent":"Ask about the water level change process of a reservoir when the rainfall reaches 300mm in the next 24 hours"
[0043] }.
[0045] In the steps of matching professional models:
[0046] Similarity calculation:
[0047] {
[0048] "similarity": 0.825,
[0049] "Model Intent": "Query the water level process changes of the reservoir based on how much rainfall it will have in the next few hours.",
[0050] "Hydraulic professional model":"HC-RS-dispatchreservoirDispatchRainfallPattern"
[0051] }
[0052] {
[0053] "Similarity": 0.791,
[0054] "Model Intent": "Reservoir scheduling is performed based on reservoir names and forecasting agencies, and the future reservoir water level changes are calculated.",
[0055] "Hydraulic professional model":"HC-RS-dispatchReservoirDispatch"
[0056] }.
[0058] Match Selection:
[0059] {
[0060] "Hydraulic professional model":"HC-RS-dispatchreservoirDispatchRainfallPattern"
[0061] }.
[0063] In the Interpret Input Conditions step:
[0064] The parameters required by the water conservancy professional model "HC-RS-dispatchreservoirDispatchRainfallPattern" include:
[0065] Reservoir name. The corresponding field in the JSON object is name, and the type is string.
[0066] Start time. The corresponding field in the JSON object is start. The type is date and the parsing format is yyyy-MM-dd HH:mm:ss.
[0067] End time. The corresponding field in the JSON object is end, the type is date, and the parsing format is yyyy-MM-ddHH:mm:ss.
[0068] Precipitation. The corresponding field in the JSON object is rainfall, the type is number, and the unit is mm.
[0069] In the step of extracting coupling results: the water conservancy professional model "HC-RS-dispatchreservoirDispatchRainfallPattern" outputs the following results based on the current time 2024-08-0114:05:32 and the user intent "asking about the water level change process when the rainfall in a reservoir reaches 300mm in the next 24 hours" identified by the large language model:
[0070] {
[0071] "name": "a reservoir",
[0072] "start":"2024-08-01 14:00:00",
[0073] "end":"2024-08-02 14:00:00",
[0074] "rainfall": 300
[0075] }.
[0077] In the step of rendering and displaying the results: execute the relevant water conservancy professional model API through HTTP request, obtain the execution result output, and render the output result according to the rendering type template bound to the water conservancy professional model "HC-RS-dispatchreservoirDispatchRainfallPattern". The rendering result is displayed on the user's client, such as Figure 5 shown.
[0078] In the above process, the standard JSON object string format is uniformly used to transmit information, which is convenient for the large language model and the water conservancy professional model to process the information.
[0079] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may occur depending on design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A method for coupling a water conservancy professional model with a large language model based on intention recognition, characterized in that: The specific steps include: Identify user intent: The large language model determines the user intent in the question based on the question posed by the user's natural language input; Matching professional models: Perform similarity analysis between user intent and the model intent of each water conservancy professional model, and select the water conservancy professional model with the best similarity match; Interpret input conditions: Based on the parameters required by the optimal water conservancy professional model, the large language model interprets the input conditions given in the problem, identifies and extracts relevant parameters; Extract coupling results: input relevant parameters into the optimal water conservancy professional model, execute and extract corresponding output results; Result rendering display: query the rendering configuration output by the optimal water conservancy professional model, and display the rendering results based on the output results and rendering configuration.
2. According to the method for coupling a water conservancy professional model with a large language model based on intention recognition according to claim 1, it is characterized in that: The rendering and display of the results specifically include: receiving and obtaining the output results after the execution of the water conservancy professional model; querying and obtaining the corresponding rendering type template according to the matched optimal water conservancy professional model ID; querying and obtaining the optimal water conservancy professional model to obtain the corresponding dynamic script; using the output results as output parameters, parsing and executing the corresponding dynamic script, filling the processed data into the queried rendering type template to obtain the final rendering data; the client receives, parses and renders the final rendering data, and displays the corresponding rendering results.
3. According to the method of coupling the water conservancy professional model and the large language model based on intention recognition in claim 1, it is characterized in that: The interpretation input conditions specifically include: querying the subject object field description required for input of the optimal water conservancy professional model, combining with the existing subject object field description, analyzing which subject objects are in the natural sentence of the recognition problem, and extracting those subject objects; querying the time parameter object field description required for input of the optimal water conservancy professional model, combining with the existing time parameter object field description, analyzing which corresponding time parameters are in the natural sentence of the recognition problem, and extracting those corresponding time parameters; querying the hydrological numerical parameter object field description required for input of the optimal water conservancy professional model, combining with the existing hydrological numerical parameter object field description, analyzing which corresponding hydrological numerical parameters are in the natural sentence of the recognition problem, and extracting those corresponding hydrological numerical parameters.
4. A method for coupling a water conservancy professional model and a large language model based on intention recognition according to any one of claims 1 to 3, characterized in that: The natural language of the question is pre-processed with text and a semantic vector is used to represent the user's intention.
5. According to the method for coupling a water conservancy professional model with a large language model based on intention recognition according to claim 4, it is characterized in that: The similarity is obtained by calculating the semantic vector of the user's intention and the semantic vector of the model's intention.
Citation Information
Patent Citations
Information display method and device, equipment and storage medium
CN117591217A
Intelligent domain matching method and system based on intention large model
CN117708286A
Guide method and system based on tourism context and large language model
CN118132796A
Systems and Methods for Textual Classification Using Natural Language Understanding Machine Learning Models for Automating Business Processes
US20240062016A1
Data processing method and apparatus, and device and medium
WO2024179581A1
Cited By
Water environment pollution analysis method, device and equipment based on large language model
CN121351976A
Water environment pollution analysis method, device and equipment based on large language model
CN121351976B
Integrated system and method based on hydrological and hydrodynamic model, program product and equipment
CN121638134A