Movatterモバイル変換


[0]ホーム

URL:


CN119003742A - Digital intelligent power regulation question-answering method and system based on large language model - Google Patents

Digital intelligent power regulation question-answering method and system based on large language model
Download PDF

Info

Publication number
CN119003742A
CN119003742ACN202411469462.8ACN202411469462ACN119003742ACN 119003742 ACN119003742 ACN 119003742ACN 202411469462 ACN202411469462 ACN 202411469462ACN 119003742 ACN119003742 ACN 119003742A
Authority
CN
China
Prior art keywords
text
question
vector
user
model
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202411469462.8A
Other languages
Chinese (zh)
Other versions
CN119003742B (en
Inventor
倪铭坚
付聪
陶蕾
黄运豪
武书舟
王佳琪
宁馨
齐晓琳
韩昳
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Electric Power Research Institute Co Ltd CEPRI
Original Assignee
China Electric Power Research Institute Co Ltd CEPRI
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by China Electric Power Research Institute Co Ltd CEPRIfiledCriticalChina Electric Power Research Institute Co Ltd CEPRI
Priority to CN202411469462.8ApriorityCriticalpatent/CN119003742B/en
Publication of CN119003742ApublicationCriticalpatent/CN119003742A/en
Application grantedgrantedCritical
Publication of CN119003742BpublicationCriticalpatent/CN119003742B/en
Activelegal-statusCriticalCurrent
Anticipated expirationlegal-statusCritical

Links

Classifications

Landscapes

Abstract

Translated fromChinese

一种基于大语言模型的数智化电力调控问答方法及系统,属于电力自动化技术领域,方法包括采集电力调控领域文本,使用嵌入模型获取电力调控领域文本的向量编码,并存入向量知识库;当用户提出问题时,接收用户问题文本并对用户问题文本进行预处理;将预处理后的用户问题文本输入检索工具,在向量知识库中进行检索和匹配,得到综合相似度符合要求的文本;采用大语言模型对综合相似度符合要求的文本进行后处理,并生成对应的答案。本发明将大模型技术、检索增强生成技术、记忆力机制以及链式工作流机制引入电力调控领域,建立了向量知识库构建链式工作流和智能问答链式工作流,能够提高问答准确性,能够以更加自然的语言交互,提升问答体验。

A digital electric power control question-answering method and system based on a large language model, belonging to the field of electric power automation technology, the method includes collecting text in the field of electric power control, using an embedding model to obtain vector encoding of the text in the field of electric power control, and storing it in a vector knowledge base; when a user asks a question, receiving the user's question text and preprocessing the user's question text; inputting the preprocessed user question text into a search tool, searching and matching in the vector knowledge base, and obtaining texts with comprehensive similarity that meet the requirements; using a large language model to post-process the texts with comprehensive similarity that meet the requirements, and generating corresponding answers. The present invention introduces large model technology, retrieval enhancement generation technology, memory mechanism, and chain workflow mechanism into the field of electric power control, establishes a vector knowledge base construction chain workflow and an intelligent question-answering chain workflow, which can improve the accuracy of question-answering, can interact in a more natural language, and enhance the question-answering experience.

Description

Digital intelligent power regulation question-answering method and system based on large language model
Technical Field
The invention belongs to the technical field of power automation, and particularly relates to a digital intelligent power regulation question-answering method and system based on a large language model.
Background
With the rapid development of information technology, especially the breakthrough of artificial intelligence and big data technology, automatic question-answering systems are gradually matured. The informatization and intelligent level improvement of the power regulation technology has important significance for ensuring the safe and stable operation of the power grid and improving the power service quality. Traditional power regulation question-answering systems rely on rule matching and simple keyword searching, which makes it difficult to process complex queries and provide deeply personalized services.
In the development process of the intelligent electric power regulation question-answering system, the existing technical scheme mainly depends on rule matching and keyword searching, for example, a method proposed in a Bert model-based electric power safety regulation intelligent question-answering method and system of patent application CN117407511A is mainly used for matching user questions through a preset rule base and retrieving answers related to keywords from a static knowledge base. The patent application with publication number CN117407511a represents one prior art scheme of a question-answer system in the power regulation field, and the technical scheme involves performing lexical, syntactic analysis and semantic understanding on text data in the power dispatching field, so as to realize automatic analysis and understanding of the text of the power safety regulations. Specifically, the main content of the scheme comprises: configuring question and answer pairs of the FAQ module, matching questions input by a user, text segmenting an electric power safety procedure document, generating an index file, establishing an index based on the output index file by using the Anserini module, extracting paragraphs, generating paragraph scores, adopting a pretrained Bert model, training by using a professional dataset and the like.
The question-answer pair of the FAQ module is configured to be used for filtering high-frequency questions, the FAQ module is used for matching the questions input by the user with the questions in the preset question-answer pair, if the questions are matched, the answers corresponding to the matched questions are returned, and if no return result or the matching score is lower than a threshold value, the following steps are carried out: and carrying out text segmentation on the electric power safety regulation document by using a preprocessing mode, adding text data of Chinese wikipedia, and generating an index file. Then, establishing an index based on the output index file by adopting a Anserini module, extracting paragraphs, and generating paragraph scores; further, a pretrained Bert model is adopted, CMRC2018 data and electric power safety regulation examination questions are used as professional data sets for training; then, according to the structure and characteristics of the regulation documents, parameters in the algorithm of the trained Bert model are optimized; then using the Bert model to extract candidate answers in Anserini modules and giving reading understanding scores, wherein the candidate answers are accurate answers of the extracted questions in the extracted N paragraphs; and then comprehensively weighting and scoring the candidate answers, sorting the scores, finally outputting the answer with the highest score, and giving the name of the original document and the specific chapter information of the answer. The prior art has at least the following disadvantages:
(1) The flexibility is not enough; the FAQ module matching method is very sensitive to the expression of the questions, and once the questions of the user deviate from the preset expression, the system can hardly give an accurate answer.
(2) The expandability is poor; with the continuous updating and expanding of knowledge in the power regulation field, the static knowledge base needs frequent manual updating and maintenance, which is time-consuming and labor-consuming and is easy to make mistakes.
(3) The context is poorly understood; this approach lacks the understanding capability of the dialog context and cannot handle problems with coherent dialogs or with dependency on historical interactions.
(4) The retrieval capability is limited; this approach is difficult to provide personalized search solutions and answers depending on the user's specific situation, but tends to give universal, standardized answers.
(5) The interactivity is not strong; in the method, the interactivity of the user interaction with the system through the natural language is weak, so that the user satisfaction is influenced.
Disclosure of Invention
Aiming at the problems in the prior art, the invention provides a digital intelligent power regulation question-answering method and system based on a large language model, which can improve question-answering accuracy, can interact in a more natural language and can improve question-answering experience of users.
In order to achieve the above purpose, the present invention has the following technical scheme:
in a first aspect, a method for digital intelligent power regulation question-answering based on a large language model is provided, including:
Acquiring a power regulation field text, acquiring a vector code of the power regulation field text by using an embedded model, and storing the vector code into a vector knowledge base;
when a user gives a question, receiving a user question text and preprocessing the user question text;
inputting the preprocessed user problem text into a retrieval tool, and retrieving and matching the user problem text in a vector knowledge base through the retrieval tool to obtain a text with comprehensive similarity meeting the requirement;
And (5) performing post-processing on the text with the comprehensive similarity meeting the requirement by adopting a large language model, and generating a corresponding answer.
As a preferred solution, the step of collecting the text of the electric power regulation and control field includes: preprocessing the collected text in the power regulation field, wherein the preprocessing operation comprises document analysis and conversion of a document in a non-text format into a plain text format;
And after preprocessing, carrying out segmentation slicing to divide the text content into paragraphs or sentences.
As a preferred solution, the step of obtaining the vector code of the text in the power regulation field by using the embedded model and storing the vector code in the vector knowledge base includes:
The vector coding of the text after the segmentation and slicing is obtained by adopting a bi-directional encoder BERT model, and the expression is as follows:
Wherein,Representing an input segmented slice text, s representing a vector representation of the corresponding text, θ representing the BERT model parameters; and establishing a relation between the text of the power regulation field and the corresponding vector by adopting an index form, and storing the relation in a vector knowledge base.
As a preferred scheme, in the step of receiving and preprocessing the user question text when the user presents the question, the preprocessing operation includes format conversion, noise removal and question reformulation of the user question text by using the large model and the corresponding prompt word;
Specifically, a regular expression is adopted to remove noise of a user problem text, and irrelevant characters and interference information in the text are removed; the question restation refers to a restation that uses a large model to normalize the user question text, and the expression is as follows:
In the formula, LLM () represents large model calculation, prompt represents Prompt words, original_question represents Original text of user problem, θ represents parameters of large model, and processed_question represents user problem after restatement.
As a preferable scheme, the step of inputting the preprocessed user question text into a search tool, and searching and matching the user question text in a vector knowledge base through the search tool, wherein the step of obtaining the text with the comprehensive similarity meeting the requirement comprises the following steps: the retrieval tool performs vector embedding on the user problem text, converts the user problem text into a vector, and retrieves and matches the most similar vector in a vector knowledge base by using vector similarity, text similarity and information loss indexes;
The vector similarity index is characterized by cosine similarity, and the expression is as follows:
wherein X, Y represents a vector formed by embedding two text segments;
The text similarity index is characterized by using Jaccard similarity, and the expression is as follows:
Wherein A and B are word sets of two sections of texts X and Y respectively, |A n B| represents the size of the intersection of two sets, |A n B| represents the size of the union of two sets;
the information loss index is characterized by using the difference between the information entropy and the mutual information, and the expression is as follows:
Wherein H (X) and H (Y) are information entropy of two vectors, and I (X; Y) is mutual information between the two vectors;
Based on cosine similarity, jaccard similarity and information loss index, the comprehensive similarity is calculated according to the following formula:
Where λC、λJ and λI are parameters that are adjusted according to the text type differences in the power regulation domain.
As a preferred solution, the step of post-processing the text with the integrated similarity meeting the requirement by using the large language model includes:
Adopting a large language model to carry out prompt compression, text rearrangement, text summarization and text fusion on the text with the comprehensive similarity meeting the requirement; the prompt compression is to reduce noise in information by compressing information retrieved from a knowledge base; the text rearrangement rearranges the retrieved text fragments to enable the text fragments to more accord with logic or semantic sequences; the text summarization is generated through a large language model, and a section of continuous characters is summarized from the extracted text information; the text fusion is to integrate information through a large language model and combine similar or supplementary information in a plurality of pieces of text information.
As a preferred scheme, the text rearrangement rearranges the retrieved text segments using a Cohere Rerank model, and the expression is as follows:
In the formula,For the sequence of vectors prior to the rearrangement,Is the rearranged vector sequence; n represents the number of vectors, reranker represents a Cohere Rerank model, S represents a standard adopted by rearrangement, and θ represents a parameter of a Cohere Rerank model; s and theta are adjusted according to different texts in the electric power regulation and control field.
As a preferable scheme, the intelligent electric power regulation question-answering method based on the large language model further comprises the step of storing the text of the question-answer into a memory component for calling, and the large language model generates corresponding answers according to the text information after text rearrangement, text summarization and text fusion by combining preset prompt words and calling of the memory component.
In a second aspect, a digital intelligent power regulation question-answering system based on a large language model is provided, including:
The text acquisition coding module is used for acquiring the text of the power regulation field, acquiring the vector codes of the text of the power regulation field by using the embedded model, and storing the vector codes into the vector knowledge base;
the problem text preprocessing module is used for receiving the user problem text and preprocessing the user problem text when the user gives a problem;
The retrieval matching module is used for inputting the preprocessed user problem text into a retrieval tool, and retrieving and matching the user problem text in a vector knowledge base through the retrieval tool to obtain a text with comprehensive similarity meeting the requirement;
And the answer generation module is used for carrying out post-processing on the texts with the comprehensive similarity meeting the requirements by adopting the large language model and generating corresponding answers.
In a third aspect, a computer-readable storage medium is provided, where at least one instruction is stored that, when executed by a processor, implements the large language model-based digital intelligent power regulation question-answering method.
Compared with the prior art, the first aspect of the invention has at least the following beneficial effects:
By combining an advanced large language model with the retrieval function of a text vector knowledge base in the power regulation field, when a user puts forward a problem, the user can understand and process the complex natural language problem and provide more accurate and relevant answers. According to the invention, the text with the comprehensive similarity meeting the requirement is post-processed by adopting the large language model, and the corresponding answer is generated, and the answers of multiple angles and crossing multiple power regulation sub-fields can be generated due to the language understanding and generating capability and the strong generalization performance of the large language model, so that the generalization performance of the power regulation question-answer is obviously improved. The intelligent power regulation question-answering method based on the large language model is not only suitable for conventional question-answering tasks, but also can cope with emergency consultation in power regulation, and increases the application range and flexibility of the system. By adopting the power regulation question-answering method provided by the invention, the dependence on professionals can be reduced, so that non-professional users can also quickly acquire power regulation related information, and the operation and maintenance cost is reduced.
Furthermore, the invention introduces a large model technology, a retrieval enhancement generation technology, a memory mechanism and a chained workflow mechanism into the field of electric power regulation, establishes a vector knowledge base to construct chained workflow and intelligent question-answer chained workflow, sequentially connects all modules by a chained structure, and completes text analysis and pretreatment, semantic-based segmentation slicing, language model-based vector embedding and index-based vector storage on texts in the field of electric power regulation by the vector knowledge base; the intelligent question-answering chain workflow sequentially completes preprocessing such as format conversion, noise removal, question re-expression and the like on a user text, vector embedding based on a language model, iterative and recursive retrieval based on comprehensive similarity measurement, post-processing including prompt compression, text rearrangement, text summarization and text fusion, answer generation based on a large language model and prompt words and the like. The question-answering method has higher independence, flexibility and expandability, and can reduce the development and maintenance cost of the system. Meanwhile, the memory component is utilized, so that the system has the capability of memorizing and reading the question-answering context, and the memory component is used as an independent component to be introduced into the intelligent question-answering chain type workflow for electric power regulation, thereby enhancing the continuity of conversation and improving the user interaction experience.
Furthermore, the invention provides the comprehensive similarity measurement consisting of text similarity, vector similarity and information loss, and the accuracy of vector retrieval and matching is greatly improved by utilizing the comprehensive similarity measurement, so that the effect of the whole question-answering system is improved.
It will be appreciated that the advantages of the second to third aspects may be found in the relevant description of the first aspect, and are not described in detail herein.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are needed in the embodiments or the description of the prior art will be briefly described below, it being obvious that the drawings in the following description are only some embodiments of the present application, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a schematic diagram of the design principle of a digital intelligent power control question-answering method based on a large language model in the embodiment of the invention;
FIG. 2 is a schematic flow chart of a chain workflow constructed by a vector knowledge base according to an embodiment of the invention;
FIG. 3 is a schematic flow diagram of an intelligent question-answering chain workflow according to an embodiment of the present invention.
Detailed Description
In the following description, for purposes of explanation and not limitation, specific details are set forth, such as particular system configurations, techniques, etc. in order to provide a thorough understanding of embodiments of the present application. It will be apparent, however, to one skilled in the art that the present application may be practiced in other embodiments that depart from these specific details. In other instances, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present application with unnecessary detail.
The embodiment of the invention provides a digital intelligent power control question-answering method based on a large language model, belongs to the application of the technical field of artificial intelligence in the technical field of power automation, and particularly relates to the improvement of the performance of an automatic question-answering system in the power control industry by using the large pre-training language model and a vector retrieval method through introducing a natural language processing technology. The technology ensures that the automatic question-answering system in the electric power regulation field has higher answer accuracy and response efficiency when processing the query with strong specialization and high real-time requirement, and meets the requirement of the industry on intelligent service in the informatization and digital transformation process.
Description about a search enhancement generation method (abbreviated as RAG in english): the search enhancement generation method (RETRIEVAL-Augmented Generation, RAG) is a natural language processing technique that combines information retrieval and text generation. In the method, the system first retrieves relevant context information or documents from a knowledge base using a pre-trained retrieval component. The retrieved information is then provided to a generation model that incorporates the information into its generated text to improve the accuracy of answering the questions, generate an interpretation, or enhance the output quality of the language model. The RAG method is particularly applicable to tasks requiring external knowledge, such as open domain questions and answers, factual content generation, or any scenario requiring reference to a specific knowledge point. In this way, the generated text is richer, more accurate and more informative.
Description of the large language model (or called large model, english abbreviation LLM): the large language model (Large Language Models) is a deep learning-based natural language processing technique that is widely used to understand and generate natural language text. These models are based on the transformer architecture, have a large number of parameters, and can handle large-scale data sets. The large model learns the complex patterns and structures of languages through pre-training on a large amount of texts, and therefore can perform excellently on various language tasks including text generation, translation, question-answering, abstract, emotion analysis and the like.
The embodiment of the invention discloses a digital intelligent power regulation question-answering method based on a large language model, which mainly comprises the following steps: large language models, such as the generative pre-training transformer GPT and bi-directional encoder BERT, are pre-trained on large-scale data sets using deep learning networks to understand and generate human language, thus providing rich semantic understanding and answer generation capabilities. The method for generating the search enhancement combines the information search technology and the language generation model, and generates answers by searching related documents and using the document auxiliary language model, thereby improving the accuracy and the reliability of the question-answering system. Vector embedding refers to converting text into a mathematical vector form, such that a machine can retrieve information by computing the similarity between vectors. Vector similarity calculation refers to measuring the similarity degree of two vectors by using mathematical methods such as cosine similarity, euclidean distance and the like, and finding the best match between a question and an answer. The memory component is then used to enhance the contextual understanding capabilities of the question-answering system, and is capable of memorizing and reading previous question-answering scenarios in order to provide a more consistent and accurate answer.
Referring to fig. 1, the digital intelligent power regulation question-answering method based on a large language model in the embodiment of the invention includes:
S1, acquiring a power regulation field text, acquiring a vector code of the power regulation field text by using an embedded model, and storing the vector code into a vector knowledge base;
s2, when a user gives a problem, receiving a user problem text and preprocessing the user problem text;
S3, inputting the preprocessed user problem text into a search tool, and searching and matching in a vector knowledge base through the search tool to obtain a text with comprehensive similarity meeting the requirement;
S4, performing post-processing on the text with the comprehensive similarity meeting the requirement by adopting a large language model, and generating a corresponding answer.
In one possible implementation manner, the step of collecting the text of the power regulation field in step S1 includes:
Preprocessing the acquired text in the power regulation field, wherein the preprocessing operation comprises document analysis and conversion of a document in a non-text format into a plain text format, for example, text materials exist in the non-text format (such as PDF or Word document) and need to be converted into the plain text format, and the embodiment of the invention is realized through PyPDF and Python-docx libraries in Python programming software. And after preprocessing, segmentation slicing is carried out to divide the text content into smaller paragraphs or sentences. In the embodiment of the invention, the clauses and the segmentation are realized through NLTK libraries in Python programming software and semantic analysis technology.
In one possible implementation manner, the step of obtaining the vector code of the text of the power regulation field using the embedded model and storing the vector code in the vector knowledge base in step S1 includes:
And acquiring the vector codes of the text after the segmented slicing by adopting a bi-directional encoder BERT model, and acquiring the vector codes of the segmented slicing text by adopting the bi-directional encoder BERT model. For more complex power regulation contexts, BERT can process whole pieces of text, capturing more rich context information. The bi-directional encoder BERT model obtains the expression of vector coding as follows:
Wherein,Representing an input segmented slice text, s representing a vector representation of the corresponding text, θ representing the BERT model parameters; and establishing a relation between the text of the power regulation field and the corresponding vector by adopting an index form, and storing the relation in a vector knowledge base.
In order to modularly and extendably combine the various flows of the system together, embodiments of the present invention introduce a chained workflow structure to sequentially and independently perform the various steps. Step S1 is to construct a chained workflow for the vector knowledge base, as shown in FIG. 2.
In a possible implementation manner, when a user presents a problem, step S2, a preprocessing module in the intelligent question-answering chain workflow performs format conversion on a user problem text, removes noise and restatement of the problem by using a large model and corresponding prompt words through a format conversion component; specifically, a regular expression is adopted to remove noise of a user problem text, and irrelevant characters and interference information in the text are removed; the problem restation refers to the standardized restation of user problem text by using a large model for subsequent processing, and the expression of this process is as follows:
In the formula, LLM () represents large model calculation, prompt represents Prompt words, original_question represents Original text of user problem, θ represents parameters of large model, and processed_question represents user problem after restatement.
Steps S2 to S5 of the embodiment of the present invention are the flow of the intelligent question-answering chain workflow, as shown in fig. 3.
In one possible implementation manner, step S3 of inputting the preprocessed text of the user question into a search tool, and searching and matching the text in a vector knowledge base by the search tool, where obtaining the text with the integrated similarity meeting the requirement includes: the retrieval tool adopts a bi-directional encoder BERT embedded network to carry out vector embedding on the user problem text, converts the user problem text into a vector, and then utilizes vector similarity, text similarity and information loss indexes to retrieve and match the most similar vector in a vector knowledge base;
The vector similarity index is characterized by cosine similarity, and the expression is as follows:
wherein X, Y represents a vector formed by embedding two text segments;
The text similarity index is characterized by using Jaccard similarity, and the expression is as follows:
Wherein A and B are word sets of two sections of texts X and Y respectively, |A n B| represents the size of the intersection of two sets, |A n B| represents the size of the union of two sets;
the information loss index is characterized by using the difference between the information entropy and the mutual information, and the expression is as follows:
Wherein H (X) and H (Y) are information entropy of two vectors, and I (X; Y) is mutual information between the two vectors; the smaller the information difference between the two vectors, the more similar the two vectors are.
Based on cosine similarity, jaccard similarity and information loss index, the comprehensive similarity is calculated according to the following formula:
Where λC、λJ and λI are parameters that are adjusted according to the text type differences in the power regulation domain.
And S3, obtaining texts with the comprehensive similarity meeting the requirement, namely a plurality of texts with the highest comprehensive similarity, and if the texts with the high comprehensive similarity cannot be searched, returning information of the searched results.
Where vector similarity refers to a characterization of how similar two vectors are. In machine learning and data analysis, data points are often represented as vectors, which may be points in a multidimensional space, representing various features. Vector similarity is used to determine how close or similar these vectors or points are.
And text similarity refers to the degree of similarity in content, semantics, or context of two pieces of text. It is a basic concept in the field of natural language processing for measuring and comparing similarity between documents, sentences or phrases. The measurement of text similarity may be based on a variety of methods including lexical similarity, structural similarity, semantic similarity, similarity based on vector space, similarity based on language models, and the like. Text similarity plays an important role in applications such as information retrieval, document classification, text clustering, plagiarism detection, question-answering systems and the like.
Information loss is an important concept in information theory, and refers to the phenomenon that part of information is lost in the processes of data processing, compression, transmission or conversion, and can also be used for measuring the similarity of two groups of information.
The similarity measure is a function or criterion used to evaluate the degree of similarity between two objects (e.g., numbers, text, images, etc.). In the field of machine learning and data analysis, such metrics may be used to compare data points, feature vectors, or complex objects, and for various applications, including clustering, classification, recommendation systems, and information retrieval.
In one possible implementation manner, step S4 performs post-processing on the several texts with highest searched similarity by using a large language model, that is, performs prompt compression, text rearrangement, text summarization and text fusion on the texts with comprehensive similarity meeting the requirement by using the large language model, so as to generate more complete and rich answers. The prompt compression is to reduce noise in information by compressing information retrieved from a knowledge base, and the generation efficiency of a subsequent large model is improved; the text rearrangement rearranges the searched text fragments according to a certain rule or algorithm, so that the text fragments more accord with logic or semantic sequence; the text summarization is generated through a large language model, and a section of continuous characters is summarized from the extracted text information; the text fusion is to integrate information through a large language model and combine similar or supplementary information in a plurality of pieces of text information.
In a possible implementation manner, the text rearrangement according to the embodiment of the present invention rearranges the retrieved text segments using a Cohere Rerank model, where the expression is as follows:
In the formula,For the sequence of vectors prior to the rearrangement,Is the rearranged vector sequence; n represents the number of vectors, reranker represents a Cohere Rerank model, S represents a standard adopted by rearrangement, and θ represents a parameter of a Cohere Rerank model; s and theta are adjusted according to different texts in the electric power regulation and control field.
In a possible implementation manner, the intelligent power regulation question-answering method based on the large language model further comprises the step of storing the text of the question-answer into a memory component for calling, and the large language model generates corresponding answers according to the text information after text rearrangement, text summarization and text fusion by combining preset prompt words and calling of the memory component.
Thereafter, the text of the question and answer is saved in the memory component for later recall.
And finally, outputting the generated answer through a user interface to complete interaction with a user.
A Prompt term (Prompt) in the context of a large language model refers to a word or a group of words or sentences used to guide or excite the model to generate a particular type of response. In the field of machine learning, and in particular when using pre-trained language models for tasks, a prompt word is used as part of the input to assist the model in understanding the desired task or output format.
Memory components refer to modules or subsystems for storing, maintaining, and retrieving information. In large models, the introduction of a memory component enables the model to remember and utilize contextual input and learned information.
The intelligent power regulation question-answering method based on the large language model solves the defects of the automatic question-answering technology in the existing power regulation field, and is mainly characterized in the following aspects:
(1) The accuracy of question and answer is improved: by constructing a vector knowledge base of the text in the electric power regulation field, the system can understand and process more complex and professional electric power regulation problems, so that the question-answering accuracy is improved.
(2) High degree of intelligent response: by combining a large language model, the system not only can provide accurate answers, but also can interact in a more natural language, and the question-answer experience of the user is improved.
(3) Memory question-answer context: by introducing a memory component, the system is enabled to memorize and read the context of the questions and answers, providing support for a coherent dialog.
(4) Improving generalization of questions and answers: through optimizing the search algorithm and enhancing the generation method, the generalization of the question and answer of the system is improved, so that the question and answer can respond to more diversified and more complex queries of users.
(5) Information loss is reduced: the user problem text and the electric power regulation text are subjected to vector embedding processing, and similarity calculation is performed by utilizing various measurement indexes, so that loss in the information processing process is reduced, and the integrity and accuracy of information are ensured.
The invention also provides a digital intelligent power regulation question-answering system based on a large language model, which comprises the following steps:
The text acquisition coding module is used for acquiring the text of the power regulation field, acquiring the vector codes of the text of the power regulation field by using the embedded model, and storing the vector codes into the vector knowledge base;
the problem text preprocessing module is used for receiving the user problem text and preprocessing the user problem text when the user gives a problem;
The retrieval matching module is used for inputting the preprocessed user problem text into a retrieval tool, and retrieving and matching the user problem text in a vector knowledge base through the retrieval tool to obtain a text with comprehensive similarity meeting the requirement;
And the answer generation module is used for carrying out post-processing on the texts with the comprehensive similarity meeting the requirements by adopting the large language model and generating corresponding answers.
The invention combines a large language model with a search enhancement generation method, and the main idea is that text data in the power regulation field is processed by using an embedded model to obtain vector codes and store the vector codes into a vector knowledge base; the user question text is then subjected to preprocessing such as format conversion and input into the retrieval tool. In a retrieval tool, vector embedding processing is carried out on a user problem text, and indexes such as vector similarity, text similarity, information loss and the like are utilized to inquire the most similar vector in a vector knowledge base; and combining the text corresponding to the vector and the prompt word written in advance, generating output by the large language model and returning the output to the user.
In some possible implementations, knowledge maps may be used instead of vector knowledge bases, but doing so may result in reduced performance. The large language models used in the present invention can be replaced with each other, which can result in a change in system performance. Furthermore, a fine tuning technique of a large language model may be used instead of the search enhancement generation technique, but doing so requires more computational effort and may cause a decrease in performance.
Another embodiment of the present invention also proposes an electronic device including a processor and a memory, the processor being configured to execute a computer program stored in the memory to implement the large language model-based digital intelligent power regulation question-answering method.
Another embodiment of the present invention also proposes a computer-readable storage medium storing at least one instruction that, when executed by a processor, implements the large language model-based digital intelligent power regulation question-answering method.
The computer program comprises computer program code which may be in source code form, object code form, executable file or in some intermediate form, etc. The computer readable storage medium may include: any entity or device, medium, usb disk, removable hard disk, magnetic disk, optical disk, computer memory, read-only memory, random access memory, electrical carrier wave signals, telecommunications signals, software distribution media, and the like capable of carrying the computer program code. It should be noted that the computer readable medium contains content that can be appropriately scaled according to the requirements of jurisdictions in which such content is subject to legislation and patent practice, such as in certain jurisdictions in which such content is subject to legislation and patent practice, the computer readable medium does not include electrical carrier signals and telecommunication signals. For convenience of description, the foregoing disclosure shows only those parts relevant to the embodiments of the present invention, and specific technical details are not disclosed, but reference is made to the method parts of the embodiments of the present invention. The computer readable storage medium is non-transitory and can be stored in a storage device formed by various electronic devices, and can implement the execution procedure described in the method according to the embodiment of the present invention.
It will be appreciated by those skilled in the art that embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the invention. It will be understood that each flowchart and/or block of the flowchart illustrations and/or block diagrams, and combinations of flowcharts and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
Finally, it should be noted that: the above embodiments are only for illustrating the technical aspects of the present invention and not for limiting the same, and although the present invention has been described in detail with reference to the above embodiments, it should be understood by those of ordinary skill in the art that: modifications and equivalents may be made to the specific embodiments of the invention without departing from the spirit and scope of the invention, which is intended to be covered by the claims.

Claims (10)

Translated fromChinese
1.一种基于大语言模型的数智化电力调控问答方法,其特征在于,包括:1. A digital and intelligent power control question-answering method based on a large language model, characterized by comprising:采集电力调控领域文本,使用嵌入模型获取电力调控领域文本的向量编码,并存入向量知识库;Collect texts in the field of power regulation, use the embedding model to obtain the vector encoding of the texts in the field of power regulation, and store them in the vector knowledge base;当用户提出问题时,接收用户问题文本并对用户问题文本进行预处理;When a user asks a question, the user's question text is received and pre-processed;将预处理后的用户问题文本输入检索工具,通过检索工具在向量知识库中进行检索和匹配,得到综合相似度符合要求的文本;Input the preprocessed user question text into the search tool, and use the search tool to search and match in the vector knowledge base to obtain the text with the comprehensive similarity meeting the requirements;采用大语言模型对综合相似度符合要求的文本进行后处理,并生成对应的答案。A large language model is used to post-process texts that meet the requirements for comprehensive similarity and generate corresponding answers.2.根据权利要求1所述基于大语言模型的数智化电力调控问答方法,其特征在于,所述采集电力调控领域文本的步骤包括:对采集到的电力调控领域文本进行预处理,预处理的操作包括文档解析以及将非文本格式的文档转换为纯文本格式;2. According to the digital and intelligent power control question-answering method based on a large language model in claim 1, the step of collecting texts in the field of power control comprises: preprocessing the collected texts in the field of power control, the preprocessing operation comprising document parsing and converting documents in non-text format into plain text format;以及,经过预处理后,进行分段切片,将文本内容分割为段落或句子。And, after preprocessing, segmentation and slicing are performed to divide the text content into paragraphs or sentences.3.根据权利要求2所述基于大语言模型的数智化电力调控问答方法,其特征在于,所述使用嵌入模型获取电力调控领域文本的向量编码,并存入向量知识库的步骤包括:3. According to the digital and intelligent power control question-answering method based on a large language model in claim 2, it is characterized in that the step of using the embedding model to obtain the vector encoding of the text in the field of power control and storing it in the vector knowledge base comprises:采用双向编码器BERT模型获取分段切片之后文本的向量编码,表达式如下:The bidirectional encoder BERT model is used to obtain the vector encoding of the text after segmentation and slicing. The expression is as follows:其中,代表输入的分段切片文本,s表示对应文本的向量表示,θ表示BERT模型参数;采用索引的形式,在电力调控领域文本和对应向量之间建立关系,并存入向量知识库中。in, Represents the input segmented slice text,s represents the vector representation of the corresponding text, andθ represents the BERT model parameters. In the form of indexes, a relationship is established between the text in the field of power regulation and the corresponding vector, and stored in the vector knowledge base.4.根据权利要求1所述基于大语言模型的数智化电力调控问答方法,其特征在于,在所述当用户提出问题时,接收用户问题文本并对用户问题文本进行预处理的步骤中,预处理的操作包括利用大模型和相应提示词对用户问题文本进行格式转换、去除噪声及问题重新表述;4. According to the digital intelligent power control question-answering method based on the large language model of claim 1, it is characterized in that, in the step of receiving the user's question text and preprocessing the user's question text when the user asks a question, the preprocessing operation includes using the large model and corresponding prompt words to convert the user's question text into a format, remove noise, and reformulate the question;具体的,采用正则表达式对用户问题文本进行噪声去除,清除文本中的无关字符和干扰信息;问题重新表述是指利用大模型将用户问题文本进行标准化的重述,表达式如下:Specifically, regular expressions are used to remove noise from user question texts and remove irrelevant characters and interference information in the texts. Question reformulation refers to the standardized restatement of user question texts using a large model. The expression is as follows:式中,LLM()代表大模型计算,Prompt代表提示词,Original_Question代表用户问题的原始文本,θ代表大模型的参数,Processed_Question代表重新表述后的用户问题。In the formula, LLM() represents the large model calculation, Prompt represents the prompt word, Original_Question represents the original text of the user question, θ represents the parameters of the large model, and Processed_Question represents the reformulated user question.5.根据权利要求1所述基于大语言模型的数智化电力调控问答方法,其特征在于,所述将预处理后的用户问题文本输入检索工具,通过检索工具在向量知识库中进行检索和匹配,得到综合相似度符合要求的文本包括:检索工具对用户问题文本进行向量嵌入,将用户问题文本转换为向量,再利用向量相似度、文本相似性以及信息损失指标在向量知识库中检索和匹配最相似的向量;5. According to the digital and intelligent electric power control question-answering method based on a large language model as described in claim 1, it is characterized in that the pre-processed user question text is input into the search tool, and the search tool is used to search and match in the vector knowledge base to obtain the text with comprehensive similarity meeting the requirements, which includes: the search tool embeds the user question text into a vector, converts the user question text into a vector, and then uses the vector similarity, text similarity and information loss index to search and match the most similar vector in the vector knowledge base;所述向量相似度指标使用余弦相似度来表征,表达式如下:The vector similarity index is characterized by cosine similarity, which is expressed as follows:式中,XY表示两段文本嵌入而成的向量;In the formula,X andY represent the vectors embedded in two texts;所述文本相似性指标使用Jaccard相似度来表征,表达式如下:The text similarity index is characterized by Jaccard similarity, which is expressed as follows:式中,AB分别为两段文本XY的词集,|AB|表示两个集合交集的大小,|AB|表示两个集合并集的大小;In the formula,A andB are the word sets of the two textsX andY respectively, |AB | represents the size of the intersection of the two sets, and |AB | represents the size of the union of the two sets;所述信息损失指标使用信息熵和互信息之差来表征,表达式如下:The information loss index is characterized by the difference between information entropy and mutual information, and the expression is as follows:式中,H(X)、H(Y)为两向量的信息熵,I(X;Y)为两向量间的互信息;WhereH (X ) andH (Y ) are the information entropy of two vectors, andI (X ;Y ) is the mutual information between two vectors;基于余弦相似度、Jaccard相似度和信息损失指标,按下式计算综合相似度:Based on cosine similarity, Jaccard similarity and information loss index, the comprehensive similarity is calculated as follows:式中,λCλJλI为根据电力调控领域文本类型差异而进行调整的参数。WhereλC ,λJ andλI are parameters adjusted according to the differences in text types in the field of power regulation.6.根据权利要求1所述基于大语言模型的数智化电力调控问答方法,其特征在于,所述采用大语言模型对综合相似度符合要求的文本进行后处理的步骤包括:6. According to the digital and intelligent electric power control question-answering method based on a large language model in claim 1, the step of post-processing the texts whose comprehensive similarity meets the requirements by using the large language model comprises:采用大语言模型对综合相似度符合要求的文本进行提示压缩、文本重排、文本总结和文本融合;所述提示压缩为通过压缩从知识库中检索到的信息,减少信息中的噪声;所述文本重排为重新排列检索到的文本片段,使文本片段更加符合逻辑或语义顺序;所述文本总结为通过大语言模型进行生成式总结,从抽取出的数条文本信息中总结出一段连续的文字;所述文本融合为通过大语言模型进行信息整合,将数条文本信息中的相似或补充信息进行合并。A large language model is used to perform prompt compression, text rearrangement, text summary and text fusion on texts that meet the requirements of comprehensive similarity; the prompt compression is to reduce the noise in the information by compressing the information retrieved from the knowledge base; the text rearrangement is to rearrange the retrieved text fragments to make the text fragments more consistent with the logical or semantic order; the text summarization is to perform generative summarization through a large language model to summarize a continuous text from several extracted text information; the text fusion is to integrate information through a large language model to merge similar or supplementary information in several text information.7.根据权利要求6所述基于大语言模型的数智化电力调控问答方法,其特征在于,所述文本重排采用Cohere Rerank模型重新排列检索到的文本片段,表达式如下:7. According to the digital and intelligent power control question-answering method based on a large language model in claim 6, it is characterized in that the text rearrangement adopts the Cohere Rerank model to rearrange the retrieved text fragments, and the expression is as follows:式中,为重排前的向量序列,为重排后的向量序列;N表示向量个数,Reranker表示Cohere Rerank模型,S为重排所采用的标准,θ为CohereRerank模型的参数;Sθ根据电力调控领域文本的不同进行调整。In the formula, is the vector sequence before rearrangement, is the rearranged vector sequence;N represents the number of vectors,Reranker represents the Cohere Rerank model,S is the standard adopted for rearrangement,θ is the parameter of the Cohere Rerank model;S andθ are adjusted according to different texts in the field of power regulation.8.根据权利要求6所述基于大语言模型的数智化电力调控问答方法,其特征在于,还包括将问答的文本存入记忆组件调用的步骤,利用文本重排、文本总结和文本融合后的文本信息,结合预设的提示词和对记忆组件的调用,大语言模型根据这些信息生成对应的回答。8. According to the digital electric power control question and answer method based on the large language model in claim 6, it is characterized by also including the step of storing the text of the question and answer into the memory component call, using the text information after text rearrangement, text summary and text fusion, combined with preset prompt words and the call to the memory component, the large language model generates corresponding answers based on this information.9.一种基于大语言模型的数智化电力调控问答系统,其特征在于,包括:9. A digital and intelligent power control question-answering system based on a large language model, characterized by comprising:文本采集编码模块,用于采集电力调控领域文本,使用嵌入模型获取电力调控领域文本的向量编码,并存入向量知识库;The text collection and encoding module is used to collect text in the field of power regulation, use the embedding model to obtain the vector encoding of the text in the field of power regulation, and store it in the vector knowledge base;问题文本预处理模块,用于当用户提出问题时,接收用户问题文本并对用户问题文本进行预处理;The question text preprocessing module is used to receive the user's question text and preprocess the user's question text when the user asks a question;检索匹配模块,用于将预处理后的用户问题文本输入检索工具,通过检索工具在向量知识库中进行检索和匹配,得到综合相似度符合要求的文本;The retrieval and matching module is used to input the pre-processed user question text into the retrieval tool, and use the retrieval tool to search and match in the vector knowledge base to obtain the text with comprehensive similarity that meets the requirements;答案生成模块,用于采用大语言模型对综合相似度符合要求的文本进行后处理,并生成对应的答案。The answer generation module is used to use a large language model to post-process the texts that meet the requirements of comprehensive similarity and generate corresponding answers.10.一种计算机可读存储介质,其特征在于,所述计算机可读存储介质存储有至少一个指令,所述至少一个指令被处理器执行时实现如权利要求1至8中任一项所述基于大语言模型的数智化电力调控问答方法。10. A computer-readable storage medium, characterized in that the computer-readable storage medium stores at least one instruction, and when the at least one instruction is executed by a processor, it implements the digital power control question and answer method based on a large language model as described in any one of claims 1 to 8.
CN202411469462.8A2024-10-212024-10-21Digital intelligent power regulation question-answering method and system based on large language modelActiveCN119003742B (en)

Priority Applications (1)

Application NumberPriority DateFiling DateTitle
CN202411469462.8ACN119003742B (en)2024-10-212024-10-21Digital intelligent power regulation question-answering method and system based on large language model

Applications Claiming Priority (1)

Application NumberPriority DateFiling DateTitle
CN202411469462.8ACN119003742B (en)2024-10-212024-10-21Digital intelligent power regulation question-answering method and system based on large language model

Publications (2)

Publication NumberPublication Date
CN119003742Atrue CN119003742A (en)2024-11-22
CN119003742B CN119003742B (en)2025-02-14

Family

ID=93484532

Family Applications (1)

Application NumberTitlePriority DateFiling Date
CN202411469462.8AActiveCN119003742B (en)2024-10-212024-10-21Digital intelligent power regulation question-answering method and system based on large language model

Country Status (1)

CountryLink
CN (1)CN119003742B (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN119415640A (en)*2025-01-062025-02-11北京可利邦信息技术股份有限公司 Method and device for improving the retrieval accuracy of specific industry knowledge
CN119441446A (en)*2025-01-132025-02-14湖南湘能创业项目管理有限公司 A question-answering method and system in the bidding field based on retrieval-enhanced generation architecture
CN119988573A (en)*2025-04-152025-05-13卓智网络科技有限公司 Intelligent question answering method, system, electronic device, and intelligent question answering large model

Citations (5)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
US10664527B1 (en)*2019-01-182020-05-26PolyAI LimitedResponse retrieval system and method
CN117076653A (en)*2023-10-172023-11-17安徽农业大学Knowledge base question-answering method based on thinking chain and visual lifting context learning
US11971914B1 (en)*2023-07-212024-04-30Cure A1, LLCArtificial intelligence systems and methods
CN118227734A (en)*2024-03-192024-06-21湖大粤港澳大湾区创新研究院(广州增城)Intelligent voice query method for industrial manual content
CN118467595A (en)*2024-05-102024-08-09厦门大学 Search method, device, equipment, and medium for target domain based on large language model

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
US10664527B1 (en)*2019-01-182020-05-26PolyAI LimitedResponse retrieval system and method
US11971914B1 (en)*2023-07-212024-04-30Cure A1, LLCArtificial intelligence systems and methods
CN117076653A (en)*2023-10-172023-11-17安徽农业大学Knowledge base question-answering method based on thinking chain and visual lifting context learning
CN118227734A (en)*2024-03-192024-06-21湖大粤港澳大湾区创新研究院(广州增城)Intelligent voice query method for industrial manual content
CN118467595A (en)*2024-05-102024-08-09厦门大学 Search method, device, equipment, and medium for target domain based on large language model

Cited By (3)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN119415640A (en)*2025-01-062025-02-11北京可利邦信息技术股份有限公司 Method and device for improving the retrieval accuracy of specific industry knowledge
CN119441446A (en)*2025-01-132025-02-14湖南湘能创业项目管理有限公司 A question-answering method and system in the bidding field based on retrieval-enhanced generation architecture
CN119988573A (en)*2025-04-152025-05-13卓智网络科技有限公司 Intelligent question answering method, system, electronic device, and intelligent question answering large model

Also Published As

Publication numberPublication date
CN119003742B (en)2025-02-14

Similar Documents

PublicationPublication DateTitle
CN118093834B (en)AIGC large model-based language processing question-answering system and method
CN119003742B (en)Digital intelligent power regulation question-answering method and system based on large language model
CN114282592B (en) A method and device for industry text matching model based on deep learning
CN110390049B (en)Automatic answer generation method for software development questions
CN117951249A (en)Knowledge base response method and system based on large language model
CN111897930A (en) An automatic question answering method and system, intelligent device and storage medium
CN118377888B (en)Question-answering processing method, system, equipment and medium based on large language model
CN114238595A (en) A method and system for question answering of metallurgical knowledge based on knowledge graph
CN118377844A (en)Text generation enhancement method and device applied to search enhancement generation
CN119988588A (en) A large model-based multimodal document retrieval enhancement generation method
CN119227721A (en) A knowledge-enhanced learning method and system based on multi-agent
CN119669530B (en) Knowledge graph generation-assisted teaching question answering method and system based on LLM
CN114153946A (en)Intelligent retrieval method, device, equipment and storage medium
CN113886520A (en)Code retrieval method and system based on graph neural network and computer readable storage medium
CN119202151A (en) Question and answer processing method, device, electronic device and storage medium
CN120045750A (en)Retrieval enhancement generation method and system based on large language model
CN118350368B (en)Multi-document select and edit method of large language model based on NLP technology
CN119829700A (en)Language processing model training method and device and problem processing method and device
CN119577064A (en) An open domain question answering method and system based on knowledge retrieval generation
CN119088929A (en) A well engineering intelligent question-answering system and method
CN119069138A (en) A method for generating diversified instruction data in the medical field based on a large language model
CN117973533A (en)Help information acquisition method and device, electronic equipment and storage medium
CN109684357B (en) Information processing method and device, storage medium, and terminal
CN111881695A (en)Audit knowledge retrieval method and device
CN117216226A (en)Knowledge positioning method, device, storage medium and equipment

Legal Events

DateCodeTitleDescription
PB01Publication
PB01Publication
SE01Entry into force of request for substantive examination
SE01Entry into force of request for substantive examination
GR01Patent grant
GR01Patent grant

[8]ページ先頭

©2009-2025 Movatter.jp