A method for constructing power system vector knowledge base based on text vectorization

By combining sparse and dense vectorization technology and multi-stage screening mechanism, an efficient power system vector knowledge base is built, which solves the problem of inefficient search of traditional power system knowledge bases, realizes more accurate and efficient knowledge management, and supports power systems intelligent management.

CN118964695BActive Publication Date: 2025-01-17STATE GRID INFO TELECOM GREAT POWER SCI & TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411466691.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-10-21
Publication Date
2025-01-17
Estimated Expiration
2044-10-21

AI Technical Summary

Technical Problem

The traditional power system knowledge base relies on keyword matching and manual maintenance, resulting in lagging knowledge updates, low retrieval efficiency and low accuracy, inability to effectively utilize massive knowledge, and difficult to improve the level of intelligent management.

Method used

Using a text vectorization-based method, a combination of sparse vectors (TF-IDF) and dense vectors (BERT embeddings) is combined with multi-stage screening mechanisms and domain-specific information and rules to build an efficient, accurate and flexible vector knowledge base for power systems. , optimize query processing and result reordering.

Benefits of technology

It improves the construction efficiency and use effect of the power system knowledge base, improves the accuracy of text representation and the relevance of search results, provides accurate, timely and comprehensive knowledge support, and provides strong support for intelligent management of the power system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118964695B_ABST
    Figure CN118964695B_ABST
Patent Text Reader

Abstract

The present invention relates to a method for constructing a power system vector knowledge base based on text vectorization, comprising the following steps: step S1: obtaining the original text and metadata of the data related to the construction of the power system vector knowledge base, and preprocessing; step S2: performing text vectorization by combining sparse vectors and dense vectors; step S3: storing the original text and metadata in a relational database, storing the vector data in a NoSQL vector database, and constructing an association relationship; step S4: when a user inputs a query, optimizing the query vector, improving the query algorithm and optimizing the query process, introducing a multi-stage screening mechanism, and obtaining preliminary search results; step S5: based on the strategy of enhanced recall, using domain-specific information and rules to reorder the preliminary search results, and obtaining the final search results. The present invention can effectively improve the construction efficiency and use effect of the power system knowledge base.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of knowledge base construction, and in particular to a method for constructing a power system vector knowledge base based on text vectorization. Background Art

[0002] As the core infrastructure of modern industry, the safe, stable and efficient operation of power system is of vital importance. The management and maintenance of power system involves a large amount of professional knowledge and technical documents, such as equipment operation manuals, fault reports, dispatch strategies and construction specifications. In order to improve the intelligent management level of power system and effectively utilize the massive power system knowledge, it is crucial to establish an efficient and reliable power system vector knowledge base.

[0003] Traditional power system knowledge bases mostly rely on keyword matching and manually maintained knowledge tags, which have problems such as delayed knowledge updates, low retrieval efficiency, and low accuracy. With the development of natural language processing (NLP) and machine learning technologies, the knowledge base construction method based on text vectorization has brought new opportunities for power system knowledge management. Summary of the invention

[0004] In order to solve the above problems, the purpose of the present invention is to provide a method for constructing a power system vector knowledge base based on text vectorization, and combine the specific needs of the power system to construct an efficient, accurate, flexible and scalable power system vector knowledge base, which effectively improves processing accuracy and query performance.

[0005] To achieve the above object, the present invention adopts the following technical solutions:

[0006] A method for constructing a power system vector knowledge base based on text vectorization includes the following steps:

[0007] Step S1: Obtain the original text and metadata of the data related to the construction of the power system vector knowledge base, and pre-process it;

[0008] Step S2: Text vectorization is performed by combining sparse vectors (TF-IDF) and dense vectors (BERT embeddings);

[0009] Step S3: storing the original text and metadata in a relational database, storing the vector data in a NoSQL vector database, and building an association relationship;

[0010] Step S4: When the user enters a query, the query vector is optimized, the query algorithm and query process are improved, a multi-stage screening mechanism is introduced, and preliminary search results are obtained;

[0011] The multi-stage screening mechanism is introduced as follows:

[0012] First, the approximate nearest neighbor (ANN) algorithm is used for rapid screening;

[0013] For a given query vector q, a set of hash functions are defined:

[0014] ;

[0015] in, a i is a random vector, b i is the random offset, w is the bucket width;

[0016] Combined into a Hash table of hash functions:

[0017] ;

[0018] Map the query vector to the hash table to get the hash bucket ID, and then extract the candidate vector set from the hash bucket;

[0019] The candidate vector set obtained from the rough screening stage is refined by using the exact nearest neighbor algorithm.

[0020] Use index-based data structures such as KD trees, ball trees, etc., or directly calculate the Euclidean distance;

[0021] Given a query vector q and the candidate vector set {v 1 ,v 2 ,…,v m } , calculate the Euclidean distance:

[0022] ;

[0023] Among them, q j is the element of the query vector q in the jth dimension; v ij is the candidate vector v i The element in the jth dimension; d is the dimension of the query vector; m is the number of candidate vectors;

[0024] Select the first K candidate vectors with the smallest distance as the final result:

[0025] ;

[0026] The optimization process of the query vector is as follows: First, perform query preprocessing, including cleaning, tokenization, and stop word removal. Then, generate the query vector. Finally, calculate the TF-IDF vector and BERT vector of the query and combine the query vectors;

[0027] Step S5: Based on the enhanced recall strategy, use domain-specific information and rules to re-rank the preliminary retrieval results to obtain the final retrieval results.

[0028] Furthermore, step S1 is specifically as follows:

[0029] Step S11: Obtain the original text and metadata through APIs, web crawlers, and database access;

[0030] Step S12: And perform preprocessing on the obtained original text and metadata, including removing noise, handling missing values and duplicate data, tokenization, stop word removal, and lemmatization;

[0031] Step S13: Load the professional dictionary of the power industry for tokenization and term standardization; for example, specific equipment names, technical terms, etc. in the power industry.

[0032] Step S14: Use a pre-trained NER model to identify and label entities in a specific domain. Such as equipment names, locations, time, and other information;

[0033] Furthermore, step S12 is specifically as follows:

[0034] Delete unnecessary characters through regular expressions, handle missing values using the forward filling method, and remove duplicate records;

[0035] Perform tokenization according to the dictionary and language rules, filter out meaningless words (such as "de", "he"), and perform word form merging;

[0036] Import power-related professional terms into the tokenization tool, and use power-related professional terms to perform detailed tokenization and term standardization on the text;

[0037] Use the SpaCy model to identify entities in the text. Such as equipment names, locations, time, etc.

[0038] Furthermore, step S2 is specifically as follows:

[0039] Calculate the TF-IDF value based on the Token sequence obtained from the text preprocessing and generate a sparse vector representation;

[0040] ;

[0041] Among them, is the TF-IDF value of the v-th word in the u-th document; is the frequency of the vth word in the uth document, is the inverse document frequency of the vth word, defined as:

[0042] ;

[0043] Where N is the total number of documents, is the number of documents containing word v;

[0044] The TF-IDF vector of the entire text is represented as TF-IDF(x):

[0045] ;

[0046] Where k is the dictionary size; TF-IDF weight of the i-th word in document x;

[0047] Use the pre-trained BERT model to embed the text and generate a dense vector representation. , is the output of the pre-trained BERT model, L is the total number of layers; each Token embedding is represented as:

[0048] ;

[0049] in, , , They are Token sequences respectively word embedding, sentence embedding and position embedding;

[0050] Combine the TF-IDF vector and the BERT embedding vector to form the final text vector representation:

[0051] .

[0052] Furthermore, the pre-trained BERT model includes a self-attention mechanism and a feed-forward neural network, as follows:

[0053] The self-attention mechanism of the BERT model:

[0054] ;

[0055] Where Q is the query matrix, K is the key matrix, and V is the value matrix; d k is the dimension of the key and value matrix; the superscript T indicates transposition; softmax is the activation function;

[0056] Use multiple attentions to focus on different information at the same time and then combine them:

[0057] ;

[0058] ;

[0059] in, Indicates Size; , , They are the query matrix, key matrix and value matrix The weight matrix corresponding to the head; is the output linear transformation weight matrix; is the output of multi-head attention;

[0060] The feedforward neural network performs the operation element-wise for each position:

[0061] ;

[0062] Among them, W1 is the weight matrix of the first linear transformation, and b1 is the bias vector of the first linear transformation;

[0063] W2 is the weight matrix of the second linear transformation; b2 is the bias vector of the second linear transformation; max(0,x) is the ReLU activation function;

[0064] Layer Normalization and Residual Connections:

[0065] ;

[0066] in, For the The output of the layer, LayerNorm is the layer normalization operation; It is the intermediate representation obtained by layer normalization after multi-head attention mechanism and residual connection in layer l; is the output of the feedforward neural network;

[0067] Final output:

[0068] ;

[0069] Where, L is the total number of layers; is the final output.

[0070] Furthermore, step S3 is specifically as follows: storing the original text and metadata in the relational database, and storing the generated vector data in NoSQL; establishing an association relationship between the relational database and the NoSQL database through a shared unique identifier (such as UUID); when inserting data, storing the text and vector data in the relational database and the NoSQL database respectively; when querying data, jointly querying in the two databases through the unique identifier.

[0071] Furthermore, the preliminary search results are re-ranked using domain-specific information and rules, as follows:

[0072] Using the electric power domain-specific dictionary, calculate the domain-specific dictionary word frequency and inverse document frequency in the document to obtain the first document score :

[0073] ;

[0074] in, is the word w in the document The word frequency in is the inverse document frequency of word w;

[0075] The second document score is obtained by calculating the contextual relationship between the document sentences (such as sentence vector similarity). :

[0076] ;

[0077] in, It is a document All pairs of sentences in and The sentences are and The vector representation of , sim is to calculate the similarity of the sentence vector;

[0078] Consider the user's click and stay time behavior data to obtain the user behavior data score :

[0079] ;

[0080] in, It is a document Number of clicks, Is the user in the document The dwell time on and is the weight parameter;

[0081] Re-rank the preliminary ranking results by combining all domain-specific information and rules:

[0082]

[0083] in, , and is the weight coefficient.

[0084] In another embodiment of the present invention, a text-vectorized power system vector knowledge base query system is provided, comprising a visual query terminal and a power system vector knowledge base; the power system vector knowledge base is constructed based on a text-vectorized power system vector knowledge base construction method as described above.

[0085] The present invention has the following beneficial effects:

[0086] 1. The present invention can effectively improve the efficiency of building and using the knowledge base of the power system, and comprehensively improve the accuracy of text representation through the combination of sparse and dense vectorization technologies. At the same time, the introduction of optimized query processing and result re-ranking mechanism makes the search results more in line with user needs, providing accurate, timely and comprehensive knowledge support for the intelligent management of the power system;

[0087] 2. The present invention combines the TF-IDF vector with the BERT embedding vector to form the final dense vector representation of the text, which can capture word frequency information using TF-IDF and deep semantic information using BERT, thereby enhancing the comprehensiveness and expressiveness of the text representation;

[0088] 3. When querying, the present invention adopts a multi-stage screening mechanism, first using the ANN algorithm for rapid initial screening, and then using the Exact Nearest Neighbor algorithm for fine screening, to ensure that the accuracy is improved while maintaining a high query speed, and use domain-specific information and rules to re-rank the preliminary search results to further improve the relevance and accuracy of the results. BRIEF DESCRIPTION OF THE DRAWINGS

[0089] Figure 1 The figure is a flow chart of the method of the present invention. DETAILED DESCRIPTION

[0090] The present invention is further described in detail below with reference to the accompanying drawings and specific embodiments:

[0091] refer to Figure 1 In this embodiment, a method for constructing a power system vector knowledge base based on text vectorization is provided, comprising the following steps:

[0092] Step S1: Obtain the original text and metadata of the data related to the construction of the power system vector knowledge base, and pre-process it;

[0093] Step S2: Text vectorization is performed by combining sparse vectors (TF-IDF) and dense vectors (BERT embeddings);

[0094] Step S3: storing the original text and metadata in a relational database, storing the vector data in a NoSQL vector database, and building an association relationship;

[0095] Step S4: When the user enters a query, the query vector is optimized, the query algorithm and query process are improved, a multi-stage screening mechanism is introduced, and preliminary search results are obtained;

[0096] The multi-stage screening mechanism is introduced as follows:

[0097] First, the approximate nearest neighbor (ANN) algorithm is used for rapid screening;

[0098] For a given query vector q, a set of hash functions are defined:

[0099] ;

[0100] in, a i is a random vector, b i is the random offset, w is the bucket width;

[0101] Combined into a Hash table of hash functions:

[0102] ;

[0103] Map the query vector to the hash table to get the hash bucket ID, and then extract the candidate vector set from the hash bucket;

[0104] The candidate vector set obtained from the rough screening stage is refined by using the exact nearest neighbor algorithm.

[0105] Use index-based data structures such as KD trees, ball trees, etc., or directly calculate the Euclidean distance;

[0106] Given a query vector q and the candidate vector set {v 1 ,v 2 ,…,v m } , calculate the Euclidean distance:

[0107] ;

[0108] Among them, q j is the element of the query vector q in the jth dimension; v ij is the candidate vector v iThe element in the j-th dimension; d is the dimension of the query vector; m is the number of candidate vectors;

[0109] Select the top K candidate vectors with the smallest distance as the final result:

[0110] ;

[0111] The optimization process of the query vector is as follows: First, perform query preprocessing, including cleaning, tokenization, and stop word removal, then generate the query vector, and finally calculate the TF-IDF vector and BERT vector of the query and combine the query vector;

[0112] Step S5: Based on the enhanced recall strategy, use domain-specific information and rules to re-rank the preliminary retrieval results to obtain the final retrieval results.

[0113] In this embodiment, step S1 is specifically as follows:

[0114] Step S11: Obtain the original text and metadata through API, crawler, and database access;

[0115] Step S12: And preprocess the obtained original text and metadata, including removing noise, handling missing values and duplicate data, performing tokenization, stop word removal, and lemmatization;

[0116] Step S13: Load the professional dictionary of the power industry and perform tokenization and term standardization; for example, specific equipment names, technical terms, etc. in power.

[0117] Step S14: Use a pre-trained NER model to identify and label entities in a specific domain. Such as information on equipment names, locations, times, etc.;

[0118] In this embodiment, step S12 is specifically as follows:

[0119] Delete unnecessary characters through regular expressions, handle missing values using the forward filling method, and remove duplicate records;

[0120] Perform tokenization according to the dictionary and language rules, filter out meaningless words (such as "de", "he"), and perform lemmatization;

[0121] Import power-related professional terms into the tokenization tool and use power-related professional terms to perform detailed tokenization and term standardization on the text;

[0122] Use the SpaCy model to identify entities in the text. Such as equipment names, locations, times, etc.

[0123] In this embodiment, step S2 is specifically as follows:

[0124] Based on the token sequence obtained by text preprocessing, the TF-IDF value is calculated to generate a sparse vector representation;

[0125] ;

[0126] in, is the TF-IDF value of the vth word in the uth document; is the frequency of the vth word in the uth document, is the inverse document frequency of the vth word, defined as:

[0127] ;

[0128] Where N is the total number of documents, is the number of documents containing word v;

[0129] The TF-IDF vector of the entire text is represented as TF-IDF(x):

[0130] ;

[0131] Where k is the dictionary size; TF-IDF weight of the i-th word in document x;

[0132] Use the pre-trained BERT model to embed the text and generate a dense vector representation. , is the output of the pre-trained BERT model, L is the total number of layers; each Token embedding is represented as:

[0133] ;

[0134] in, , , They are Token sequences respectively word embedding, sentence embedding and position embedding;

[0135] Combine the TF-IDF vector and the BERT embedding vector to form the final text vector representation:

[0136] .

[0137] In this embodiment, the pre-trained BERT model includes a self-attention mechanism and a feedforward neural network, as follows:

[0138] The self-attention mechanism of the BERT model:

[0139] ;

[0140] Where Q is the query matrix, K is the key matrix, and V is the value matrix; d k is the dimension of the key and value matrix; the superscript T indicates transposition; softmax is the activation function;

[0141] Use multiple attentions to focus on different information at the same time and then combine them:

[0142] ;

[0143] ;

[0144] in, Indicates Size; , , They are the query matrix, key matrix and value matrix The weight matrix corresponding to the head; is the output linear transformation weight matrix; is the output of multi-head attention;

[0145] The feedforward neural network performs the operation element-wise for each position:

[0146] ;

[0147] Among them, W1 is the weight matrix of the first linear transformation, and b1 is the bias vector of the first linear transformation;

[0148] W2 is the weight matrix of the second linear transformation; b2 is the bias vector of the second linear transformation; max(0,x) is the ReLU activation function;

[0149] Layer Normalization and Residual Connections:

[0150] ;

[0151] in, For the The output of the layer, LayerNorm is the layer normalization operation; It is the intermediate representation obtained by layer normalization after multi-head attention mechanism and residual connection in layer l; is the output of the feedforward neural network;

[0152] Final output:

[0153] ;

[0154] Where, L is the total number of layers; is the final output.

[0155] In this embodiment, step S3 is specifically as follows: storing the original text and metadata in a relational database, and storing the generated vector data in NoSQL; establishing an association relationship between the relational database and the NoSQL database through a shared unique identifier (such as UUID); when inserting data, storing the text and vector data in the relational database and the NoSQL database respectively; when querying data, jointly querying in the two databases through the unique identifier.

[0156] In this embodiment, the preliminary search results are re-ranked using domain-specific information and rules, as follows:

[0157] Using the electric power domain-specific dictionary, calculate the domain-specific dictionary word frequency and inverse document frequency in the document to obtain the first document score :

[0158] ;

[0159] in, is the word w in the document The word frequency in is the inverse document frequency of word w;

[0160] The second document score is obtained by calculating the contextual relationship between the document sentences (such as sentence vector similarity). :

[0161] ;

[0162] in, It is a document All pairs of sentences in and The sentences are and The vector representation of , sim is to calculate the similarity of the sentence vector;

[0163] Consider the user's click and stay time behavior data to obtain the user behavior data score :

[0164] ;

[0165] in, It is a document Number of clicks, Is the user in the document The dwell time on and is the weight parameter;

[0166] Re-rank the preliminary ranking results by combining all domain-specific information and rules:

[0167]

[0168] in, , and is the weight coefficient.

[0169] In another embodiment of the present invention, a text-vectorized power system vector knowledge base query system is provided, comprising a visual query terminal and a power system vector knowledge base; the power system vector knowledge base is constructed based on a text-vectorized power system vector knowledge base construction method as described above.

[0170] It will be appreciated by those skilled in the art that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Furthermore, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0171] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0172] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0173] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0174] The above is only a preferred embodiment of the present invention, and does not limit the present invention in other forms. Any technician familiar with the profession may use the above disclosed technical content to change or modify it into an equivalent embodiment with equivalent changes. However, any simple modification, equivalent change and modification made to the above embodiment according to the technical essence of the present invention without departing from the technical solution of the present invention still belongs to the protection scope of the technical solution of the present invention.

Claims

1. A method for constructing a power system vector knowledge base based on text vectorization, characterized in that: The following steps are involved: Step S1: Obtain the original text and metadata of the data related to the construction of the power system vector knowledge base, and pre-process it; Step S2: vectorize the text by combining sparse vectors and dense vectors; Step S2 is specifically as follows: Based on the token sequence obtained by text preprocessing, the TF-IDF value is calculated to generate a sparse vector representation; ; in, is the TF-IDF value of the vth word in the uth document; is the frequency of the vth word in the uth document, is the inverse document frequency of the vth word, defined as: ; Where N is the total number of documents, is the number of documents containing word v; The TF-IDF vector of the entire text is represented as TF-IDF(x): ; in TF-IDF weight of the i-th word in document x; Use the pre-trained BERT model to embed the text and generate a dense vector representation. , is the output of the pre-trained BERT model, L is the total number of layers; each Token embedding is represented as: ; in, , , They are Token sequences respectively word embedding, sentence embedding and position embedding; Combine the TF-IDF vector and the BERT embedding vector to form the final text vector representation: ; The pre-trained BERT model includes a self-attention mechanism and a feed-forward neural network, as follows: The self-attention mechanism of the BERT model: ; Where Q is the query matrix, K is the key matrix, and V is the value matrix; d k is the dimension of the key and value matrix; the superscript T indicates transposition; softmax is the activation function; Use multiple attentions to focus on different information at the same time and then combine them: ; ; in, Indicates Size; , , They are the query matrix, key matrix and value matrix The weight matrix corresponding to the head; is the output linear transformation weight matrix; is the output of multi-head attention; The feedforward neural network performs the operation element-wise for each position: ; Among them, W1 is the weight matrix of the first linear transformation, and b1 is the bias vector of the first linear transformation; W2 is the weight matrix of the second linear transformation; b2 is the bias vector of the second linear transformation; max (,) is the ReLU activation function; Layer Normalization and Residual Connections: ; in, For the The output of the layer, LayerNorm is the layer normalization operation; It is the intermediate representation obtained by layer normalization after multi-head attention mechanism and residual connection in layer l; is the output of the feedforward neural network; Final output: ; Where, L is the total number of layers; is the final output; Step S3: storing the original text and metadata in a relational database, storing the vector data in a NoSQL vector database, and building an association relationship; Step S4: When the user enters a query, the query vector is optimized, the query algorithm and query process are improved, a multi-stage screening mechanism is introduced, and preliminary search results are obtained; The multi-stage screening mechanism is introduced as follows: First, use the approximate nearest neighbor algorithm for fast screening; For a given query vector q, a set of hash functions are defined: ; in, is a random vector, is the random offset, w is the bucket width; Combined into a Hash table of hash functions: ; Map the query vector to the hash table to get the hash bucket ID, and then extract the candidate vector set from the hash bucket; The candidate vector set obtained from the rough screening stage is refined by using the exact nearest neighbor algorithm. Use index-based data structures, including KD trees, ball trees, or directly calculate Euclidean distances; Given a query vector q and the candidate vector set {v 1 ,v 2 ,…,v m } , calculate the Euclidean distance: ; Among them, q b is the element of the query vector q in the bth dimension; v ab is the candidate vector v a The element in the bth dimension; d is the dimension of the query vector; m is the number of candidate vectors; Select the first K candidate vectors with the smallest distance as the final result: ; The query vector is optimized as follows: first, query preprocessing is performed, including cleaning, word segmentation, and stop word removal, then a query vector is generated, and finally the TF-IDF vector and BERT vector of the query are calculated, and the query vector is combined; Step S5: Based on the enhanced recall strategy, the preliminary search results are re-ranked using domain-specific information and rules to obtain the final search results.

2. The method for constructing a power system vector knowledge base based on text vectorization according to claim 1 is characterized in that: The step S1 is specifically as follows: Step S11: Obtaining original text and metadata through API, crawler and database access; Step S12: preprocessing the obtained original text and metadata, including removing noise, processing missing values ​​and duplicate data, performing word segmentation, removing stop words and restoring morphology; Step S13: Load the professional dictionary of the power industry, perform word segmentation and terminology standardization; Step S14: Use the pre-trained NER model to identify and label entities in a specific domain.

3. The method for constructing a power system vector knowledge base based on text vectorization according to claim 2 is characterized in that: The step S12 is specifically as follows: Delete unnecessary characters through regular expressions, handle missing values using forward filling method, and remove duplicate records; Segment words according to the dictionary and language rules, filter out meaningless words, and perform word form merging; The meaningless words include "的" and "和"; Import power-related professional terms into the word segmentation tool, and use power-related professional terms to perform detailed word segmentation and term standardization on the text; Use the SpaCy model to identify entities in the text, including device names, locations, and times.

4. The method for constructing a power system vector knowledge base based on text vectorization according to claim 1 is characterized in that: The specific steps of step S3 are as follows: store the original text and metadata in a relational database, and store the generated vector data in NoSQL; establish an association relationship between the relational database and the NoSQL database through a shared unique identifier; when inserting data, store the text and vector data in the relational database and the NoSQL database respectively; when querying data, perform a combined query in the two databases through the unique identifier.

5. The method for constructing a power system vector knowledge base based on text vectorization according to claim 1 is characterized in that: The use of domain-specific information and rules to reorder the preliminary retrieval results is as follows: Using the electric power field-specific dictionary, calculate the field-specific dictionary word frequency and inverse document frequency in the document to obtain the first document score : ; in, Yes word In the documentation The word frequency in Yes word The inverse document frequency of The second document score is obtained by calculating the contextual relationship between the document sentences. : ; in, It is a document All pairs of sentences in and The sentences are and The vector representation of , sim is to calculate the similarity of the sentence vector; Consider the user's click and stay time behavior data to obtain the user behavior data score : ; in, It is a document Number of clicks, Is the user in the document The dwell time on and is the weight parameter; Combine all domain-specific information and rules to reorder the preliminary sorting results: in, , and is the weight coefficient.

Citation Information

Patent Citations

  • Prompt recommendation method and module

    CN117371457A

  • Target retrieval method and device, electronic equipment and storage medium

    CN117951359A