Electric power large language model enhancement method and system based on thinking chain
By adopting a large-language power language model enhancement method based on thinking chain in the power system, the problem of the power system lacking analytical ability when processing user keywords is solved, and the rapid identification and answering of user problems is achieved, and the retrieval ability and answering efficiency are improved.
Patent Information
- Application Number
- CN202411822656.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-11
- Publication Date
- 2025-04-11
AI Technical Summary
The existing power system lacks analytical capabilities when processing user keywords and cannot quickly identify synonyms and user intentions of keywords, resulting in weak retrieval capabilities and difficult to meet the needs of staff.
The power large language model enhancement method based on thinking chain is adopted, and the search ability is enhanced by collecting and preprocessing massive power Q&A text data, extracting keyword characteristics, establishing keyword Q&A index, and measuring the similarity of user questions through intention coverage similarity, enhancing the search ability.
By refining indexes and enhancing search capabilities, we can quickly identify questions raised by users and their synonyms, improve the accuracy and efficiency of answers, and meet the needs of staff.
Smart Images

Figure CN119807353A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of electric power big language technology, and in particular to a method and system for enhancing an electric power big language model based on a thought chain. Background Art
[0002] In recent years, many researchers at home and abroad have proposed many information retrieval methods based on different theories, which have improved the ability of information retrieval to a certain extent, but there are still some limitations.
[0003] The Chinese invention patent application with application publication number CN 113987146 A discloses a new intelligent question-answering system dedicated to the power intranet, including an intelligent question-answering module, including an input module and an output module; the input module is used for users to input search content; the semantic understanding module is used to semantically understand the search content; the file crawling and retrieval module is used to crawl the file data source and establish a file index; the database crawling and retrieval module is used to crawl the business database; the application module database is used to output the application module data according to the understanding of the search content by the semantic understanding module, and the application module data at least includes the address link of the application module; the output module is used to output the file index and / or business information and / or application module data. The system can meet the needs of refined retrieval and improve the efficiency of power users in obtaining the required answers.
[0004] However, in the power system, accuracy and diversity are both very important. The existing power system lacks analysis of user keywords. For example, one keyword corresponds to multiple synonyms. The problems formed by different users using keywords or synonyms are essentially the same, but the existing power system cannot analyze them quickly, and the retrieval ability is weak, which makes it difficult to meet the needs of staff. Summary of the invention
[0005] In order to solve the above technical problems, a method and system for enhancing the power large language model based on thinking chain are provided. This technical solution solves the problem that the existing power system mentioned in the above background technology lacks analysis of user keywords. For example, one keyword corresponds to multiple synonyms, and the problems formed by different users using keywords or synonyms are essentially the same, but the existing power system cannot quickly analyze them and has weak retrieval capabilities.
[0006] In order to achieve the above purpose, the technical solution adopted by the present invention is:
[0007] A method for enhancing a large power language model based on a thought chain, comprising:
[0008] Collecting a large amount of electric power question and answer text data, wherein the electric power question and answer text data includes question data and answer data raised by users;
[0009] Preprocessing the massive amount of power question and answer text data, wherein the preprocessing is to convert the document in the image format into text and remove outliers from all the texts;
[0010] Perform keyword feature extraction on all preprocessed data, obtain keyword feature data of massive historical power Q&A texts, and establish a keyword Q&A index;
[0011] The similarity of questions raised by users is measured by the similarity of intent coverage between keyword data;
[0012] Input the user's real-time question data into the answer prediction model to obtain the answer result.
[0013] Preferably, the step of converting a document in picture format into text specifically comprises the following steps:
[0014] The grid evenly divides the data in picture format;
[0015] Create a matrix [a ij ] nn , that is, the element a in the i-th row and j-th column of the matrix ij The corresponding grid point is in row i and column j in the grid;
[0016] The grid point position of the grid corresponds to the position of the point in the image, and the grayscale value of the image point corresponding to the grid point of the grid is assigned to the corresponding element a in the grid point matrix ij ;
[0017] A digital matrix corresponding to the image format data is obtained, wherein each digital position in the digital matrix corresponds one-to-one to each word position in the text.
[0018] Preferably, the outlier removal specifically comprises the following steps:
[0019] Retrieving a pre-set outlier matching model from a database;
[0020] Input each data into the outlier matching model to obtain the outlier value of each data;
[0021] Compare the obtained abnormal value with a first threshold value preset in the system;
[0022] If the abnormal value is greater than or equal to the first threshold, the data is determined to be abnormal data and deleted;
[0023] If the abnormal value is smaller than the first threshold, the data is determined to be normal data and no deletion operation is performed.
[0024] Preferably, the outlier matching model is:
[0025]
[0026] In the formula, C is the degree of fit between the characteristic parameters of the input data and the characteristic parameters of the abnormal data set pre-set in the system, α i is the weight value of the i-th feature parameter, and m is the total number of feature parameters.
[0027] Preferably, the step of establishing a keyword question-answer index specifically includes the following steps:
[0028] Preprocess the text, including removing noise, punctuation, and stop words;
[0029] Parse the text content in the text file and extract the text in the file;
[0030] Use natural language processing to process text, segment the text content of the document into chapters, clauses, and paragraphs, perform entity recognition on the text content, and identify the entities involved in the document;
[0031] Extract keywords from the document to find out the core words and themes in the document;
[0032] According to the parsed and processed text content, the data in the file database is indexed.
[0033] Preferably, the method of measuring the similarity of questions raised by users by measuring the similarity of intention coverage between keyword data specifically comprises the following steps:
[0034] Extract keywords from questions raised by a large number of users and label them with numbers;
[0035] Perform intelligent analysis on the keywords corresponding to each digital label in the database to obtain all synonyms corresponding to each keyword;
[0036] Based on the obtained synonyms, obtain all user question data containing keywords and corresponding synonyms;
[0037] Based on the keyword user question data and all the corresponding synonym user question data, obtain the corresponding answer data;
[0038] Use the similarity model to determine the similarity of the answer data;
[0039] Comparing the similarity value with a preset second threshold;
[0040] If the similarity value is greater than or equal to the second threshold, it is determined that the answer data have obvious similarity, and it is determined that the user questions corresponding to the synonyms and keywords have obvious similarity;
[0041] If the similarity value is less than the second threshold, it is determined that the user questions corresponding to the synonym and the keyword are not similar.
[0042] Preferably, the similarity model is:
[0043]
[0044] In the formula, S i To answer the similarity between data, w ij is the jth parameter index value of the i-th feature keyword in the input solution data, v ij is the jth parameter index value of the ith feature keyword of all answer data, and n is the total number of parameter index values of the ith feature keyword.
[0045] Preferably, the solution prediction model is:
[0046]
[0047] Among them, P j is the matching degree between the input user question data and the jth answer data, N j is the total number of historical user question feature data corresponding to the jth answer data, N0 is the total number of features of the input user question data, N 同 is the total number of identical features between the feature data of the input user question data and the historical question data corresponding to the jth answer data, α' l is the correlation weight between the feature data of the j-th solution data and the first input user question data and the same feature in the historical user question data corresponding to the j-th solution data, and max() is the maximum value function.
[0048] In addition, the present invention also provides a power large language model enhancement system based on thought chain, comprising:
[0049] A collection module, the collection module is used to collect massive electric power question and answer text data, the electric power question and answer text data includes question data and answer data raised by users;
[0050] A preprocessing module, wherein the preprocessing module internally integrates a first processing unit and a second processing unit, wherein the first processing unit is used to convert a document in a picture format into text, and the second processing unit is used to remove outliers from all texts;
[0051] An index building module, which is used to extract keyword features from all preprocessed data, obtain keyword feature data of massive historical power question and answer texts, and build a keyword question and answer index;
[0052] A judgment module, the judgment module is used to measure the similarity of questions raised by users by measuring the similarity of intention coverage between keyword data;
[0053] The real-time answer module is used to input the user's real-time question data into the answer prediction model to obtain the answer result.
[0054] Compared with the prior art, the present invention provides a method and system for enhancing a large power language model based on a thought chain, which has the following beneficial effects:
[0055] The present invention collects question data and answer data raised by users. In real life, answer data is not necessarily limited to text type, but also includes unstructured data of picture type. It is converted into structured data of text type and outliers are removed to make the text data more accurate, which is convenient for subsequent analysis and research of the data. The present invention is based on the thinking chain technology, which simulates the thinking process of humans when solving problems. For the question data raised by users, the keywords of the questions are analyzed, and a question-answer index is comprehensively established for the questions and answers corresponding to each keyword. Each step in the thinking chain is logically related to ensure the coherence and accuracy of the reasoning. In fact, keywords will also have corresponding synonyms, so that the questions raised by users are essentially the same type of questions. For example, "Has the electricity price increased?" and "Has the electricity price increased recently?" have extremely high similarity. In this way, the index is refined and the retrieval capability is enhanced. BRIEF DESCRIPTION OF THE DRAWINGS
[0056] Figure 1 It is a schematic diagram of the method for enhancing the large language model of electric power in the present invention;
[0057] Figure 2 A schematic diagram of a method for converting a document in a picture format into text in the present invention;
[0058] Figure 3 It is a schematic diagram of the method for removing outliers in the present invention;
[0059] Figure 4 Schematic diagram of the method for establishing a keyword question and answer index in the present invention. DETAILED DESCRIPTION
[0060] The following description is used to disclose the present invention so that those skilled in the art can implement the present invention. The preferred embodiments described below are only examples, and those skilled in the art may think of other obvious variations.
[0061] Example 1
[0062] Please refer to Figure 1-Figure 4 As shown, a method for enhancing a large power language model based on a thought chain includes:
[0063] Collect massive amounts of power question and answer text data, which includes questions raised by users and their answers;
[0064] Preprocess the massive amount of power question-and-answer text data by converting image-formatted documents into text and removing outliers from all texts;
[0065] Perform keyword feature extraction on all preprocessed data, obtain keyword feature data of massive historical power Q&A texts, and establish a keyword Q&A index;
[0066] The similarity of questions raised by users is measured by the similarity of intent coverage between keyword data;
[0067] Input the user's real-time question data into the answer prediction model to obtain the answer result.
[0068] It can be understood by those skilled in the art that the present invention collects question data and answer data raised by users. In real life, answer data is not necessarily text-based, but also includes unstructured data of picture type. The data is converted into structured data of text type, and outliers are removed to make the text data more accurate, which is convenient for subsequent analysis and research of the data. The present invention is based on the thinking chain technology, which simulates the thinking process of humans when solving problems. For the question data raised by users, the keywords of the questions are analyzed, and a question-answer index is established for the questions and answers corresponding to each keyword. Each step in the thinking chain is logically related to ensure the consistency and accuracy of the reasoning. In fact, keywords will also have corresponding synonyms, so that the questions raised by users are essentially the same type of questions. For example, "Has the electricity price increased?" and "Has the electricity price increased recently?" have extremely high similarity. In this way, the index is refined and the retrieval ability is enhanced. Therefore, the system in the present invention is used to directly grasp the keywords of the user's questions and output the answer data without the participation of staff in answering. It is convenient and fast, and meets the needs of the staff.
[0069] Converting a document in image format to text includes the following steps:
[0070] The grid evenly divides the data in picture format;
[0071] Create a matrix [a ij ] nn , that is, the element a in the i-th row and j-th column of the matrix ij The corresponding grid point is in row i and column j in the grid;
[0072] The grid point position of the grid corresponds to the position of the point in the image, and the grayscale value of the image point corresponding to the grid point of the grid is assigned to the corresponding element a in the grid point matrix ij ;
[0073] A digital matrix corresponding to the image format data is obtained, and each digital position in the digital matrix corresponds one-to-one to each word position in the text.
[0074] The specific steps of outlier removal are as follows:
[0075] Retrieving a pre-set outlier matching model from a database;
[0076] Input each data into the outlier matching model to obtain the outlier value of each data;
[0077] Compare the obtained abnormal value with a first threshold value preset in the system;
[0078] If the abnormal value is greater than or equal to the first threshold, the data is determined to be abnormal data and deleted;
[0079] If the abnormal value is smaller than the first threshold, the data is determined to be normal data and no deletion operation is performed.
[0080] The outlier matching model is:
[0081]
[0082] In the formula, C is the degree of fit between the characteristic parameters of the input data and the characteristic parameters of the abnormal data set pre-set in the system, α i is the weight value of the i-th feature parameter, and m is the total number of feature parameters.
[0083] The specific steps of establishing a keyword question and answer index are as follows:
[0084] Preprocess the text, including removing noise, punctuation, and stop words;
[0085] Parse the text content in the text file and extract the text in the file;
[0086] Use natural language processing to process text, segment the text content of the document into chapters, clauses, and paragraphs, perform entity recognition on the text content, and identify the entities involved in the document;
[0087] Extract keywords from the document to find out the core words and themes in the document;
[0088] According to the parsed and processed text content, the data in the file database is indexed.
[0089] Measuring the similarity of user questions by the similarity of intent coverage between keyword data specifically includes the following steps:
[0090] Extract keywords from questions raised by a large number of users and label them with numbers;
[0091] Perform intelligent analysis on the keywords corresponding to each digital label in the database to obtain all synonyms corresponding to each keyword;
[0092] Based on the obtained synonyms, obtain all user question data containing keywords and corresponding synonyms;
[0093] Based on the keyword user question data and all the corresponding synonym user question data, obtain the corresponding answer data;
[0094] Use the similarity model to determine the similarity of the answer data;
[0095] Comparing the similarity value with a preset second threshold;
[0096] If the similarity value is greater than or equal to the second threshold, it is determined that the answer data have obvious similarity, and it is determined that the user questions corresponding to the synonyms and keywords have obvious similarity;
[0097] If the similarity value is less than the second threshold, it is determined that the user questions corresponding to the synonym and the keyword are not similar.
[0098] The similarity model is:
[0099]
[0100] In the formula, S i To answer the similarity between data, w ij is the jth parameter index value of the i-th feature keyword in the input solution data, v ij is the jth parameter index value of the ith feature keyword of all answer data, and n is the total number of parameter index values of the ith feature keyword.
[0101] The solution prediction model is:
[0102]
[0103] Among them, P j is the matching degree between the input user question data and the jth answer data, N j is the total number of historical user question feature data corresponding to the jth answer data, N0 is the total number of features of the input user question data, N 同is the total number of identical features between the feature data of the input user question data and the historical question data corresponding to the j-th answer data, α'1 is the correlation weight between the feature data of the j-th answer data and the identical features in the historical user question data corresponding to the j-th answer data, and max() is the maximum value function.
[0104] In addition, the present invention also provides a power large language model enhancement system based on thought chain, comprising:
[0105] A collection module is used to collect massive electric power question and answer text data, which includes question data and answer data raised by users;
[0106] A preprocessing module, wherein the preprocessing module internally integrates a first processing unit and a second processing unit, wherein the first processing unit is used to convert a document in a picture format into text, and the second processing unit is used to remove outliers from all texts;
[0107] An index building module, which is used to extract keyword features from all preprocessed data, obtain keyword feature data of massive historical power question and answer texts, and build a keyword question and answer index;
[0108] A judgment module, the judgment module is used to measure the similarity of questions raised by users by measuring the similarity of intention coverage between keyword data;
[0109] The real-time answer module is used to input the user's real-time question data into the answer prediction model to obtain the answer result.
[0110] In summary, the present invention collects question data and answer data raised by users. In real life, answer data is not necessarily limited to text type, but also includes unstructured data of picture type. It is converted into structured data of text type, and outliers are removed to make the text data more accurate, which is convenient for subsequent analysis and research of the data. The present invention is based on the thinking chain technology to simulate the thinking process of humans when solving problems. For the question data raised by users, the keywords of the questions are analyzed, and a question-answer index is established for the questions and answers corresponding to each keyword. Each step in the thinking chain is logically related to ensure the consistency and accuracy of the reasoning. In fact, keywords will also have corresponding synonyms, so that the questions raised by users are essentially the same type of questions. For example, "Has the electricity price increased?" and "Has the electricity price increased recently?" have extremely high similarity. In this way, the index is refined and the retrieval ability is enhanced. Therefore, the system in the present invention is used to directly grasp the user's question keywords and output the answer data. There is no need for staff to participate in the answering, which is convenient and fast and meets the needs of the staff.
[0111] The above shows and describes the basic principles, main features and advantages of the present invention. Those skilled in the art should understand that the present invention is not limited to the above embodiments. The above embodiments and descriptions only describe the principles of the present invention. The present invention may be subject to various changes and improvements without departing from the spirit and scope of the present invention. These changes and improvements fall within the scope of the present invention. The scope of protection claimed by the present invention is defined by the attached claims and their equivalents.
Claims
1. A method for enhancing a large power language model based on a thought chain, characterized in that: include: Collecting a large amount of electric power question and answer text data, wherein the electric power question and answer text data includes question data and answer data raised by users; Preprocessing the massive amount of power question and answer text data, wherein the preprocessing is to convert the document in the image format into text and remove outliers from all the texts; Perform keyword feature extraction on all preprocessed data, obtain keyword feature data of massive historical power Q&A texts, and establish a keyword Q&A index; The similarity of questions raised by users is measured by the similarity of intent coverage between keyword data; Input the user's real-time question data into the answer prediction model to obtain the answer result.
2. According to the method of enhancing the power language model based on thought chain in claim 1, it is characterized in that: The step of converting a document in a picture format into text specifically includes the following steps: The grid evenly divides the data in picture format; Create a matrix [a ij ] nn , that is, the element a in the i-th row and j-th column of the matrix ij The corresponding grid point is in the i-th row and j-th column of the grid; The grid point position of the grid corresponds to the position of the point in the image, and the grayscale value of the image point corresponding to the grid point of the grid is assigned to the corresponding element a in the grid point matrix ij ; A digital matrix corresponding to the image format data is obtained, wherein each digital position in the digital matrix corresponds one-to-one to each word position in the text.
3. The method for enhancing the power language model based on thought chain according to claim 2 is characterized in that: The outlier removal specifically includes the following steps: Retrieving a pre-set outlier matching model from a database; Input each data into the outlier matching model to obtain the outlier value of each data; Compare the obtained abnormal value with a first threshold value preset in the system; If the abnormal value is greater than or equal to the first threshold, the data is determined to be abnormal data and deleted; If the abnormal value is smaller than the first threshold, the data is determined to be normal data and no deletion operation is performed.
4. The method for enhancing the power language model based on thought chain according to claim 3 is characterized in that: The outlier matching model is: In the formula, C is the degree of fit between the characteristic parameters of the input data and the characteristic parameters of the abnormal data set pre-set in the system, α i is the weight value of the i-th feature parameter, and m is the total number of feature parameters.
5. The method for enhancing the power language model based on thought chain according to claim 4 is characterized in that: The establishment of a keyword question-answer index specifically includes the following steps: Preprocess the text, including removing noise, punctuation, and stop words; Parse the text content in the text file and extract the text in the file; Use natural language processing to process text, segment the text content of the document into chapters, clauses, and paragraphs, perform entity recognition on the text content, and identify the entities involved in the document; Extract keywords from the document to find out the core words and themes in the document; According to the parsed and processed text content, the data in the file database is indexed.
6. The method for enhancing the power language model based on thought chain according to claim 5 is characterized in that: The method of measuring the similarity of questions raised by users by the similarity of intention coverage between keyword data specifically includes the following steps: Extract keywords from questions raised by a large number of users and label them with numbers; Perform intelligent analysis on the keywords corresponding to each digital label in the database to obtain all synonyms corresponding to each keyword; Based on the obtained synonyms, obtain all user question data containing keywords and corresponding synonyms; Based on the keyword user question data and all the corresponding synonym user question data, obtain the corresponding answer data; Use the similarity model to determine the similarity of the answer data; Comparing the similarity value with a preset second threshold; If the similarity value is greater than or equal to the second threshold, it is determined that the answer data have obvious similarity, and it is determined that the user questions corresponding to the synonyms and keywords have obvious similarity; If the similarity value is less than the second threshold, it is determined that the user questions corresponding to the synonym and the keyword are not similar.
7. The method for enhancing the power language model based on thought chain according to claim 6 is characterized in that: The similarity model is: In the formula, S i To answer the similarity between data, w ij is the jth parameter index value of the i-th feature keyword in the input solution data, v ij is the jth parameter index value of the ith feature keyword of all answer data, and n is the total number of parameter index values of the ith feature keyword.
8. The method for enhancing the power language model based on thought chain according to claim 7 is characterized in that: The solution prediction model is: Among them, P j is the matching degree between the input user question data and the jth answer data, n j is the total number of historical user question feature data corresponding to the j-th answer data, n0 is the total number of features of the input user question data, N 同 is the total number of identical features between the feature data of the input user question data and the historical question data corresponding to the j-th answer data, α l is the correlation weight between the feature data of the j-th solution data and the l-th input user question data and the same feature in the historical user question data corresponding to the j-th solution data, and max() is the maximum value function.
9. A system for enhancing a large electric power language model based on a thought chain, used to implement a method for enhancing a large electric power language model based on a thought chain as described in any one of claims 1 to 8, characterized in that: include: A collection module, the collection module is used to collect massive electric power question and answer text data, the electric power question and answer text data includes question data and answer data raised by users; A preprocessing module, wherein the preprocessing module internally integrates a first processing unit and a second processing unit, wherein the first processing unit is used to convert a document in a picture format into text, and the second processing unit is used to remove outliers from all texts; An index building module is used to extract keyword features from all preprocessed data, obtain keyword feature data of massive historical power question and answer texts, and build a keyword question and answer index.
10. The power large language model enhancement system based on thought chain according to claim 1 is characterized in that: include: A judgment module, the judgment module is used to measure the similarity of questions raised by users by measuring the similarity of intention coverage between keyword data; The real-time answer module is used to input the user's real-time question data into the answer prediction model to obtain the answer result.
Citation Information
Patent Citations
Novel intelligent question-answering system special for electric power intranet
CN113987146A