Report structured generation method and system based on cross-document key information association query
By constructing a key information map and multi-hop reasoning mechanism in the field of power grid planning, and combining the BERT-BiLSTM-CRF model and the information source confidence evaluation model, the problems of cross-document information silos and repetitive work in power grid planning reports are solved, and efficient and accurate report generation is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- EAST CHINA BRANCH OF STATE GRID CORP
- Filing Date
- 2025-12-24
- Publication Date
- 2026-05-19
AI Technical Summary
Existing technologies for generating power grid planning reports suffer from problems such as cross-document information silos, lack of domain logic constraints, high repetitive labor intensity, and difficulty in tracing key information, resulting in low accuracy and efficiency of the generated reports.
By constructing a key information map in the field of power grid planning, a multi-hop reasoning mechanism is used to find logical connections between different documents. Based on a predefined power grid planning report structure, slot filling and text generation are performed. The BERT-BiLSTM-CRF model is used for entity recognition and a hybrid distance metric is used for entity alignment. An information source confidence evaluation model is introduced to screen conflict-free key information.
It improves the efficiency, accuracy, and standardization of writing professional reports in the field of power grid planning, ensures data accuracy and provides in-depth analytical value, and achieves seamless association and conflict resolution of cross-document information.
Smart Images

Figure CN122065778A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the fields of natural language processing and intelligent document processing technology, and in particular to a method and system for generating structured reports based on cross-document key information association queries. Background Technology
[0002] With the continuous expansion of the power grid and the improvement of its intelligence level, power grid planning work faces challenges such as large data volume, diverse data types, and complex data relationships. The preparation of power grid planning reports is an extremely complex task, typically involving massive amounts of heterogeneous source data. Planners need to refer to various documents, including policy documents from higher authorities, historical planning reports, load forecast data (Excel spreadsheets), equipment parameter manuals (PDFs), and geographic information data.
[0003] Existing technologies for automatically generating reports mainly have the following problems: Cross-document information silos: Existing generative models are often based on single-document reading comprehension, making it difficult to establish a logical connection between "substation planning and site selection in document A" and "load growth forecast for the region in document B".
[0004] Lack of domain-specific logical constraints: Reports generated by general large language models (LLM) are prone to "illusions". Power grid planning reports are professional domain reports that emphasize accuracy. "Illusions" can lead to serious professional errors, such as incorrect voltage level matching and conflicting power supply ranges.
[0005] High repetitive workload: Power grid planning reports contain numerous generic and semi-generic modules in terms of structure and content. Personnel need to spend a significant amount of time on repetitive copying, pasting, and formatting adjustments, resulting in low innovative value.
[0006] Key information traceability is difficult: the generated reports lack precise anchoring of data sources, making it difficult to meet the stringent requirements for data accuracy in power grid planning reviews.
[0007] Therefore, there is an urgent need for an invention that can understand the logic of the power grid field and perform key information association and structured generation among multi-source heterogeneous documents, so as to improve the writing efficiency, accuracy and standardization of professional reports in the field of power planning. Summary of the Invention
[0008] In view of the above problems, this application is proposed to provide a method and system for generating structured reports based on cross-document key information association queries, as well as related products, to overcome or at least partially solve the above problems. The technical solution is as follows: Firstly, a method for generating structured reports based on cross-document key information association queries is provided, the method comprising: Collect multi-source documents related to power grid planning and construct a document set; preprocess each document in the document set to obtain preprocessed documents; Based on the preprocessed documents, a cross-document key information association graph is constructed to obtain a heterogeneous graph. In the heterogeneous graph, the nodes represent key entities in the power grid field, and the edges represent semantic or logical relationships between key entities. The structure of the power grid planning report is defined as a tree structure, where each leaf node represents a report paragraph that needs to be filled. For each leaf node, a query vector is generated, and based on the query vector and the heterogeneous graph, preliminary documents and related documents are determined; The system performs queries and searches in the initial and related documents to obtain search results, and then filters out conflict-free key information from the search results. The selected conflict-free key information, prompts, and extracted structured data tables are input into a pre-trained generative language model to output a structured report on power grid planning.
[0009] In one possible implementation, key entities in the power grid domain are identified through the following steps: The document is parsed and preprocessed into blocks to obtain text blocks; Set the text sequence of the text block as follows: The entity label sequence is ; Text sequence Input a BERT model pre-tuned for the power grid domain to obtain a dynamic word vector matrix at the character level. ; Dynamic word vector matrix at the character level Input a bidirectional long short-term memory network to capture forward and backward contextual features of text sequences; To ensure the validity of the entity label sequence, a Conditional Random Field (CRF) layer is introduced. The objective function of the CRF layer is defined as maximizing the text sequence. Entity label sequence conditional probability :
[0010] in, For text sequences and entity label sequence The scoring function between them is calculated as follows:
[0011] in, The set of all possible entity label sequences; The transition score matrix represents the transition from label Transfer to label The score; Let f be the emission fraction matrix, representing the output of the bidirectional long short-term memory network. One character was predicted as the label. The nonnormalized probability; By decoding the highest-scoring entity label sequence using the Viterbi algorithm, key entities in the power grid field can be identified.
[0012] In one possible implementation, the method further includes: Suppose two entity references to be aligned. and ; calculate and Alignment score as follows:
[0013] In the formula , , The sub-item weights are adjusted according to requirements. The formula calculation consists of three similarity components and one hard constraint factor. Set hard constraint factors The calculation is as follows:
[0014] in, for voltage level, for Voltage level; It is a null value; The similarity of surface names, i.e., literal similarity, is calculated using edit distance. :
[0015] in, To obtain The string, To obtain The string, To make the string Convert to string Minimum number of single-character editing operations required; For strings Length, For strings Length; Computational Entity and Context vectors in their respective documents , Cosine similarity between them, i.e., semantic context similarity :
[0016] Comparison Entities and Extracted attribute set , Calculate the Jaccard similarity coefficient, i.e., the degree of attribute overlap. :
[0017] Set alignment threshold ,like Then determine and For the same entity, merge corresponding nodes and integrate attribute information in the heterogeneous graph.
[0018] In one possible implementation, preliminary documents and related documents are determined based on the query vector and the heterogeneous graph, including: Based on the query vector and heterogeneous graph, preliminary documents and documents to be associated are determined; Based on the search relevance scoring function Select the relevant document from the list of pending related documents:
[0019] in, Text blocks for documents to be associated with. Relative to query vector The final relevance score; Text block vector With query vector Dense search score; query vector The core entity nodes parsed from the data; For text blocks The entity nodes included; For text blocks Corresponding heterogeneous graph subgraphs; The shortest path length between two nodes in the heterogeneous graph; , Hyperparameters used to adjust the importance of dense retrieval and heterogeneous graph inference.
[0020] In one possible implementation, an information source confidence evaluation model is introduced to filter out conflict-free key information from the search results. The information source confidence evaluation model is as follows:
[0021] in, These are the key data values to be ultimately selected; This is the context vector of the document containing the conflicting data; The source document of the document containing the conflicting data. The preset authority level; The current time when the report was generated; The publication date of the source document; This is the time decay factor.
[0022] Secondly, a report structure generation system based on cross-document key information association query is provided, the system comprising: The multi-source heterogeneous document preprocessing module is used to collect multi-source documents related to power grid planning, construct a document set, and preprocess each document in the document set to obtain the preprocessed document. The cross-document key information association graph construction module is used to construct a cross-document key information association graph based on preprocessed documents, and obtain a constructed heterogeneous graph. In the heterogeneous graph, the nodes represent key entities in the power grid field, and the edges of the heterogeneous graph represent semantic or logical relationships between key entities. The context-aware relational query module defines the structure of the power grid planning report as a tree structure, where each leaf node represents a report paragraph that needs to be filled. For each leaf node, a query vector is generated, and based on the query vector and the heterogeneous graph, preliminary documents and related documents are determined. Querying and retrieving are performed in the preliminary documents and related documents to obtain the retrieval results, and conflict-free key information is filtered out from the retrieval results. The structured report generation module is used to input the selected conflict-free key information, prompts, and extracted structured data tables into a pre-trained generative language model and output a structured report on power grid planning.
[0023] Thirdly, an electronic device is provided, comprising a processor and a memory, wherein the memory stores a computer program, and the processor is configured to run the computer program to perform the report structure generation method based on cross-document key information association query as described in any of the preceding claims.
[0024] Fourthly, a storage medium is provided that stores a computer program, wherein the computer program is configured to execute the report structure generation method based on cross-document key information association query as described above at runtime.
[0025] Fifthly, a computer program product is provided, including a computer program configured to execute, at runtime, the report structure generation method based on cross-document key information association query as described above.
[0026] By utilizing the above technical solutions, the report structure generation method and system based on cross-document key information association query provided in this application, as well as related products, improve the efficiency, accuracy and standardization of writing professional reports in the field of power grid planning by constructing a key information map in the field of power grid planning, using a multi-hop reasoning mechanism to find logical associations between different documents, and performing slot filling and text generation based on a predefined structure of power grid planning reports. Attached Figure Description
[0027] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the description of the embodiments of this application will be briefly introduced below.
[0028] Figure 1 The flowchart illustrates a report structure generation method based on cross-document key information association query provided in an embodiment of this application. Figure 2 This paper shows an overall architecture block diagram of the report structure generation system based on cross-document key information association query provided in an embodiment of this application; Figure 3 This paper illustrates the main flowchart of the report structure generation method provided in an embodiment of this application; Figure 4 A detailed flowchart of the construction of a cross-document key information association graph provided in an embodiment of this application is shown; Figure 5 This paper shows a structural diagram of a report structure generation system based on cross-document key information association query provided in an embodiment of this application; Figure 6 A structural diagram of an electronic device provided in an embodiment of this application is shown. Detailed Implementation
[0029] Exemplary embodiments of the present application will now be described in more detail with reference to the accompanying drawings. While exemplary embodiments of the present application are shown in the drawings, it should be understood that the present application may be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this application will be thorough and complete, and will fully convey the scope of the present application to those skilled in the art.
[0030] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such use can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the term "comprising" and its variations should be interpreted as open-ended terms meaning "including but not limited to."
[0031] To address the aforementioned technical problems, embodiments of this application provide a method for generating structured reports based on cross-document key information association queries, such as... Figure 1 As shown, the report structure generation method based on cross-document key information association query may include the following steps S101 to S106: Step S101: Collect multi-source documents related to power grid planning and construct a document set; preprocess each document in the document set to obtain preprocessed documents; Step S102: Based on the preprocessed documents, construct a cross-document key information association graph to obtain a constructed heterogeneous graph, where the nodes of the heterogeneous graph represent key entities in the power grid field, and the edges of the heterogeneous graph represent semantic or logical relationships between key entities. Step S103: Define the structure of the power grid planning report as a tree structure, where each leaf node in the tree structure represents a report paragraph that needs to be filled. Step S104: For each leaf node, generate a query vector, and determine the preliminary document and related documents based on the query vector and the heterogeneous graph; Step S105: Perform a query and retrieval in the preliminary document and related documents to obtain the retrieval results, and filter out conflict-free key information from the retrieval results; Step S106: Input the selected conflict-free key information, prompts, and extracted structured data tables into the pre-trained generative language model to output a structured report on power grid planning.
[0032] This embodiment improves the efficiency, accuracy, and standardization of writing professional reports in the field of power grid planning by constructing a key information map in the field of power grid planning, using a multi-hop reasoning mechanism to find logical connections between different documents, and filling slots and generating text based on a predefined structure of power grid planning reports.
[0033] This application provides a possible implementation method for identifying key entities in the power grid field through the following steps: The document is parsed and preprocessed into blocks to obtain text blocks; Set the text sequence of the text block as follows: The entity label sequence is ; Text sequence Input a pre-tuned BERT (Bidirectional Encoder Representations from Transformers) model for the power grid domain to obtain a dynamic word vector matrix at the character level. The Transformer here is a neural network model based on a self-attention mechanism. Dynamic word vector matrix at the character level Input a bidirectional long short-term memory (BiLSTM) network to capture forward and backward contextual features of the text sequence; To ensure the validity of the entity label sequence, a CRF (Conditional Random Field) layer is introduced. The objective function of the CRF layer is defined as maximizing the text sequence. Entity label sequence conditional probability :
[0034] in, For text sequences and entity label sequence The scoring function between them is calculated as follows:
[0035] in, The set of all possible entity label sequences; The transition score matrix represents the transition from label Transfer to label The score; Let f be the emission fraction matrix, representing the output of the bidirectional long short-term memory network. One character was predicted as the label. The nonnormalized probability; By decoding the highest-scoring entity label sequence using the Viterbi algorithm, key entities in the power grid field can be identified.
[0036] Power grid planning documents contain a large number of technical terms. In this embodiment, the BERT-BiLSTM-CRF joint model is used for sequence labeling to improve the problem of poor application of technical terms by traditional models.
[0037] This application provides a possible implementation method. In multi-source heterogeneous data, the same physical entity often has multiple representations, such as "XX substation," "XX station," and "110kV XX substation." To construct a connected knowledge graph, these references must be aligned to unique entity identifiers. This embodiment proposes an alignment algorithm based on a hybrid distance metric, specifically including the following steps: Suppose two entity references to be aligned. and ; calculate and Alignment score as follows:
[0038] In the formula , , The sub-item weights are adjusted according to requirements. The formula calculation consists of three similarity components and one hard constraint factor. Set hard constraint factors The calculation is as follows:
[0039] in, for voltage level, for Voltage level; It is a null value; The similarity of surface names, i.e., literal similarity, is calculated using edit distance. :
[0040] in, To obtain The string, To obtain The string, To make the string Convert to string Minimum number of single-character editing operations required; For strings Length, For strings Length; Computational Entity and Context vectors in their respective documents , Cosine similarity between them, i.e., semantic context similarity :
[0041] Comparison Entities and Extracted attribute set , Calculate the Jaccard similarity coefficient, i.e., the degree of attribute overlap. :
[0042] Set alignment threshold ,like Then determine and For the same entity, merge corresponding nodes and integrate attribute information in the heterogeneous graph.
[0043] This application embodiment provides a possible implementation method. The above step S104 determines the preliminary document and related documents based on the query vector and heterogeneous graph, which may specifically include the following steps: Based on the query vector and heterogeneous graph, preliminary documents and documents to be associated are determined; Based on the search relevance scoring function Select the relevant document from the list of pending related documents:
[0044] in, Text blocks for documents to be associated with. Relative to query vector The final relevance score; Text block vector With query vector Dense search score; query vector The core entity nodes parsed from the data; For text blocks The entity nodes included; For text blocks Corresponding heterogeneous graph subgraphs; The shortest path length between two nodes in the heterogeneous graph; , Hyperparameters used to adjust the importance of dense retrieval and heterogeneous graph inference.
[0045] This embodiment can retrieve text blocks that do not directly mention the query term but contain information strongly related to the query entity, thereby solving the problem of missing cross-document information and realizing cross-document information association queries.
[0046] This application provides a possible implementation method. After retrieving multiple related text blocks, data conflicts may occur. For example, document A predicts a load of 100MW, while document B predicts a load of 120MW. To resolve the data conflict problem, an information source confidence evaluation model is introduced to filter out conflict-free key information from the search results. The information source confidence evaluation model is as follows:
[0047] in, These are the key data values to be ultimately selected; This is the context vector of the document containing the conflicting data; The source document of the document containing the conflicting data. The preset authority level; The current time when the report was generated; The publication date of the source document; This is the time decay factor.
[0048] The above introduces Figure 1 The embodiments shown have various implementation methods for each step. The following will further explain the report structure generation method based on cross-document key information association query of this application through specific embodiments.
[0049] Figure 2 This paper illustrates the overall architecture of a report structure generation system based on cross-document key information association query provided in an embodiment of this application. The system includes a data source layer, a preprocessing and graph construction layer, a logical reasoning and retrieval layer, and a generation layer. Here, the data source layer may include policy documents (PDF), historical reports (Word), power grid wiring diagrams (Image), load forecast tables (Excel), etc.; the preprocessing and graph construction layer may include document parsing, vectorization encoding, and entity extraction and alignment; the logical reasoning and retrieval layer may include schema parsing, multi-hop association retrieval, and conflict resolution; and the generation layer may include prompt construction, LLM (Large Language Model) invocation, and structured report output.
[0050] Figure 3 This paper illustrates the main flowchart of the report structure generation method provided in an embodiment of this application, as shown below. Figure 3 As shown, the process includes the following steps S1 to S4: S1: Preprocessing and vectorization of multi-source heterogeneous documents.
[0051] Collect multi-source documents related to power grid planning (including planning specifications, historical reports, load data tables, geographic information texts, etc.) and construct a document collection. For documents Perform the following preprocessing steps: 1. Format Conversion: Convert non-text formats (such as PDF, Excel, CSV, etc.) to plain text using the Apache Tika tool to achieve format unification; 2. Noise Reduction: Redundant symbols (such as "#"), blank lines, and irrelevant paragraphs (such as copyright notices) are removed from the text using regular expressions to obtain clean text. ; 3. Document Vectorization: Parsing and segmenting text to clean it up. Get text block Using a pre-tuned BERT model (also known as PowerBERT) for the power grid domain to process text blocks Encode to obtain semantic vectors .
[0052] S2: Construction of cross-document key information association graph.
[0053] Constructing heterogeneous graphs , where nodes Representing key entities (such as substation name, voltage level, year, region, etc.), edge It represents the semantic or logical relationship between key entities.
[0054] 1. Entity recognition in the power grid field based on BERT-BiLSTM-CRF.
[0055] Power grid planning documents contain a large number of technical terms. This embodiment uses a BERT-BiLSTM-CRF joint model for sequence labeling to improve the poor performance of traditional models in applying technical terms. The text sequence of the input text block is set as follows: The entity label sequence is .
[0056] (1) Contextual semantic encoding: the text sequence of the input text block By fine-tuning the BERT model for the power grid sector (also known as PowerBERT), a dynamic word vector matrix at the character level can be obtained. .
[0057] (2) Long-distance dependency feature extraction: extracting the vector matrix Input a bidirectional long short-term memory (BiLSTM) network to capture both forward and backward contextual features of the sequence.
[0058] (3) Global optimal path decoding based on CRF: In order to ensure the validity of the label sequence, a CRF layer is introduced. The objective function of the CRF layer is defined as maximizing the text sequence. Entity label sequence conditional probability :
[0059] in, For text sequences and entity label sequence The scoring function between them is calculated as follows:
[0060] in, The set of all possible entity label sequences; The transition score matrix represents the transition from label Transfer to label The score; Let f be the emission fraction matrix, representing the output of the bidirectional long short-term memory network. One character was predicted as the label. The nonnormalized probability; By decoding the highest-scoring entity label sequence using the Viterbi algorithm, key entities in the power grid field can be identified.
[0061] 2. Cross-document entity alignment based on hybrid distance metrics.
[0062] In multi-source heterogeneous data, the same physical entity often has multiple representations, such as "XX substation", "XX station", "110kV XX substation", etc. In order to construct a connected knowledge graph, these references must be aligned to unique entity identifiers. This embodiment proposes an alignment algorithm based on a hybrid distance metric.
[0063] Suppose two entity references to be aligned. and ; calculate and Alignment score as follows:
[0064] In the formula , , The sub-item weights are adjusted according to requirements. The formula calculation consists of three similarity components and one hard constraint factor. Set hard constraint factors The calculation is as follows:
[0065] in, for voltage level, for Voltage level; It is a null value; The similarity of surface names, i.e., literal similarity, is calculated using edit distance. :
[0066] in, To obtain The string, To obtain The string, To make the string Convert to string Minimum number of single-character editing operations required; For strings Length, For strings Length; Computational Entity and Context vectors in their respective documents , Cosine similarity between them, i.e., semantic context similarity :
[0067] Comparison Entities and Extracted attribute set , Calculate the Jaccard similarity coefficient, i.e., the degree of attribute overlap. :
[0068] Set alignment threshold ,like Then determine and For the same entity, merge corresponding nodes and integrate attribute information in the heterogeneous graph.
[0069] See Figure 4 As shown, the process includes input text, followed by entity recognition in the power grid domain based on BERT-BiLSTM-CRF, and outputting entities. Next, entities A and B are input, and similarity is assessed between them, including literal similarity, semantic similarity, and attribute similarity. Combined with hard constraints, if a similarity is determined... and For the same entity, merge corresponding nodes and integrate attribute information in the heterogeneous graph.
[0070] S3: Association query strategy based on report schema.
[0071] The power grid planning report is defined as a tree structure, where each leaf node... This represents a report paragraph that needs to be filled in.
[0072] 1. Query vector generation.
[0073] For each leaf node (e.g., load forecast analysis for region XX in 20XX), the system generates query vectors. .
[0074] 2. Multi-hop related search.
[0075] Employing a multi-hop retrieval mechanism, it not only retrieves directly related documents but also those retrieved through heterogeneous graphs. Related indirect documents.
[0076] Define the retrieval relevance scoring function :
[0077] in, Text blocks for documents to be associated with. Relative to query vector The final relevance score; Text block vector With query vector Dense search score; query vector The core entity nodes parsed from the data; For text blocks The entity nodes included; For text blocks Corresponding heterogeneous graph subgraphs; The shortest path length between two nodes in the heterogeneous graph is given. The shorter the path, the smaller the denominator, and the higher the score. , Hyperparameters used to adjust the importance of dense retrieval and heterogeneous graph inference.
[0078] This formula allows the system to retrieve document blocks that do not directly mention the query term but contain information strongly related to the query entity, thereby solving the problem of missing cross-document information and enabling cross-document information association queries.
[0079] S4: Conflict resolution and structure generation.
[0080] Data conflicts may occur after retrieving multiple related document blocks, for example, document A predicts a load of 100MW and document B predicts a load of 120MW.
[0081] 1. Credibility-weighted fusion.
[0082] To address the issue of data conflicts, an information source confidence evaluation model is introduced to filter out conflict-free key information from the search results. The information source confidence evaluation model is as follows:
[0083] in, These are the key data values to be ultimately selected; This is the context vector of the document containing the conflicting data; The source document of the document containing the conflicting data. The preset authority level; The current time when the report was generated; The publication date of the source document; This is the time decay factor.
[0084] 2. Template filling and generation.
[0085] The selected conflict-free key information is injected into a pre-trained generative language model. The model input includes not only prompt words but also extracted structured data tables.
[0086] This embodiment can achieve the following technical effects: (1) Improved accuracy: By introducing time decay and authority weight, the problem of multi-source data conflict is effectively solved, ensuring the accuracy of planning data; by introducing CRF layer, the problem of discontinuous output labels and illegal logic of traditional model is solved, and the accuracy is significantly improved when dealing with long named entities of power grid such as "220 kV XX transmission and transformation project".
[0087] (2) Strong logical coherence: Calculated using entity alignment score It can discover the hidden device and load relationships between different documents and introduce hard constraint factors. This ensures that the generated reports are not merely a collection of information, but also possess in-depth analytical value.
[0088] (3) Interpretability: Graph-based paths This allows each piece of text generated to be traced back to a specific document and reasoning path, facilitating manual verification.
[0089] It should be noted that the sequence numbers of the steps in the above embodiments do not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application. In practical applications, all the above possible implementation methods can be arbitrarily combined in a combined manner to form possible embodiments of this application, which will not be described in detail here.
[0090] Based on the report structure generation method based on cross-document key information association query provided in the above embodiments, and based on the same inventive concept, this application also provides a report structure generation system based on cross-document key information association query.
[0091] Figure 5 This is a structural diagram of the report structure generation system based on cross-document key information association query provided in this application embodiment. For example... Figure 5 As shown, the report structure generation system based on cross-document key information association query can specifically include a multi-source heterogeneous document preprocessing module 510, a cross-document key information association graph construction module 520, a context-aware association query module 530, and a structured report generation module 540.
[0092] The multi-source heterogeneous document preprocessing module 510 is used to collect multi-source documents related to power grid planning, construct a document set, and preprocess each document in the document set to obtain the preprocessed document. The cross-document key information association graph construction module 520 is used to construct a cross-document key information association graph based on the preprocessed documents, and obtain a constructed heterogeneous graph. In the heterogeneous graph, the nodes represent key entities in the power grid field, and the edges of the heterogeneous graph represent semantic or logical relationships between key entities. The context-aware association query module 530 is used to define the structure of the power grid planning report as a tree structure, where each leaf node represents a report paragraph that needs to be filled. For each leaf node, a query vector is generated, and preliminary documents and related documents are determined based on the query vector and the heterogeneous graph. Query and retrieval are performed in the preliminary documents and related documents to obtain retrieval results, and conflict-free key information is filtered out from the retrieval results. The structured report generation module 540 is used to input the selected conflict-free key information, prompt words and extracted structured data tables into a pre-trained generative language model and output a structured report on power grid planning.
[0093] This application embodiment provides a possible implementation method, wherein the cross-document key information association graph construction module 520 is further used to identify key entities in the power grid field through the following steps: The document is parsed and preprocessed into blocks to obtain text blocks; Set the text sequence of the text block as follows: The entity label sequence is ; Text sequence Input a BERT model pre-tuned for the power grid domain to obtain a dynamic word vector matrix at the character level. ; Dynamic word vector matrix at the character level Input a bidirectional long short-term memory network to capture forward and backward contextual features of text sequences; To ensure the validity of the entity label sequence, a Conditional Random Field (CRF) layer is introduced. The objective function of the CRF layer is defined as maximizing the text sequence. Entity label sequence conditional probability :
[0094] in, For text sequences and entity label sequence The scoring function between them is calculated as follows:
[0095] in, The set of all possible entity label sequences; The transition score matrix represents the transition from label Transfer to label The score; Let f be the emission fraction matrix, representing the output of the bidirectional long short-term memory network. One character was predicted as the label. The nonnormalized probability; By decoding the highest-scoring entity label sequence using the Viterbi algorithm, key entities in the power grid field can be identified.
[0096] This application embodiment provides a possible implementation, wherein the cross-document key information association graph construction module 520 is further configured to: Suppose two entity references to be aligned. and ; calculate and Alignment score as follows:
[0097] In the formula , , The sub-item weights are adjusted according to requirements. The formula calculation consists of three similarity components and one hard constraint factor. Set hard constraint factors The calculation is as follows:
[0098] in, for voltage level, for Voltage level; It is a null value; The similarity of surface names, i.e., literal similarity, is calculated using edit distance. :
[0099] in, To obtain The string, To obtain The string, To make the string Convert to string Minimum number of single-character editing operations required; For strings Length, For strings Length; Computational Entity and Context vectors in their respective documents , Cosine similarity between them, i.e., semantic context similarity :
[0100] Comparison Entities and Extracted attribute set , Calculate the Jaccard similarity coefficient, i.e., the degree of attribute overlap. :
[0101] Set alignment threshold ,like Then determine and For the same entity, merge corresponding nodes and integrate attribute information in the heterogeneous graph.
[0102] This application embodiment provides a possible implementation, wherein the context-aware association query module 530 is further used for: Based on the query vector and heterogeneous graph, preliminary documents and documents to be associated are determined; Based on the search relevance scoring function Select the relevant document from the list of pending related documents:
[0103] in, Text blocks for documents to be associated with. Relative to query vector The final relevance score; Text block vector With query vector Dense search score; query vector The core entity nodes parsed from the data; For text blocks The entity nodes included; For text blocks Corresponding heterogeneous graph subgraphs; The shortest path length between two nodes in the heterogeneous graph; , Hyperparameters used to adjust the importance of dense retrieval and heterogeneous graph inference.
[0104] This application embodiment provides a possible implementation method. The context-aware association query module 530 is further used to introduce an information source confidence evaluation model to filter out conflict-free key information from the search results. The information source confidence evaluation model is as follows:
[0105] in, These are the key data values to be ultimately selected; This is the context vector of the document containing the conflicting data; The source document of the document containing the conflicting data. The preset authority level; The current time when the report was generated; The publication date of the source document; This is the time decay factor.
[0106] Based on the same inventive concept, embodiments of this application also provide an electronic device, including a processor and a memory, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the report structure generation method based on cross-document key information association query of any of the above embodiments.
[0107] In an exemplary embodiment, an electronic device is provided, such as Figure 6 As shown, Figure 6 The illustrated electronic device 600 includes a processor 601 and a memory 603. The processor 601 and the memory 603 are connected, for example, via a bus 602. Optionally, the electronic device 600 may also include a transceiver 604. It should be noted that in practical applications, the transceiver 604 is not limited to one type, and the structure of this electronic device 600 does not constitute a limitation on the embodiments of this application.
[0108] Processor 601 may be a CPU (Central Processing Unit), GPU (Graphics Processing Unit), DSP (Digital Signal Processor), ASIC (Application Specific Integrated Circuit), FPGA, or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. It can implement or execute the various exemplary logic blocks, modules, and circuits described in conjunction with the disclosure of this application. Processor 601 may also be a combination that implements computational functions, such as including one or more microprocessor combinations, a combination of a DSP and a microprocessor, etc.
[0109] Bus 602 may include a pathway for transmitting information between the aforementioned components. Bus 602 may be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus, etc. Bus 602 can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 6 The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.
[0110] The memory 603 may be a ROM (Read Only Memory) or other type of static storage device capable of storing static information and instructions, RAM (Random Access Memory) or other type of dynamic storage device capable of storing information and instructions, or an EEPROM (Electrically Erasable Programmable Read Only Memory), CD-ROM (Compact Disc Read Only Memory) or other optical disc storage, optical disc storage (including compressed optical discs, laser discs, optical discs, digital universal optical discs, Blu-ray discs, etc.), magnetic disk storage media or other magnetic storage devices, or any other medium capable of carrying or storing desired program code in the form of instructions or data structures and accessible by a computer, but not limited thereto.
[0111] The memory 603 stores computer program code that executes the scheme of this application, and its execution is controlled by the processor 601. The processor 601 executes the computer program code stored in the memory 603 to implement the content shown in the foregoing method embodiments.
[0112] Among them, electronic devices include, but are not limited to: mobile terminals such as mobile phones, laptops, digital radio receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), and in-vehicle terminals (such as in-vehicle navigation terminals), as well as fixed terminals such as digital TVs and desktop computers. Figure 6 The electronic device shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments of this application.
[0113] Based on the same inventive concept, this application also provides a storage medium storing a computer program, wherein the computer program is configured to execute the report structure generation method based on cross-document key information association query of any of the above embodiments at runtime.
[0114] Based on the same inventive concept, this application also provides a computer program product, including a computer program configured to execute the report structure generation method based on cross-document key information association query of any of the above embodiments at runtime.
[0115] Those skilled in the art will clearly understand that the specific working process of the systems, devices, and modules described above can be referred to the corresponding process in the foregoing method embodiments. For the sake of brevity, it will not be repeated here.
[0116] Those skilled in the art will understand that the technical solution of this application, or all or part of it, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several program instructions to cause an electronic device (e.g., a personal computer, server, or network device) to execute all or part of the steps of the methods described in the embodiments of this application when running the program instructions. The aforementioned storage medium includes various media capable of storing program code, such as a USB flash drive, portable hard drive, read-only memory (ROM), random access memory (RAM), magnetic disk, or optical disk.
[0117] Alternatively, all or part of the steps of the foregoing method embodiments can be implemented by hardware (such as electronic devices like personal computers, servers, or network devices) associated with program instructions. The program instructions can be stored in a computer-readable storage medium. When the program instructions are executed by the processor of the electronic device, the electronic device executes all or part of the steps of the methods described in the embodiments of this application.
[0118] The above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit it. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that within the spirit and principles of this application, modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features therein; and these modifications or substitutions do not cause the corresponding technical solutions to leave the protection scope of this application.
Claims
1. A method for generating structured reports based on cross-document key information association queries, characterized in that, The method includes: Collect multi-source documents related to power grid planning and construct a document set; preprocess each document in the document set to obtain preprocessed documents; Based on the preprocessed documents, a cross-document key information association graph is constructed to obtain a heterogeneous graph. In the heterogeneous graph, the nodes represent key entities in the power grid field, and the edges represent semantic or logical relationships between key entities. The structure of the power grid planning report is defined as a tree structure, where each leaf node represents a report paragraph that needs to be filled. For each leaf node, a query vector is generated, and based on the query vector and the heterogeneous graph, preliminary documents and related documents are determined; The system performs queries and searches in the initial and related documents to obtain search results, and then filters out conflict-free key information from the search results. The selected conflict-free key information, prompts, and extracted structured data tables are input into a pre-trained generative language model to output a structured report on power grid planning.
2. The method according to claim 1, characterized in that, Identify key entities in the power grid sector using the following steps: The document is parsed and preprocessed into blocks to obtain text blocks; Set the text sequence of the text block as follows: The entity label sequence is ; Text sequence Input a BERT model pre-tuned for the power grid domain to obtain a dynamic word vector matrix at the character level. ; Dynamic word vector matrix at the character level Input a bidirectional long short-term memory network to capture forward and backward contextual features of text sequences; To ensure the validity of the entity label sequence, a Conditional Random Field (CRF) layer is introduced. The objective function of the CRF layer is defined as maximizing the text sequence. Entity label sequence conditional probability : in, For text sequences and entity label sequence The scoring function between them is calculated as follows: in, The set of all possible entity label sequences; The transition score matrix represents the transition from label Transfer to label The score; Let f be the emission fraction matrix, representing the output of the bidirectional long short-term memory network. One character was predicted as the label. The nonnormalized probability; By decoding the highest-scoring entity label sequence using the Viterbi algorithm, key entities in the power grid field can be identified.
3. The method according to claim 2, characterized in that, The method further includes: Suppose two entity references to be aligned. and ; calculate and Alignment score as follows: In the formula , , The sub-item weights are adjusted according to requirements. The formula calculation consists of three similarity components and one hard constraint factor. Set hard constraint factors The calculation is as follows: in, for voltage level, for Voltage level; It is a null value; The similarity of surface names, i.e., literal similarity, is calculated using edit distance. : in, To obtain The string, To obtain The string, To make the string Convert to string Minimum number of single-character editing operations required; For strings Length, For strings Length; Computational Entity and Context vectors in their respective documents , Cosine similarity between them, i.e., semantic context similarity : Comparison Entities and Extracted attribute set , Calculate the Jaccard similarity coefficient, i.e., the degree of attribute overlap. : Set alignment threshold ,like Then determine and For the same entity, merge corresponding nodes and integrate attribute information in the heterogeneous graph.
4. The method according to claim 1, characterized in that, Based on the query vector and heterogeneity graph, preliminary documents and related documents are identified, including: Based on the query vector and heterogeneous graph, preliminary documents and documents to be associated are determined; Based on the search relevance scoring function Select the relevant document from the list of pending related documents: in, Text blocks for documents to be associated with. Relative to query vector The final relevance score; Text block vector With query vector Dense search score; query vector The core entity nodes parsed from the data; For text blocks The entity nodes included; For text blocks Corresponding heterogeneous graph subgraphs; The shortest path length between two nodes in the heterogeneous graph; , Hyperparameters used to adjust the importance of dense retrieval and heterogeneous graph inference.
5. The method according to claim 3, characterized in that, An information source confidence evaluation model is introduced to filter out conflict-free key information from the search results. The information source confidence evaluation model is as follows: in, These are the key data values to be ultimately selected; This is the context vector of the document containing the conflicting data; The source document of the document containing the conflicting data. The preset authority level; The current time when the report was generated; The publication date of the source document; This is the time decay factor.
6. A report structure generation system based on cross-document key information association query, characterized in that, The system includes: The multi-source heterogeneous document preprocessing module is used to collect multi-source documents related to power grid planning, construct a document set, and preprocess each document in the document set to obtain the preprocessed document. The cross-document key information association graph construction module is used to construct a cross-document key information association graph based on preprocessed documents, and obtain a constructed heterogeneous graph. In the heterogeneous graph, the nodes represent key entities in the power grid field, and the edges of the heterogeneous graph represent semantic or logical relationships between key entities. The context-aware relational query module defines the structure of the power grid planning report as a tree structure, where each leaf node represents a report paragraph that needs to be filled. For each leaf node, a query vector is generated, and based on the query vector and the heterogeneous graph, preliminary documents and related documents are determined. Querying and retrieving are performed in the preliminary documents and related documents to obtain the retrieval results, and conflict-free key information is filtered out from the retrieval results. The structured report generation module is used to input the selected conflict-free key information, prompts, and extracted structured data tables into a pre-trained generative language model and output a structured report on power grid planning.
7. The system according to claim 6, characterized in that, The cross-document key information association graph construction module is also used to identify key entities in the power grid field through the following steps: The document is parsed and preprocessed into blocks to obtain text blocks; Set the text sequence of the text block as follows: The entity label sequence is ; Text sequence Input a BERT model pre-tuned for the power grid domain to obtain a dynamic word vector matrix at the character level. ; Dynamic word vector matrix at the character level Input a bidirectional long short-term memory network to capture forward and backward contextual features of text sequences; To ensure the validity of the entity label sequence, a Conditional Random Field (CRF) layer is introduced. The objective function of the CRF layer is defined as maximizing the text sequence. Entity label sequence conditional probability : in, For text sequences and entity label sequence The scoring function between them is calculated as follows: in, The set of all possible entity label sequences; The transition score matrix represents the transition from label Transfer to label The score; Let f be the emission fraction matrix, representing the output of the bidirectional long short-term memory network. One character was predicted as the label. The nonnormalized probability; By decoding the highest-scoring entity label sequence using the Viterbi algorithm, key entities in the power grid field can be identified.
8. An electronic device, characterized in that, The system includes a processor and a memory, wherein the memory stores a computer program, and the processor is configured to run the computer program to perform the report structure generation method based on cross-document key information association query as described in any one of claims 1 to 5.
9. A storage medium, characterized in that, The storage medium stores a computer program, wherein the computer program is configured to execute, at runtime, the report structure generation method based on cross-document key information association query as described in any one of claims 1 to 5.
10. A computer program product, comprising a computer program, characterized in that, The computer program is configured to execute, at runtime, the report structure generation method based on cross-document key information association query as described in any one of claims 1 to 5.