Intelligent questioning and answering method and system for knowledge graph in electric power marketing field based on large model Agent

By introducing large model Agent into the knowledge graph intelligent question and answer system, rewriting, analyzing and optimizing query intentions, the efficiency and accuracy problems of existing systems in understanding complex queries, query rewriting and iteration processes are solved, and more efficient and accurate query results are achieved.

CN119760083APending Publication Date: 2025-04-04STATE GRID JIANGSU ELECTRIC POWER CO LTD MARKETING SERVICE CENT +1
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202411875712.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-18
Publication Date
2025-04-04

AI Technical Summary

Technical Problem

Existing knowledge graphs and intelligent question-answer systems have efficiency and accuracy issues in understanding complex or fuzzy query intent, query rewriting and iterative processes.

Method used

The intelligent question-and-answer method of knowledge graphs in the field of power marketing based on the big model Agent is adopted. Through the question rewriting tool, query statement generation tool, graph query tool and result generation tool, the rewriting of question sentences, intent analysis, query statement conversion and result evaluation are realized, and the iteration process is optimized.

Benefits of technology

It improves the system's understanding of complex query intentions, enhances the accuracy and efficiency of query results, simplifies the iteration process, reduces manual intervention, and improves user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119760083A_ABST
    Figure CN119760083A_ABST
Patent Text Reader

Abstract

The invention discloses an intelligent questioning and answering method and system for a knowledge graph in the field of power marketing based on a large model Agent, and the method comprises the steps: obtaining a to-be-queried question and the large model Agent, enabling a question rewriting tool of the large model Agent to complete and rewrite the question Q based on a constructed prompt word module and a pre-trained templated processing model, and carrying out the quality verification of a rewritten new question Q '; inputting the new question Q'passing the quality auditing into a large model Agent, and converting the new question Q'into at least one query statement q; the query statement q is processed through a result generation tool, a result R returned by processing is received, and the result R contains data requested by the query statement q; the large model Agent evaluates the result R, if the result R is correct, the result R is output, if not, the iteration process is started, and in the iteration process, the large model Agent judges whether to rewrite the generated new question Q'and generate a new query statement.By means of the question query rewriting method and device, the question query rewriting capacity can be enhanced, the query result accuracy can be improved, and the query efficiency can be optimized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of knowledge graphs, and more specifically, to an intelligent question-answering method for knowledge graphs in the field of power marketing based on a large model agent. Background Art

[0002] In the field of knowledge graph and intelligent question answering, a variety of technical solutions have been proposed for processing and answering user questions. These solutions usually include natural language processing (NLP), machine learning, deep learning and other technologies. For example, some systems store and organize information by building knowledge graphs, and then use query language or natural language processing technology to understand the user's query intent and retrieve relevant information from the knowledge graph. The question answering system on the knowledge graph in the prior art, including different methods and technologies, adopts traditional data analysis methods, such as using spreadsheet software (such as Microsoft Excel) for data collation and analysis. This method may not be able to handle large-scale data sets, and is less efficient when processing complex queries and data relationships, and the accuracy may also be limited. In addition, it lacks automated and intelligent processing capabilities, and may require more manual intervention and time to complete data analysis tasks. In addition, there are also research works focusing on optimizing the behavior of intelligent agents (Agents) through reinforcement learning so that they can respond to user queries more accurately, such as optimizing dialogue systems, including the behavior of intelligent agents, through reinforcement learning.

[0003] Existing knowledge graphs and intelligent question-answering systems have some defects, such as:

[0004] 1. Limited understanding ability: Knowledge graphs may not be able to accurately understand complex or ambiguous query intent, resulting in inaccurate retrieval results;

[0005] 2. Insufficient query rewriting: For incomplete or imprecise queries, existing systems may lack effective rewriting mechanisms to improve query accuracy;

[0006] 3. Complex iteration process: When processing queries, if multiple iterations are required to optimize the results, existing knowledge graph systems may lack an efficient iteration mechanism. Summary of the invention

[0007] In order to solve the deficiencies in the prior art, the present invention provides a knowledge graph intelligent question answering method in the field of power marketing based on a large model Agent, which can solve the technical problems in the prior art of limited understanding ability of the knowledge graph intelligent question answering system, insufficient query rewriting and complex iteration process.

[0008] The present invention adopts the following technical solution.

[0009] An intelligent question-answering method for knowledge graph in the field of power marketing based on a large model agent includes the following steps:

[0010] Step 101, obtaining a question to be queried and a large model Agent trained with power marketing data, wherein the large model Agent includes a question rewriting tool, a query statement generation tool, a graph query tool, and a result generation tool;

[0011] Step 102, the question rewriting tool completes and rewrites the question sentence Q based on the constructed prompt word module and the pre-trained template processing model, and performs a quality review on the rewritten new question sentence Q';

[0012] Step 103, input the new question Q' that has passed the quality review into the large model Agent for analysis, query the intention of the new question Q' and map it to the graph query tool, and use the query statement generation tool to convert the new question Q' into at least one query statement q;

[0013] Step 104, process the query statement q through the result generation tool, and receive the result R returned by the processing, where the result R includes the data requested by the query statement q;

[0014] Step 105, the large model Agent evaluates the result R, and outputs the result R if it is correct, otherwise returns to step 2 to iterate until a correctly evaluated result R is obtained.

[0015] Preferably, the question rewriting tool completes and rewrites the question sentence Q based on building a prompt word module and obtaining a pre-trained template process, specifically including:

[0016] Build a prompt word module and obtain a pre-trained large model. After the pre-trained template processing model inputs the template and question, it outputs the rewritten question;

[0017] The question rewriting tool rewrite calls the pre-trained template processing model and prompt word module, inputs the prompt word and question Q into the template processing model, and the template processing model rewrites the input question to obtain the rewritten new question Q'.

[0018] Preferably, the rewritten new question Q' is subjected to a quality review, specifically including:

[0019] Set a quality threshold. If the new question sentence Q′ output by the question rewriting tool rewrite does not meet the quality threshold, it will be regenerated by dynamically adjusting the function g:

[0020] Q′=g(O i , Q(O i ))

[0021] Among them, Q(O i) is the quality evaluation function; g represents the dynamic adjustment function; i Represents the question sentence output in the i-th round.

[0022] Preferably, the new question Q' that has passed the quality review is input into the large model Agent for analysis, and the intention of the new question Q' is queried and mapped to the graph query tool, specifically including:

[0023] The new question Q' is preprocessed to adapt to the input format of the large model. The large model Agent extracts the overall semantic information of the question based on the new question Q', and maps the extracted semantics to an available query tool in the map.

[0024] Preferably, the query statement generation tool query-gen is used to convert at least one query statement q, specifically including:

[0025] Parse the semantic structure and intent of the new question Q', including extracting key entities, relations, and attributes in the new question;

[0026] Predefine query templates, which at least include query tasks of statistics, comparison, and trend analysis, and select corresponding query templates according to the semantic structure of the new question Q′;

[0027] Generate a query statement q suitable for the database or knowledge graph.

[0028] Preferably, the large model Agent evaluates the result R specifically including:

[0029] Compare the semantics of the new question Q′ with the result R and calculate the similarity;

[0030] Map the keywords and core semantic elements in the question to the result R to determine whether it is fully answered;

[0031] Calculate the quality score to quantitatively evaluate the quality of R's answer;

[0032] A preset quality score threshold is obtained. If the quality score of the result R is greater than the threshold, it means that the evaluation result is correct. Otherwise, the evaluation result is wrong and returns to step 102.

[0033] Preferably, the calculation formula of the quality score BLEU is as follows:

[0034]

[0035] Among them, BP represents the penalty factor, N is the number of n-grams considered, wn is the weight, and p n Indicates the precision of the n-gram.

[0036] The present invention also proposes a knowledge graph intelligent question-answering system in the field of power marketing based on a large model agent, which is used to implement the knowledge graph intelligent question-answering method in the field of power marketing based on a large model agent, including: a collection module, a rewriting review module, an analysis and conversion module, a result generation module, an evaluation module, and an iterative rewriting module;

[0037] The acquisition module is used to obtain the questions to be queried and the large model agent trained with power marketing data. The large model agent includes a question rewriting tool, a query statement generation tool, a graph query tool, and a result generation tool.

[0038] The rewriting review module completes and rewrites the question Q based on the constructed prompt word module and the pre-trained template processing model, and performs quality review on the rewritten new question Q';

[0039] The analysis and conversion module is used to analyze the new question Q' that has passed the quality review, query the intent of the new question Q' and map it into the graph query tool, and use the query statement generation tool to convert the new question Q' into at least one query statement q;

[0040] The result generation module processes the query statement q based on the result generation tool and receives the result R returned by the processing, and the result R includes the data requested by the query statement q;

[0041] The evaluation module evaluates the result R based on the large model Agent and outputs the result R if it is correct;

[0042] The iterative rewriting module is used to determine whether to rewrite the generated new question sentence Q' and generate a new query sentence through the large model Agent when the evaluation is incorrect.

[0043] The present invention also provides a terminal, comprising a processor and a storage medium;

[0044] The storage medium is used to store instructions;

[0045] The processor is used to operate according to the instructions to execute the steps of the intelligent question-answering method based on the knowledge graph in the power marketing field based on the large model agent.

[0046] The present invention also proposes a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the steps of the intelligent question-answering method based on the knowledge graph in the power marketing field based on a large model agent are implemented.

[0047] The beneficial effects of the present invention are that, compared with the prior art, the present invention can enhance the query rewriting capability of questions, improve the system's ability to understand complex query intent by processing incomplete or inaccurate queries, and improve the accuracy of query results through intelligent rewriting and accurate query statement generation; optimize query efficiency: simplify and optimize the iterative process of query processing, and reduce the query processing time; enhance the query result quality of questions: provide a more accurate result evaluation and iteration mechanism to ensure the quality of retrieval results; improve user experience: by providing more accurate and efficient query services, the user experience is improved. The present invention has at least the following beneficial effects:

[0048] 1. By connecting various processes in series through the large model Agent and using multiple large model tools, the data in the entire process is automatically processed, which not only improves the accuracy of the query but also greatly reduces the intervention of human factors and improves efficiency.

[0049] 2. Each tool achieves deep functional integration through the design of a collaborative mechanism. Through the design of a set of collaborative mechanisms, the subsequent tools are closely dependent on the previous tools. For example, the model parameters, optimization targets or input data formats of the subsequent tools can be dynamically adjusted through the feature embedding or prediction results generated by the previous tool. This collaborative mechanism greatly improves the automation and accuracy of the entire process, avoiding the information fragmentation and error accumulation problems caused by the independent operation of traditional tools.

[0050] 3. A unified end-to-end training architecture is built, and each tool is jointly optimized under the same framework. Specifically, the output of the early tool is not only directly used by the subsequent tool, but also affects the update of the early tool through the designed feedback mechanism. For example, the error of the subsequent tool is back-propagated to the previous tool to optimize its output characteristics, so that the entire system can iterate together towards the global optimization goal.

[0051] 4. A dynamic adaptation mechanism is proposed. The intermediate results generated by the previous tool are not only used as inputs for subsequent tools, but also analyzed and adjusted in real time through the adaptive module to meet the needs of subsequent tools. In this way, data flows between different tools can be seamlessly connected, while greatly reducing the complexity of manual adjustments. The dynamic adaptation mechanism dynamically adjusts the processing strategy of the next tool based on the quality evaluation results, and adjusts in real time according to the context, improving overall robustness.

[0052] 5. The entire system is designed as a multi-layer structure, each layer represents a specific tool or module, and the interfaces between layers are deeply integrated through standardized and optimized algorithms. For example, the output results of the previous layer of tools are not only directly passed to the next layer, but also dynamically adjust the processing strategy of the next layer by introducing multi-dimensional evaluation indicators. This layered design allows the system to be flexibly expanded while ensuring the deep connection between the tools. BRIEF DESCRIPTION OF THE DRAWINGS

[0053] Figure 1 It is a flow chart of the intelligent question-answering method of the knowledge graph in the field of power marketing based on the large model Agent in the present invention;

[0054] Figure 2 It is a structural diagram of the knowledge graph intelligent question-answering system in the field of power marketing based on the large model Agent in the present invention. DETAILED DESCRIPTION

[0055] In order to make the purpose, technical scheme and advantages of the present invention clearer, the technical scheme of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. The embodiments described in this application are only part of the embodiments of the present invention, not all of them. Based on the spirit of the present invention, other embodiments obtained by ordinary technicians in this field without creative work are all within the scope of protection of the present invention.

[0056] like Figure 1 As shown, the present invention proposes a knowledge graph intelligent question answering method in the field of power marketing based on a large model agent, and the method comprises the following steps:

[0057] Step 101, obtain the question to be queried and the big model Agent trained with power marketing data, the big model Agent includes a question rewriting tool rewrite, a query statement generation tool query-gen, a graph query tool kg-search, and a result generation tool result.

[0058] Step 102, the question rewriting tool completes and rewrites the question sentence Q based on the constructed prompt word module and the pre-trained template processing model, and performs a quality review on the rewritten new question sentence Q';

[0059] Specifically, the large model Agent and the question sentence Q with query in step 101 are obtained, and the question rewriting tool rewrite mentioned in step 101 is used to complete and rewrite the question sentence Q based on building a prompt word module and obtaining a pre-trained template processing, which specifically includes:

[0060] Build a prompt word module and obtain a pre-trained large model. After the pre-trained template processing model inputs the template and question, it outputs the rewritten question;

[0061] The question rewriting tool rewrite calls the pre-trained template processing model and prompt word module, inputs the prompt word and question Q into the template processing model, and the template processing model rewrites the input question to obtain the rewritten new question Q'.

[0062] For example, if a user inputs "I would like to know the impact of rising agricultural electricity prices on the primary processing costs of agricultural products?", it can be rewritten as "Please analyze the specific impact of rising agricultural electricity prices on the primary processing costs of agricultural products."

[0063] Furthermore, the rewritten new question Q' is subject to quality review, including:

[0064] Set a quality threshold. If the new question sentence Q′ output by the question rewriting tool rewrite does not meet the quality threshold, it will be regenerated by dynamically adjusting the function g:

[0065] Q′=g(O i , Q(0 i ))

[0066] Among them, Q(O i ) is the quality evaluation function; g represents the dynamic adjustment function; i Represents the question sentence output in the i-th round.

[0067] Preferably, the quality evaluation function can select a pre-trained reward model for automatic scoring.

[0068] Step 103: Input the new question Q' that has passed the quality review into the large model Agent for analysis, query the intention of the new question Q' and map it to the graph query tool, and use the query statement generation tool to convert the new question Q' into at least one query statement q

[0069] The new question Q' obtained in step 102 is input into the large model Agent in step 101 for analysis, the query intent in the new question Q' is identified and mapped to the graph query tool kg-search of the large model Agent in step 101, and then the query statement generation tool query-gen is used to convert the new question Q' into at least one query statement q.

[0070] Specifically, the new question Q' that has passed the quality review is input into the large model Agent for analysis, and the intent of the new question Q' is queried and mapped to the graph query tool, including:

[0071] The new question Q' is preprocessed to adapt to the input format of the large model. The large model Agent extracts the overall semantic information of the question based on the new question Q', and maps the extracted semantics to an available query tool in the map.

[0072] Combined with the example of step 102, the big model agent analyzes the rewritten question and identifies that the query intent is to understand the impact of "increase in agricultural electricity prices" on "primary processing costs of agricultural products". Based on this query intent, the big model agent maps the query to the knowledge graph query tool kg-search to retrieve information in the knowledge graph related to "agricultural production electricity", "primary processing of agricultural products" and "cost", such as Figure 2 shown.

[0073] Use the query-gen tool to generate at least one specific query statement q based on the information retrieved from the knowledge graph, which is used to query the database or knowledge graph. Specifically, it includes:

[0074] Parse the semantic structure and intent of the new question Q', including extracting key entities, relations, and attributes in the new question;

[0075] Predefine query templates, which at least include query tasks of statistics, comparison, and trend analysis. Select the corresponding query template according to the semantic structure of the new question Q′.

[0076] Generate a query statement Q' suitable for the database or knowledge graph.

[0077] Step 104, process the query statement q through the result generation tool, and receive the result R returned by the processing, where the result R includes the data requested by the query statement q;

[0078] Combined with the query statement q obtained in step 103, the result generation tool result mentioned in step 101 is executed and then the result R returned is received, and the result R includes the data requested by the query statement q. For example, if the Neo4j database is used, the query statement q can be expressed in the following Gremlin code:

[0079]

[0080] This query statement aims to retrieve the average impact of rising agricultural electricity prices on the primary processing costs of agricultural products from the knowledge graph, and obtain the result R through the result generation tool result.

[0081] Step 105, the large model Agent evaluates the result R, and outputs the result R if it is correct, otherwise the iteration process is started, and the large model Agent determines whether to rewrite the generated new question sentence Q' and generate a new query sentence.

[0082] The large model Agent in step 101 receives and analyzes the result R of step 104 for evaluation. If the result R is correct, the output step is executed to present the result R to the user or other system components; otherwise, the iteration process is started. During the iteration process, the large model Agent determines whether to rewrite the new question Q' generated in step 102 or the query statement q generated in step 103, and then iterates until the result R with correct evaluation is obtained.

[0083] Specifically, the large model Agent evaluates the result R by:

[0084] Compare the semantics of the user's question Q' with the result R and calculate the similarity;

[0085] Map the keywords and core semantic elements in the question to the result R to determine whether it is fully answered;

[0086] Calculate the quality score to quantitatively evaluate the quality of R's answer;

[0087] A preset quality score threshold is obtained. If the quality score of the result R is greater than the threshold, it means that the evaluation result is correct. Otherwise, the evaluation result is wrong and returns to step 102 until a correct evaluation result R is obtained.

[0088] Among them, the calculation formula of the quality score BLEU is as follows:

[0089]

[0090] Among them, BP represents the penalty factor, N is the number of n-grams considered, wn is the weight, usually equal to 1 / N, and p n Indicates the precision of the n-gram.

[0091] Combined with the example in step 103, suppose the query result shows that the increase in agricultural electricity prices has led to an average increase of 5% in the cost of primary processing of agricultural products, that is, the result R: The increase in agricultural electricity prices has led to an average increase of 5% in the cost of primary processing of agricultural products, which is then evaluated by the large model agent. If this result meets expectations, that is, the data is accurate and the logic is reasonable, the large model agent will perform the output step and present this result to the user or other system components. If the result is incorrect or does not meet expectations, the large model agent will start the iterative process, return to step 102, rewrite the question Q' or query statement q, and then execute the query and evaluation again until a satisfactory result is obtained.

[0092] Application scenario: The power company wants to optimize its marketing strategy to improve customer satisfaction and market competitiveness. To achieve this goal, the company needs to deeply analyze customers' electricity consumption behavior, service preferences, and market trends; the preferred solution is:

[0093] 1. Get the question to be queried Q: Questions that power companies may need to answer include "Which areas of customers are more inclined to use renewable energy?" or "Which time periods have the highest customer electricity demand?".

[0094] 2. Question rewriting tool rewrite: Convert these natural language questions into query statements that can be understood by the system. For example, rewrite "Which regions' customers are more inclined to use renewable energy?" into "Query the proportion of customers in each region using renewable energy."

[0095] 3. Graph query tool kg-search: Searches for relevant information in the knowledge graph of power marketing data to identify the use of renewable energy by customers in different regions.

[0096] 4. Query statement generation tool query-gen: Generates specific query statements to extract data from the database.

[0097] 5. Result generation tool result: executes the query and generates results, which may include a chart of the proportion of customers using renewable energy in each region.

[0098] 6. Result evaluation and iteration: The big model agent analyzes the results and evaluates their accuracy and practicality. If the results do not meet expectations, the big model agent rewrites the query statement or adjusts the analysis parameters and then executes the query again.

[0099] like Figure 2 As shown, the present invention also proposes a knowledge graph intelligent question-answering system in the field of power marketing based on a large model agent, which is used to implement the above-mentioned knowledge graph intelligent question-answering method in the field of power marketing based on a large model agent. The system includes: a collection module, a rewriting review module, an analysis and conversion module, a result generation module, an evaluation module, and an iterative rewriting module;

[0100] The acquisition module is used to obtain the questions to be queried and the large model agent trained with power marketing data. The large model agent includes a question rewriting tool, a query statement generation tool, a graph query tool, and a result generation tool.

[0101] The rewriting review module completes and rewrites the question Q based on the constructed prompt word module and the pre-trained template processing model, and performs quality review on the rewritten new question Q';

[0102] The analysis and conversion module is used to analyze the new question Q' that has passed the quality review, query the intent of the new question Q' and map it into the graph query tool, and use the query statement generation tool to convert the new question Q' into at least one query statement q;

[0103] The result generation module processes the query statement q based on the result generation tool and receives the result R returned by the processing, and the result R includes the data requested by the query statement q;

[0104] The evaluation module evaluates the result R based on the large model Agent and outputs the result R if it is correct;

[0105] The iterative rewriting module is used to determine whether to rewrite the generated new question sentence Q' and generate a new query sentence through the large model Agent when the evaluation is incorrect.

[0106] The beneficial effect of the present invention is that, compared with the prior art, the present invention can enhance the query rewriting capability of questions to process incomplete or imprecise queries to improve the system's understanding of complex query intent, improve the accuracy of query results and optimize query efficiency.

[0107] The present disclosure may be a system, a method and / or a computer program product. The computer program product may include a computer-readable storage medium carrying computer-readable program instructions for causing a processor to implement various aspects of the present disclosure.

[0108] Computer readable storage medium can be a tangible device that can keep and store the instructions used by the instruction execution device. Computer readable storage medium can be, for example, but not limited to, an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination thereof. More specific examples (non-exhaustive list) of computer readable storage medium include: portable computer disk, hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), static random access memory (SRAM), portable compact disk read-only memory (CD-ROM), digital versatile disk (DVD), memory stick, floppy disk, mechanical encoding device, for example, a punch card or a convex structure in a groove on which instructions are stored, and any suitable combination thereof. Computer readable storage medium used here is not interpreted as instantaneous signal itself, such as radio waves or other free propagating electromagnetic waves, electromagnetic waves propagated by waveguides or other transmission media (for example, light pulses by optical fiber cables), or electrical signals transmitted by wires.

[0109] The computer-readable program instructions described herein can be downloaded from a computer-readable storage medium to each computing / processing device, or downloaded to an external computer or external storage device via a network, such as the Internet, a local area network, a wide area network, and / or a wireless network. The network can include copper transmission cables, optical fiber transmissions, wireless transmissions, routers, firewalls, switches, gateway computers, and / or edge servers. The network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards the computer-readable program instructions for storage in the computer-readable storage medium in each computing / processing device.

[0110] The computer program instructions for performing the disclosed operation may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-related instructions, microcode, firmware instructions, state setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages, such as Smalltalk, C++, etc., and conventional procedural programming languages, such as "C" language or similar programming languages. Computer-readable program instructions may be executed completely on a user's computer, partially on a user's computer, as an independent software package, partially on a user's computer, partially on a remote computer, or completely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., using an Internet service provider to connect via the Internet). In some embodiments, an electronic circuit, such as a programmable logic circuit, a field programmable gate array (FPGA), or a programmable logic array (PLA), may be personalized by utilizing the state information of the computer-readable program instructions, and the electronic circuit may execute the computer-readable program instructions, thereby realizing various aspects of the disclosed invention.

[0111] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the above embodiments, ordinary technicians in the relevant field should understand that the specific implementation methods of the present invention can still be modified or replaced by equivalents, and any modifications or equivalent replacements that do not depart from the spirit and scope of the present invention should be covered within the scope of protection of the claims of the present invention.

Claims

1. A knowledge graph intelligent question answering method in the field of power marketing based on a large model agent, characterized in that: The steps include: Step 101, obtaining a question to be queried and a large model Agent trained with power marketing data, wherein the large model Agent includes a question rewriting tool, a query statement generation tool, a graph query tool, and a result generation tool; Step 102, the question rewriting tool completes and rewrites the question sentence Q based on the constructed prompt word module and the pre-trained template processing model, and performs a quality review on the rewritten new question sentence Q'; Step 103, input the new question Q' that has passed the quality review into the large model Agent for analysis, query the intention of the new question Q' and map it to the graph query tool, and use the query statement generation tool to convert the new question Q' into at least one query statement q; Step 104, process the query statement q through the result generation tool, and receive the result R returned by the processing, where the result R includes the data requested by the query statement q; Step 105, the large model Agent evaluates the result R, and outputs the result R if it is correct, otherwise returns to step 2 to iterate until a correctly evaluated result R is obtained.

2. The intelligent question-answering method for knowledge graph in the field of power marketing based on a large model agent according to claim 1 is characterized in that: The question rewriting tool completes and rewrites the question Q based on building a prompt word module and obtaining pre-trained template processing, including: Build a prompt word module and obtain a pre-trained large model. After the pre-trained template processing model inputs the template and question, it outputs the rewritten question; The question rewriting tool rewrite calls the pre-trained template processing model and prompt word module, inputs the prompt word and question Q into the template processing model, and the template processing model rewrites the input question to obtain the rewritten new question Q'.

3. The intelligent question-answering method for knowledge graph in the field of power marketing based on a large model agent according to claim 1 is characterized in that: Conduct a quality review on the rewritten new question Q', including: Set a quality threshold. If the new question sentence Q′ output by the question rewriting tool rewrite does not meet the quality threshold, it will be regenerated by dynamically adjusting the function g: Q′=g(O i ,Q(O i )) Among them, Q(O i ) is the quality evaluation function; g represents the dynamic adjustment function; i Represents the question sentence output in the i-th round.

4. The intelligent question-answering method for knowledge graph in the field of power marketing based on a large model agent according to claim 1 is characterized in that: The new question Q' that has passed the quality review is input into the large model agent for analysis, and the intent of the new question Q' is queried and mapped to the graph query tool, including: The new question Q' is preprocessed to adapt to the input format of the large model. The large model Agent extracts the overall semantic information of the question based on the new question Q', and maps the extracted semantics to an available query tool in the map.

5. The intelligent question-answering method for knowledge graph in the field of power marketing based on a large model agent according to claim 1 is characterized in that: Use the query statement generation tool query-gen to convert it into at least one query statement q, including: Parse the semantic structure and intent of the new question Q', including extracting key entities, relations, and attributes in the new question; Predefine query templates, which at least include query tasks of statistics, comparison, and trend analysis, and select corresponding query templates according to the semantic structure of the new question Q′; Generate a query statement q suitable for the database or knowledge graph.

6. The intelligent question-answering method for knowledge graph in the field of power marketing based on a large model agent according to claim 1 is characterized in that: The large model Agent evaluates the result R specifically including: Compare the semantics of the new question Q′ with the result R and calculate the similarity; Map the keywords and core semantic elements in the question to the result R to determine whether it is fully answered; Calculate the quality score to quantitatively evaluate the quality of R's answer; A preset quality score threshold is obtained. If the quality score of the result R is greater than the threshold, it means that the evaluation result is correct. Otherwise, the evaluation result is wrong and returns to step 102.

7. The intelligent question-answering method for knowledge graph in the field of power marketing based on a large model agent according to claim 6 is characterized in that: The calculation formula of the quality score BLEU is as follows: Among them, BP represents the penalty factor, N is the number of n-grams considered, wn is the weight, and p n Indicates the precision of the n-gram.

8. A large model Agent-based power marketing knowledge graph intelligent question answering system, used to implement the large model Agent-based power marketing knowledge graph intelligent question answering method according to any one of claims 1 to 7, characterized in that: include: Acquisition module, rewriting review module, analysis conversion module, result generation module, evaluation module, iterative rewriting module; The acquisition module is used to obtain the questions to be queried and the large model agent trained with power marketing data. The large model agent includes a question rewriting tool, a query statement generation tool, a graph query tool, and a result generation tool. The rewriting review module completes and rewrites the question Q based on the constructed prompt word module and the pre-trained template processing model, and performs quality review on the rewritten new question Q'; The analysis and conversion module is used to analyze the new question Q' that has passed the quality review, query the intent of the new question Q' and map it into the graph query tool, and use the query statement generation tool to convert the new question Q' into at least one query statement q; The result generation module processes the query statement q based on the result generation tool and receives the result R returned by the processing, and the result R includes the data requested by the query statement q; The evaluation module evaluates the result R based on the large model Agent and outputs the result R if it is correct; The iterative rewriting module is used to determine whether to rewrite the generated new question sentence Q' and generate a new query sentence through the large model Agent when the evaluation is incorrect.

9. A terminal comprising a processor and a storage medium; characterized in that: The storage medium is used to store instructions; The processor is configured to operate according to the instructions to execute the steps of the method according to any one of claims 1-7.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.

Citation Information

Cited By

  • Intelligent evaluation method and device for large model and medium

    CN120179794A

  • Question and answer retrieval method and device based on multiple agents

    CN121722864A