Method, device and equipment for constructing vectorization knowledge base in power multi-disciplinary field
Patent Information
- Application Number
- CN202611058734.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-16
- Publication Date
- 2026-10-23
AI Technical Summary
在长文本分块时,通用模型容易发生“语义偏移”导致关键条件信息遗漏或断裂;而在权重计算上,若仅采用TF-IDF,由于忽略了文档总长度对词频的稀释效应,无法精准区分关键专业设备词汇与一般副词,极易在知识入库阶段埋下底层数据质量隐患
[0054]上述电力多专业领域的向量化知识库构建方法、装置、计算机设备、计算机可读存储介质和计算机程序产品,获取包括结构化数据和非结构化数据的多源电力专业数据;对多源电力专业数据中未图文混排的第一类电力文档进行文档解析与特征降维预处理,提取文本的多维特征,并采用基于特征选择的实体关系选择模型进行关键信息抽取与标准化降维,生成第一类电力文档的标准文本表示;对多源电力专业数据中存在图文混排的第二类电力文档,采用多模态文档版面解析框架进行版面分析,融合视觉特征、布局特征与大语言模型提取的语义关键字特征构建图节点与边关系,通过图卷积神经网络进行文档节点分类与分组,重建第二类电力文档的层级结构;进一步将标准文本表示与还原层级结构后的文档内容通过预训练的大语言模型生成标准化语料,利用经过电力领域微调的向量模型对标准化语料进行深度语义编码,生成多模态高维稠密语义向量,以构建分布式向量数据库,同时构建倒排索引库。本方法通过多模态特征融合,可以解决带有复杂图表与交叉嵌套的电力文档知识碎片化问题,确保检索出来的条目带有清晰的上下文从属边界。结合BM25稀疏索引与精确的结构化字段逻辑校验,既具备模糊语义联想能力,又保证了在数字区间、严禁操作等“硬约束条件”下的准确性,大大提升了响应效率,降低了系统资源开销。
Smart Images

Figure CN122964276A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of power technology, and in particular to a method, apparatus, computer equipment, computer-readable storage medium, and computer program product for constructing a vectorized knowledge base across multiple power disciplines. Background Technology
[0002] With the rise of distributed representation learning and graph neural networks (GNNs), entity relationship reasoning based on graph embedding models such as TransE has begun to be applied in power grid fault diagnosis. However, this is mainly limited to highly structured triple data networks, and its ability to understand long, unstructured texts is extremely weak. In recent years, the maturity of large-scale pre-trained language models and retrieval-augmented generation (RAG) technologies has made document-level knowledge extraction possible. However, despite the rapid development of technologies based on large models and vectorized storage, traditional general-purpose retrieval-augmented generation technologies still face the following problems when applied to highly regulated industrial scenarios such as the power industry:
[0003] Power regulations and equipment manuals are generally characterized by their length, dense use of technical terminology, and complex cross-references across chapters. Existing text parsing technologies typically lack feature extraction and weighting mechanisms specific to the lexical and grammatical structures of the power industry. When segmenting long texts, general models are prone to "semantic shifts," leading to the omission or fragmentation of key conditional information. Furthermore, in weight calculation, if only TF-IDF is used, the dilution effect of the total document length on word frequency is ignored, making it impossible to accurately distinguish between key technical equipment terms and general adverbs. This can easily introduce underlying data quality vulnerabilities during the knowledge storage stage. Summary of the Invention
[0004] Therefore, it is necessary to provide a method, apparatus, computer equipment, computer-readable storage medium, and computer program product for constructing a vectorized knowledge base across multiple professional fields in the power industry, addressing the aforementioned technical issues.
[0005] Firstly, this application provides a method for constructing a vectorized knowledge base across multiple professional fields in the power industry, including:
[0006] Acquire multi-source power professional data, which includes structured data and unstructured data;
[0007] For the first type of power documents in the multi-source power professional data that do not have mixed text and graphics, document parsing and feature dimensionality reduction preprocessing are performed to extract multi-dimensional features of the text, and key information extraction and standardization dimensionality reduction are performed using an entity relationship selection model based on feature selection to generate a standard text representation of the first type of power documents.
[0008] For the second type of power documents in the multi-source power professional data that contain mixed text and images, a multimodal document layout parsing framework is used for layout analysis. Visual features, layout features and semantic keyword features extracted by a large language model are integrated to construct graph node and edge relationships. Document nodes are classified and grouped through a graph convolutional neural network to reconstruct the hierarchical structure of the second type of power documents.
[0009] The standard text representation and the document content after restoring the hierarchical structure are used to generate a standardized corpus through a pre-trained large language model.
[0010] The standardized corpus is subjected to deep semantic encoding using a vector model finely tuned for the power sector, generating multimodal high-dimensional dense semantic vectors to construct a distributed vector database, and simultaneously constructing an inverted index library.
[0011] In one embodiment, the document parsing and feature dimensionality reduction preprocessing of the first type of power documents in the multi-source power professional data that do not have mixed text and image layouts includes:
[0012] Based on the vector space model, characters, words, phrases, or sentences in the first type of power documents are selected as text feature terms.
[0013] The weight of each text feature term is calculated using the word frequency normalization weighting method;
[0014] Based on the text feature terms and the weight of each text feature term, multidimensional features are obtained.
[0015] In one embodiment, the step of using a feature-selective entity relationship selection model to extract key information and perform standardized dimensionality reduction to generate a standard text representation of the first type of power documents includes:
[0016] The preprocessed text is segmented and part-of-speech tagged, and named entity recognition is performed based on a power equipment dictionary;
[0017] The corpus that has undergone named entity recognition is converted into an XML tree. The documents are divided into three types of nodes: annotation, text, and tag, and then parsed and filtered hierarchically. The feature extraction module is used to perform metadata dimensionality reduction and discrimination classification.
[0018] In one embodiment, the second type of power documents containing mixed text and images in the multi-source power professional data undergoes layout analysis using a multimodal document layout parsing framework, including:
[0019] After standardizing the size of the document images of the second type of power documents, they are input into a pre-trained deep convolutional neural network, which is then combined with a feature pyramid network to extract feature maps containing multi-scale information.
[0020] Two-dimensional position information of a text box is obtained using optical character recognition, and image feature vectors of the corresponding regions are extracted from the feature map through region of interest pooling.
[0021] A prompt message for a large language model is constructed. Keyword sequences are extracted with the goal of text word frequency, word co-occurrence relationship and entity features. The keyword sequences are then input into a pre-trained text encoder to generate semantic feature representations.
[0022] In one embodiment, the step of classifying and grouping document nodes using a graph convolutional neural network to reconstruct the hierarchical structure of the second type of power documents includes:
[0023] A sinusoidal coding matrix is used to encode the reading order index of each text box to generate an order feature representing the relative order;
[0024] Calculate the spatial relative relationship characteristics of any pair of potentially connected nodes;
[0025] The node features, sequence features, and spatial relative relationship features are input into a graph convolutional neural network for processing. The output probability distribution is used to classify nodes and identify titles, paragraphs, tables, or charts.
[0026] A linear layer is used for binary classification to determine whether there are edge connections between nodes, in order to restore the hierarchical layout of the document.
[0027] In one embodiment, after constructing the distributed vector database and the inverted index library, the method further includes:
[0028] In response to the user's query request, a hybrid dual-engine high-precision retrieval architecture is used to extract related knowledge in parallel from the distributed vector database and the inverted index. After weighted fusion scoring, cross-attention rearrangement, and logical rule verification of the multi-way retrieval results, the question-and-answer results are output.
[0029] In one embodiment, the hybrid dual-engine high-precision retrieval architecture includes three parallel recall channels: keyword retrieval, structured numerical field retrieval, and semantic vector retrieval.
[0030] Secondly, this application also provides a device for constructing a vectorized knowledge base across multiple professional fields in the power industry, comprising:
[0031] The data acquisition module is used to acquire multi-source power professional data, which includes structured data and unstructured data.
[0032] The first processing module is used to perform document parsing and feature dimensionality reduction preprocessing on the first type of power documents in the multi-source power professional data that do not have mixed text and graphics, extract multi-dimensional features of the text, and use an entity relationship selection model based on feature selection to extract key information and standardize dimensionality reduction to generate a standard text representation of the first type of power documents.
[0033] The second processing module is used to perform layout analysis on the second type of power documents with mixed text and graphics in the multi-source power professional data using a multimodal document layout parsing framework. It integrates visual features, layout features and semantic keyword features extracted from a large language model to construct graph node and edge relationships. It then uses a graph convolutional neural network to classify and group document nodes and reconstruct the hierarchical structure of the second type of power documents.
[0034] The corpus generation module is used to generate standardized corpus by taking the standard text representation and the document content after restoring the hierarchical structure through a pre-trained large language model.
[0035] The database construction module is used to perform deep semantic encoding on the standardized corpus using a vector model fine-tuned for the power industry, generating multimodal high-dimensional dense semantic vectors to build a distributed vector database, and at the same time build an inverted index library.
[0036] Thirdly, this application also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to perform the following steps:
[0037] Acquire multi-source power professional data, which includes structured data and unstructured data;
[0038] For the first type of power documents in the multi-source power professional data that do not have mixed text and graphics, document parsing and feature dimensionality reduction preprocessing are performed to extract multi-dimensional features of the text, and key information extraction and standardization dimensionality reduction are performed using an entity relationship selection model based on feature selection to generate a standard text representation of the first type of power documents.
[0039] For the second type of power documents in the multi-source power professional data that contain mixed text and images, a multimodal document layout parsing framework is used for layout analysis. Visual features, layout features and semantic keyword features extracted by a large language model are integrated to construct graph node and edge relationships. Document nodes are classified and grouped through a graph convolutional neural network to reconstruct the hierarchical structure of the second type of power documents.
[0040] The standard text representation and the document content after restoring the hierarchical structure are used to generate a standardized corpus through a pre-trained large language model.
[0041] The standardized corpus is subjected to deep semantic encoding using a vector model finely tuned for the power sector, generating multimodal high-dimensional dense semantic vectors to construct a distributed vector database, and simultaneously constructing an inverted index library.
[0042] Fourthly, this application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, performs the following steps:
[0043] Acquire multi-source power professional data, which includes structured data and unstructured data;
[0044] For the first type of power documents in the multi-source power professional data that do not have mixed text and graphics, document parsing and feature dimensionality reduction preprocessing are performed to extract multi-dimensional features of the text, and key information extraction and standardization dimensionality reduction are performed using an entity relationship selection model based on feature selection to generate a standard text representation of the first type of power documents.
[0045] For the second type of power documents in the multi-source power professional data that contain mixed text and images, a multimodal document layout parsing framework is used for layout analysis. Visual features, layout features and semantic keyword features extracted by a large language model are integrated to construct graph node and edge relationships. Document nodes are classified and grouped through a graph convolutional neural network to reconstruct the hierarchical structure of the second type of power documents.
[0046] The standard text representation and the document content after restoring the hierarchical structure are used to generate a standardized corpus through a pre-trained large language model.
[0047] The standardized corpus is subjected to deep semantic encoding using a vector model finely tuned for the power sector, generating multimodal high-dimensional dense semantic vectors to construct a distributed vector database, and simultaneously constructing an inverted index library.
[0048] Fifthly, this application also provides a computer program product, including a computer program that, when executed by a processor, performs the following steps:
[0049] Acquire multi-source power professional data, which includes structured data and unstructured data;
[0050] For the first type of power documents in the multi-source power professional data that do not have mixed text and graphics, document parsing and feature dimensionality reduction preprocessing are performed to extract multi-dimensional features of the text, and key information extraction and standardization dimensionality reduction are performed using an entity relationship selection model based on feature selection to generate a standard text representation of the first type of power documents.
[0051] For the second type of power documents in the multi-source power professional data that contain mixed text and images, a multimodal document layout parsing framework is used for layout analysis. Visual features, layout features and semantic keyword features extracted by a large language model are integrated to construct graph node and edge relationships. Document nodes are classified and grouped through a graph convolutional neural network to reconstruct the hierarchical structure of the second type of power documents.
[0052] The standard text representation and the document content after restoring the hierarchical structure are used to generate a standardized corpus through a pre-trained large language model.
[0053] The standardized corpus is subjected to deep semantic encoding using a vector model finely tuned for the power sector, generating multimodal high-dimensional dense semantic vectors to construct a distributed vector database, and simultaneously constructing an inverted index library.
[0054] The aforementioned method, apparatus, computer equipment, computer-readable storage medium, and computer program products for constructing a vectorized knowledge base across multiple power disciplines acquire multi-source power professional data, including both structured and unstructured data. For the first type of power documents in the multi-source power professional data that do not have mixed text and image layouts, document parsing and feature dimensionality reduction preprocessing are performed to extract multi-dimensional features of the text. A feature-selective entity relationship model is then used for key information extraction and standardized dimensionality reduction to generate a standard text representation of the first type of power documents. For the second type of power documents in the multi-source power professional data that have mixed text and image layouts, a multimodal document layout parsing framework is used for layout analysis. Visual features, layout features, and semantic keyword features extracted from a large language model are integrated to construct graph node and edge relationships. A graph convolutional neural network is used for document node classification and grouping to reconstruct the hierarchical structure of the second type of power documents. Furthermore, the standard text representation and the document content after restoring the hierarchical structure are used to generate standardized corpus through a pre-trained large language model. A vector model fine-tuned for the power field is used to perform deep semantic encoding on the standardized corpus, generating multimodal high-dimensional dense semantic vectors to construct a distributed vector database, while simultaneously constructing an inverted index library. This method, through multimodal feature fusion, addresses the fragmentation problem of knowledge in power documents with complex charts and nested structures, ensuring that retrieved entries have clear contextual boundaries. Combining BM25 sparse indexing with precise structured field logic validation, it possesses both fuzzy semantic association capabilities and guarantees accuracy under "hard constraints" such as numerical ranges and prohibited operations, significantly improving response efficiency and reducing system resource overhead. Attached Figure Description
[0055] To more clearly illustrate the technical solutions in the embodiments of this application or related technologies, the drawings used in the description of the embodiments of this application or related technologies will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0056] Figure 1 This is a flowchart illustrating a method for constructing a vectorized knowledge base across multiple disciplines in the power industry, as shown in one embodiment.
[0057] Figure 2 This is a schematic diagram of the processing flow for power documents with mixed text and images in one embodiment;
[0058] Figure 3 This is a flowchart illustrating the process of reconstructing the hierarchical structure of an electrical document containing mixed text and graphics in one embodiment.
[0059] Figure 4 This is a structural block diagram of a vectorized knowledge base construction device for multiple professional fields in the power industry, as shown in one embodiment.
[0060] Figure 5 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation
[0061] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0062] 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 data 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. The terms "comprising" and "having," and any variations thereof, as used in this application, are intended to cover non-exclusive inclusion. The term "a plurality" as used in this application refers to two or more. The term "and / or" as used in this application refers to one of the embodiments or any combination of multiple embodiments.
[0063] Among related technologies, specialized sentence embedding models (Sentence-BERT) based on the native BERT (Bidirectional Encoder Representations from Transformers) have established a technical path of "vector embedding + dense retrieval," significantly improving the semantic search efficiency of academic documents and general data. However, when applied to highly regulated industrial scenarios such as the power industry, traditional general-purpose RAG technology still faces the following problems:
[0064] (1) Difficulty in managing multi-source heterogeneous data, with serious semantic defocusing issues in long professional texts. Power regulations and equipment manuals are generally characterized by length, dense professional terminology, and complex cross-references across chapters. Existing text parsing technologies usually lack feature extraction weighting mechanisms for power professional lexical and grammatical structures. When segmenting long texts, general models are prone to "semantic shift," leading to the omission or breakage of key conditional information (such as specific temperature requirements and safety operation prohibitions). In terms of weight calculation, if only the Term Frequency-Inverse Document Frequency (TF-IDF) method is used, it cannot accurately distinguish between key professional equipment terms and general adverbs because it ignores the dilution effect of the total document length on term frequency, which can easily create underlying data quality risks during the knowledge storage stage.
[0065] (2) Insufficient ability to parse multimodal structures in documents with mixed text and graphics. Power technology documents often contain complex layouts, such as two-column layouts, inserted logic flowcharts, multi-level tables, equipment schematics, and complex nested hierarchical heading systems (chapter-section-article-clause). Traditional single-vision optical character recognition (OCR) or semi-manual layout reconstruction technology can only extract planar text coordinates and cannot integrate "visual features", "spatial layout features" and "deep text semantics", thus causing the parsed text to lose its logical structure.
[0066] (3) A single retrieval architecture struggles to balance generalized understanding with precise matching under strong constraints, resulting in high compliance risks. Power safety production scenarios demand extremely high accuracy and absolute compliance from knowledge retrieval results. While pure vector semantic retrieval excels in colloquial natural language queries and synonym expansion, it is prone to causing "illusions" and overgeneralization in large models when faced with stringent power compliance regulations, as specific numerical ranges are easily weakened in dense, high-dimensional vectors. Conversely, while pure keyword sparse retrieval accurately anchors terms, it lacks the ability to understand multiple synonymous intents, leading to low generalization recall.
[0067] To address the aforementioned issues, this application proposes a method for constructing a vectorized knowledge base across multiple professional fields in the power industry. This method integrates visual features, layout features, and large-scale model semantic features. It utilizes graph convolutional networks to classify and group document nodes, reconstructs a hierarchical multimodal layout parsing framework, and employs a hybrid dual-engine high-precision retrieval architecture that includes three parallel recall channels: BM25 (Best Matching 25, a probabilistic keyword retrieval algorithm) keyword retrieval, structured numerical field retrieval (point query and range query), and deep model semantic vector retrieval.
[0068] In one embodiment, such as Figure 1 As shown, a method for constructing a vectorized knowledge base across multiple professional fields in the power industry is provided. This embodiment illustrates the application of this method to a terminal. It is understood that this method can also be applied to a server, and further to a system including both a terminal and a server, and implemented through interaction between the terminal and the server. In this embodiment, the method includes the following steps:
[0069] Step S110: Obtain multi-source power professional data, which includes structured data and unstructured data.
[0070] Unstructured data includes power regulations documents, equipment technical manuals, fault handling texts, power grid topology diagrams, time-series operation data, and graphical data.
[0071] Step S120: For the first type of power documents in the multi-source power professional data that do not have mixed text and image layout, perform document parsing and feature dimensionality reduction preprocessing, extract multi-dimensional features of the text, and use an entity relationship selection model based on feature selection to extract key information and standardize dimensionality reduction to generate a standard text representation of the first type of power documents.
[0072] In some embodiments, document parsing and feature dimensionality reduction preprocessing are performed on the first type of power documents in multi-source power professional data that do not have mixed text and image layouts. This includes: selecting characters, words, phrases, short phrases, or sentences in the first type of power documents as text feature items based on the vector space model as the basic framework; calculating the weight of each text feature item using the word frequency normalization weight method; and obtaining multidimensional features based on the text feature items and the weight of each text feature item.
[0073] Among them, the Term Frequency Cost (TFC) method is a weight calculation method that introduces text length normalization processing on the basis of TF-IDF.
[0074] In the specific implementation, a vector space model is introduced as the basic framework, and characters, words, phrases, sentences, or sentences are selected as text feature terms. The weight of each feature term is calculated using a word frequency normalization weighting method based on document length normalization. The calculation formula is as follows:
[0075]
[0076] in, Representation of features In the document In the term frequency, N represents the total number of documents in the document set. Indicates the inclusion of features The number of documents, This is the inverse document frequency.
[0077] Specifically, a feature-based entity relationship selection model is used to extract key information and standardize dimensionality reduction to generate a standard text representation of the first type of power documents. This includes: using a natural language processing component to segment and tag the preprocessed text, and performing named entity recognition based on a power equipment dictionary; converting the corpus that has undergone named entity recognition into an XML tree, dividing the document into three types of nodes—annotation, text, and tags—for hierarchical parsing and filtering, and performing metadata dimensionality reduction and discrimination classification through a feature extraction module.
[0078] Among them, the Power Equipment Dictionary is a proprietary dictionary that includes commonly used power equipment and job titles.
[0079] In practice, natural language processing components can be used to segment and tag the preprocessed text, and named entity recognition can be performed using a proprietary dictionary containing common power equipment and job titles. The corpus with entity recognition is then converted into an XML tree, and the HTMLParser component is used to divide the document into three types of nodes: annotation, text, and tags for hierarchical parsing and filtering. Finally, the feature extraction module performs metadata dimensionality reduction and classification.
[0080] Step S130: For the second type of power documents with mixed text and image layout in the multi-source power professional data, a multimodal document layout parsing framework is used to perform layout analysis. Visual features, layout features and semantic keyword features extracted by the large language model are integrated to construct graph node and edge relationships. The document nodes are classified and grouped through graph convolutional neural network to reconstruct the hierarchical structure of the second type of power documents.
[0081] The second type of power documents are those with complex layouts that include both text and images.
[0082] The reconstructed hierarchical structure is similar to a "chapter-section-article-clause" hierarchy.
[0083] In this step, a multilayer perceptron network can be used to concatenate and nonlinearly transform the image feature vector, layout features, and keyword features in the feature dimension to generate unified graph node features.
[0084] In some embodiments, reference Figure 2 For the second type of power documents containing mixed text and graphics in multi-source power professional data, a multimodal document layout parsing framework is used for layout analysis, including:
[0085] Step S131: After standardizing the size of the document image of the second type of power document, input it into the pre-trained deep convolutional neural network, and combine it with the feature pyramid network to extract feature maps containing multi-scale information.
[0086] Step S132: Obtain the two-dimensional position information of the text box using optical character recognition, and extract the image feature vector of the corresponding region from the feature map through region of interest pooling;
[0087] Step S133: Construct prompt information for large-scale language models, extract keyword sequences with text word frequency, word co-occurrence relationship and entity features as targets, and input the keyword sequences into a pre-trained text encoder to generate semantic feature representations.
[0088] Specifically, the document image size is normalized to 400×400×3 RGB images, input into a pre-trained ResNet101 deep convolutional neural network, and combined with a feature pyramid network to extract feature maps containing multi-scale information. Two-dimensional positional information of text boxes is obtained using optical character recognition, and corresponding region image feature vectors are extracted from the feature maps through region-of-interest pooling. A specific prompt for a large-scale language model is constructed, focusing on word frequency, word co-occurrence relationships, and entity features. After removing stop words and punctuation marks, document keyword sequences are extracted and input into a pre-trained BERT text encoder to generate semantic feature representations.
[0089] Furthermore, in some embodiments, such as Figure 3As shown, a graph convolutional neural network is used to classify and group document nodes, reconstructing the hierarchical structure of the second type of electricity documents, including:
[0090] Step S134: Encode the reading order index of each text box using a sine coding matrix to generate an order feature representing the relative order;
[0091] Step S135: Calculate the spatial relative relationship characteristics of any pair of potentially connected nodes;
[0092] Step S136: Input the node features, sequence features and spatial relative relationship features into the graph convolutional neural network for processing, output the probability distribution for node classification, and identify titles, paragraphs, tables or charts;
[0093] Step S137: Use the linear layer to perform binary classification to determine whether there are edge connections between nodes in order to restore the hierarchical layout inside the document.
[0094] Specifically, node features, sequence features, and relationship features are input into a graph convolutional neural network for feature aggregation. A fully connected layer combined with a linear layer outputs a probability distribution for node classification, identifying titles, paragraphs, tables, or charts. Then, a linear layer is used for binary classification to determine whether edge connections exist between node pairs, thus reconstructing the document's internal hierarchical layout.
[0095] Step S140: The standard text representation and the document content after restoring the hierarchical structure are used to generate a standardized corpus through a pre-trained large language model.
[0096] Step S150: Use a vector model fine-tuned for the power industry to perform deep semantic encoding on the standardized corpus to generate multimodal high-dimensional dense semantic vectors, so as to build a distributed vector database and an inverted index library.
[0097] In some embodiments, after constructing the distributed vector database and the inverted index, the method further includes: responding to a user's query request, using a hybrid dual-engine high-precision retrieval architecture to extract related knowledge from the distributed vector database and the inverted index in parallel, performing weighted fusion scoring, cross-attention rearrangement, and logical rule verification on the multi-way retrieval results, and then outputting the question-and-answer results.
[0098] The hybrid dual-engine high-precision retrieval architecture includes three parallel recall channels: keyword retrieval, structured numerical field retrieval, and semantic vector retrieval.
[0099] Keyword retrieval employs the BM25 algorithm, based on the principle of term frequency-inverse document frequency and document length normalization. Its relevance score is calculated using the following formula:
[0100]
[0101] in, The first part of the query text after decomposition Entity words, For query items in candidate documents The frequency in and These are the document length and average length, respectively. , For word frequency scaling control hyperparameters, This is a hyperparameter for length scaling control.
[0102] Among them, the structured numerical field retrieval supports point queries and range queries, and its score calculation formula is as follows:
[0103]
[0104] in, This indicates the total number of numeric query entities parsed from the front-end query request; Indicates the first Prior importance weights assigned to each numerical entity; This is an indicator function.
[0105] Among them, semantic vector retrieval uses a domain-fine-tuned deep text classification model to evaluate semantic similarity, and its similarity calculation formula is as follows:
[0106]
[0107] in, This represents the feature vector output by the text classification model after the query and document concatenation tags are processed. This is the weight matrix of the fully connected layer of the model.
[0108] The aforementioned method for constructing a vectorized knowledge base across multiple power disciplines involves acquiring multi-source power discipline data, including both structured and unstructured data. For the first type of power documents in the multi-source power discipline data that do not have mixed text and image layouts, document parsing and feature dimensionality reduction preprocessing are performed to extract multi-dimensional text features. A feature-selective entity relationship model is then used for key information extraction and standardized dimensionality reduction to generate a standard text representation of the first type of power documents. For the second type of power documents in the multi-source power discipline data that have mixed text and image layouts, a multimodal document layout parsing framework is used for layout analysis. Visual features, layout features, and semantic keyword features extracted from a large language model are integrated to construct graph node and edge relationships. A graph convolutional neural network is used for document node classification and grouping to reconstruct the hierarchical structure of the second type of power documents. Furthermore, the standard text representation and the document content after restoring the hierarchical structure are used to generate standardized corpus through a pre-trained large language model. A vector model fine-tuned for the power discipline is then used to perform deep semantic encoding on the standardized corpus, generating multimodal high-dimensional dense semantic vectors to construct a distributed vector database, while simultaneously constructing an inverted index library. This method, through multimodal feature fusion, addresses the fragmentation problem of knowledge in power documents with complex charts and nested structures, ensuring that retrieved entries have clear contextual boundaries. Combining BM25 sparse indexing with precise structured field logic validation, it possesses both fuzzy semantic association capabilities and guarantees accuracy under "hard constraints" such as numerical ranges and prohibited operations, significantly improving response efficiency and reducing system resource overhead.
[0109] It should be understood that although the steps in the flowcharts of the above embodiments are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the above embodiments may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.
[0110] Based on the same inventive concept, this application also provides a vectorized knowledge base construction device for multiple professional fields of power, for implementing the above-mentioned method for constructing a vectorized knowledge base for multiple professional fields of power. The solution provided by this device is similar to the solution described in the above-described method. Therefore, the specific limitations of one or more embodiments of the vectorized knowledge base construction device for multiple professional fields of power provided below can be found in the limitations of the method for constructing a vectorized knowledge base for multiple professional fields of power described above, and will not be repeated here.
[0111] In one exemplary embodiment, such as Figure 4 As shown, a vectorized knowledge base construction device for multiple professional fields in the power industry is provided, including:
[0112] The data acquisition module 410 is used to acquire multi-source power professional data, which includes structured data and unstructured data.
[0113] The first processing module 420 is used to perform document parsing and feature dimensionality reduction preprocessing on the first type of power documents in multi-source power professional data that do not have mixed text and graphics. It extracts multi-dimensional features of the text and uses an entity relationship selection model based on feature selection to extract key information and standardize dimensionality reduction to generate a standard text representation of the first type of power documents.
[0114] The second processing module 430 is used to analyze the layout of the second type of power documents with mixed text and graphics in the multi-source power professional data using a multimodal document layout parsing framework. It integrates visual features, layout features and semantic keyword features extracted from a large language model to construct graph node and edge relationships. It then uses a graph convolutional neural network to classify and group document nodes and reconstruct the hierarchical structure of the second type of power documents.
[0115] Corpus generation module 440 is used to generate standardized corpus by combining standard text representations and document content after restoring hierarchical structure through a pre-trained large language model.
[0116] The database construction module 450 is used to perform deep semantic encoding on standardized corpora using a vector model finely tuned for the power industry, generating multimodal high-dimensional dense semantic vectors to build a distributed vector database, and at the same time build an inverted index library.
[0117] In one embodiment, the first processing module 420 is further configured to select characters, words, phrases, short phrases, or sentences in the first type of power documents as text feature items based on the vector space model as the basic framework; calculate the weight of each text feature item using the word frequency normalization weight method; and obtain multi-dimensional features based on the text feature items and the weight of each text feature item.
[0118] In one embodiment, the first processing module 420 is further configured to perform word segmentation and part-of-speech tagging on the preprocessed text, and perform named entity recognition based on the power equipment dictionary; convert the corpus that has undergone named entity recognition into an XML tree, divide the document into three types of nodes: annotation, text, and tag, and perform hierarchical parsing and filtering; and perform metadata dimensionality reduction and discrimination classification through the feature extraction module.
[0119] In one embodiment, the second processing module 430 is further configured to: standardize the size of the document image of the second type of power document; input it into a pre-trained deep convolutional neural network; combine it with a feature pyramid network to extract a feature map containing multi-scale information; obtain two-dimensional position information of the text box using optical character recognition; extract the image feature vector of the corresponding region from the feature map through region of interest pooling; construct prompt information for a large language model; extract keyword sequences with text word frequency, word co-occurrence relationship and entity features as targets; and input the keyword sequences into a pre-trained text encoder to generate semantic feature representation.
[0120] In one embodiment, the second processing module 430 is further configured to encode the reading order index of each text box using a sine coding matrix to generate an order feature representing the relative order; calculate the spatial relative relationship feature of any pair of potentially connected nodes; input the node feature, order feature and spatial relative relationship feature into a graph convolutional neural network for processing, output a probability distribution for node classification, and identify titles, paragraphs, tables or charts; and use a linear layer for binary classification to determine whether there are edge connections between nodes in order to restore the hierarchical layout inside the document.
[0121] In one embodiment, the device further includes an information query module, which responds to a user's query request by using a hybrid dual-engine high-precision retrieval architecture to extract related knowledge in parallel from a distributed vector database and an inverted index database, and outputs question-and-answer results after weighted fusion scoring, cross-attention rearrangement, and logical rule verification of the multi-way retrieval results.
[0122] In one embodiment, the hybrid dual-engine high-precision retrieval architecture includes three parallel recall channels: keyword retrieval, structured numerical field retrieval, and semantic vector retrieval.
[0123] Each module in the aforementioned vectorized knowledge base construction device for multiple power disciplines can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the memory of a computer device as software, so that the processor can call and execute the operations corresponding to each module.
[0124] In one exemplary embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as follows: Figure 5As shown, the computer device includes a processor, memory, input / output interfaces, a communication interface, a display unit, and an input device. The processor, memory, and input / output interfaces are connected via a system bus, and the communication interface, display unit, and input device are also connected to the system bus via the input / output interfaces. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The input / output interfaces are used for exchanging information between the processor and external devices. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, mobile cellular networks, Near Field Communication (NFC), or other technologies. When the computer program is executed by the processor, it implements a method for constructing a vectorized knowledge base across multiple power disciplines. The display unit is used to create a visually visible image and can be a display screen, a projection device, or a virtual reality imaging device. The display screen can be an LCD screen or an e-ink screen. The input device of the computer device can be a touch layer covering the display screen, or buttons, trackballs, or touchpads set on the casing of the computer device, or external keyboards, touchpads, or mice, etc.
[0125] Those skilled in the art will understand that Figure 5 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0126] In one embodiment, a computer device is also provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in the above method embodiments.
[0127] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon that, when executed by a processor, implements the steps in the above method embodiments.
[0128] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps in the above method embodiments.
[0129] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, artificial intelligence (AI) processors, etc., and are not limited to these.
[0130] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.
[0131] The above embodiments merely illustrate several implementation methods of this application, and their descriptions are relatively specific and detailed, but they should not be construed as limiting the scope of this application's patent. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. A method for constructing a vectorized knowledge base across multiple professional fields in the power industry, characterized in that, The method includes: Acquire multi-source power professional data, which includes structured data and unstructured data; For the first type of power documents in the multi-source power professional data that do not have mixed text and graphics, document parsing and feature dimensionality reduction preprocessing are performed to extract multi-dimensional features of the text, and key information extraction and standardization dimensionality reduction are performed using an entity relationship selection model based on feature selection to generate a standard text representation of the first type of power documents. For the second type of power documents in the multi-source power professional data that contain mixed text and images, a multimodal document layout parsing framework is used for layout analysis. Visual features, layout features and semantic keyword features extracted by a large language model are integrated to construct graph node and edge relationships. Document nodes are classified and grouped through a graph convolutional neural network to reconstruct the hierarchical structure of the second type of power documents. The standard text representation and the document content after restoring the hierarchical structure are used to generate a standardized corpus through a pre-trained large language model. The standardized corpus is subjected to deep semantic encoding using a vector model finely tuned for the power sector, generating multimodal high-dimensional dense semantic vectors to construct a distributed vector database, and simultaneously constructing an inverted index library.
2. The method according to claim 1, characterized in that, The document parsing and feature dimensionality reduction preprocessing for the first type of power documents in the multi-source power professional data that do not have mixed text and image layouts includes: Based on the vector space model, characters, words, phrases, or sentences in the first type of power documents are selected as text feature terms. The weight of each text feature term is calculated using the word frequency normalization weighting method; Based on the text feature terms and the weight of each text feature term, multidimensional features are obtained.
3. The method according to claim 1, characterized in that, The step of using a feature-based entity relationship selection model to extract key information and perform standardized dimensionality reduction to generate a standard text representation of the first type of power documents includes: The preprocessed text is segmented and part-of-speech tagged, and named entity recognition is performed based on a power equipment dictionary; The corpus that has undergone named entity recognition is converted into an XML tree. The documents are divided into three types of nodes: annotation, text, and tag, and then parsed and filtered hierarchically. The feature extraction module is used to perform metadata dimensionality reduction and discrimination classification.
4. The method according to claim 1, characterized in that, The second type of power documents containing mixed text and graphics in the multi-source power professional data are analyzed using a multimodal document layout parsing framework, including: After standardizing the size of the document images of the second type of power documents, they are input into a pre-trained deep convolutional neural network, which is then combined with a feature pyramid network to extract feature maps containing multi-scale information. Two-dimensional position information of a text box is obtained using optical character recognition, and image feature vectors of the corresponding regions are extracted from the feature map through region of interest pooling. A prompt message for a large language model is constructed. Keyword sequences are extracted with the goal of text word frequency, word co-occurrence relationship and entity features. The keyword sequences are then input into a pre-trained text encoder to generate semantic feature representations.
5. The method according to claim 1, characterized in that, The step of classifying and grouping document nodes using a graph convolutional neural network to reconstruct the hierarchical structure of the second type of power documents includes: A sinusoidal coding matrix is used to encode the reading order index of each text box to generate an order feature representing the relative order; Calculate the spatial relative relationship characteristics of any pair of potentially connected nodes; The node features, sequence features, and spatial relative relationship features are input into a graph convolutional neural network for processing. The output probability distribution is used to classify nodes and identify titles, paragraphs, tables, or charts. A linear layer is used for binary classification to determine whether there are edge connections between nodes, in order to restore the hierarchical layout of the document.
6. The method according to claim 1, characterized in that, After constructing the distributed vector database and the inverted index library, the following is also included: In response to the user's query request, a hybrid dual-engine high-precision retrieval architecture is used to extract related knowledge in parallel from the distributed vector database and the inverted index. After weighted fusion scoring, cross-attention rearrangement, and logical rule verification of the multi-way retrieval results, the question-and-answer results are output.
7. The method according to claim 6, characterized in that, The hybrid dual-engine high-precision retrieval architecture includes three parallel recall channels: keyword retrieval, structured numerical field retrieval, and semantic vector retrieval.
8. A vectorized knowledge base construction device for multiple professional fields in the power industry, characterized in that, The device includes: The data acquisition module is used to acquire multi-source power professional data, which includes structured data and unstructured data. The first processing module is used to perform document parsing and feature dimensionality reduction preprocessing on the first type of power documents in the multi-source power professional data that do not have mixed text and graphics, extract multi-dimensional features of the text, and use an entity relationship selection model based on feature selection to extract key information and standardize dimensionality reduction to generate a standard text representation of the first type of power documents. The second processing module is used to analyze the layout of the second type of power documents with mixed text and images in the multi-source power professional data using a multimodal document layout parsing framework. It integrates visual features, layout features and semantic keyword features extracted by a large language model to construct graph node and edge relationships, classifies and groups document nodes through a graph convolutional neural network, and reconstructs the hierarchical structure of the second type of power documents. The corpus generation module is used to generate standardized corpus by taking the standard text representation and the document content after restoring the hierarchical structure through a pre-trained large language model. The database construction module is used to perform deep semantic encoding on the standardized corpus using a vector model finely tuned for the power industry, generating multimodal high-dimensional dense semantic vectors to construct a distributed vector database, and simultaneously construct an inverted index library.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 7.