Transformer substation flood prevention case text matching method and device

By constructing and preprocessing the target text pairs and using the combination of ALBERT, BiLSTM and LightGBM models, the problem of poor text matching effect in substation flood prevention cases is solved, achieving more efficient and accurate text matching.

CN119621932APending Publication Date: 2025-03-14WUHAN UNIV OF TECH +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411674434.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-21
Publication Date
2025-03-14

AI Technical Summary

Technical Problem

The prior art is difficult to effectively match the substation flood prevention case text, resulting in poor text matching effect.

Method used

By constructing target text pairs, preprocessing, including word segmentation, stop word deletion and non-stop word data augmentation, and using a text matching model based on the ALBERT model, combining BiLSTM and LightGBM models, semantic features and character-level features are extracted and fused to determine text similarity and matching results.

Benefits of technology

It improves the accuracy and efficiency of text matching in flood prevention cases in substations, and can better capture the nonlinear relationships and character-level similarity characteristics between texts.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119621932A_ABST
    Figure CN119621932A_ABST
Patent Text Reader

Abstract

The invention relates to a transformer substation flood prevention case text matching method and device, and belongs to the technical field of natural language process.The transformer substation flood prevention case text matching method comprises the steps that a target text pair is constructed based on a target flood prevention text and a flood prevention case text to be matched, the flood prevention text to be matched is any flood prevention case text in a flood prevention case text library; preprocessing the target text pair, taking the preprocessed target text pair as input of a text matching model, and determining a text similarity and a matching result between the target flood prevention text and the flood prevention case text to be matched based on the text matching model; wherein the text matching model is obtained by training a flood prevention case text pair based on a manual annotation matching result. According to the method, the accuracy and the efficiency of text matching are improved while flood prevention case text matching is realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of natural language processing, and in particular to a method and device for matching text of flood prevention cases in a substation. Background Art

[0002] Frequent extreme rainstorms have always posed a serious threat to the continued stable operation of substations. Flood prevention case texts are important materials for describing and analyzing the natural disaster prevention process. Through in-depth analysis and matching of rich historical cases and current situations by text matching methods, operation and maintenance managers can quickly obtain reference cases and formulate effective flood prevention strategies to maintain the stable operation of substations.

[0003] Flood prevention case texts usually describe in detail disaster events such as floods and rainstorms that occurred in specific areas, including the background of the disaster, the scope of impact, and the response measures. At the same time, they often contain a large amount of geographical, meteorological, and hydrological data, such as precipitation, water level changes, dam conditions, and other professional content, as well as technical descriptions related to disaster management.

[0004] The text data of substation flood prevention cases are very complex in sentence length, grammatical structure and logical reasoning, which makes it extremely difficult for existing methods to fully consider the text character-level similarity features and capture the nonlinear relationship between features. In addition, due to manual recording, the subjective opinions or personal understanding of the recorder will lead to different expressions of the same problem, which greatly affects the text matching effect. Summary of the invention

[0005] In view of this, it is necessary to provide a substation flood prevention case text matching method and device to solve the problem of poor text matching effect of the current substation flood prevention case text matching scheme.

[0006] In order to solve the above problems, the present invention provides a substation flood prevention case text matching method, comprising: Constructing a target text pair based on the target flood prevention text and the flood prevention case text to be matched, wherein the flood prevention text to be matched is any flood prevention case text in the flood prevention case text library; Preprocessing the target text pair, and using the preprocessed target text pair as input of a text matching model, and determining the text similarity and matching result between the target flood prevention text and the to-be-matched flood prevention case text based on the text matching model; The text matching model is obtained by training flood prevention case text pairs based on manually annotated matching results.

[0007] In a possible implementation, the preprocessing of the target text pair includes: The target text pair is segmented, stop word deleted, and non-stop word data augmented.

[0008] In a possible implementation, the performing non-stop word data augmentation on the target text includes: The target text is subjected to synonym replacement, random word deletion, random word exchange and random synonym insertion processing.

[0009] In a possible implementation, determining the text similarity and matching result between the target flood prevention text and the to-be-matched flood prevention case text based on the text matching model includes: Determine semantic features and character-level features of the target flood prevention text and the to-be-matched flood prevention case text based on the text matching model; Performing feature fusion on the semantic features and character-level features of the target flood prevention text and the to-be-matched flood prevention case text to obtain similarity features between the target flood prevention text and the to-be-matched flood prevention case text; The text similarity and matching result between the target flood prevention text and the flood prevention case text to be matched are determined based on the similarity characteristics between the target flood prevention text and the flood prevention case text to be matched.

[0010] In a possible implementation, the semantic features of the target flood control text and the flood control case text to be matched are extracted based on the ALBERT model, and the character-level features of the target flood control text and the flood control case text to be matched are extracted based on a character-level feature extraction model, and the ALBERT model and the character-level feature extraction model are sub-models within the text matching model.

[0011] In a possible implementation, the step of fusing the semantic features and character-level features of the target flood prevention text and the to-be-matched flood prevention case text includes: The semantic features and character-level features of the target flood prevention text and the flood prevention case text to be matched are fused based on the BiLSTM model, and the BiLSTM model is a sub-model within the text matching model.

[0012] In a possible implementation, the determining the text similarity and matching result between the target flood prevention text and the flood prevention case text to be matched based on the similarity features between the target flood prevention text and the flood prevention case text to be matched includes: Determine the text similarity between the target flood prevention text and the flood prevention case text to be matched based on the similarity characteristics of the target flood prevention text and the flood prevention case text to be matched and the LightGBM model, wherein the LightGBM model is a sub-model within the text matching model; In the case where the text similarity between the target flood prevention text and the to-be-matched flood prevention case text is greater than a similarity threshold, determining that the target flood prevention text matches the to-be-matched flood prevention case text; When the text similarity between the target flood prevention text and the flood prevention case text to be matched is less than or equal to a similarity threshold, it is determined that the target flood prevention text and the flood prevention case text to be matched do not match.

[0013] The present invention also provides a substation flood prevention case text matching device, comprising: A construction module, used to construct a target text pair based on a target flood control text and a flood control case text to be matched, wherein the flood control text to be matched is any flood control case text in a flood control case text library; A determination module, used to preprocess the target text pair, and use the preprocessed target text pair as an input of a text matching model, and determine the text similarity and matching result between the target flood prevention text and the flood prevention case text to be matched based on the text matching model; The text matching model is obtained by training flood prevention case text pairs based on manually annotated matching results.

[0014] The present invention also provides an electronic device, including a memory and a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, the substation flood prevention case text matching method as described above is implemented.

[0015] The present invention also provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the substation flood prevention case text matching method as described above is implemented.

[0016] The beneficial effects of the present invention are as follows: the substation flood control case text matching method and device provided by the present invention first construct the target flood control text and the flood control case text to be matched as a target text pair, so that the similarity feature between the target flood control text and the flood control case text to be matched is easier to be extracted, and then the target text pair is preprocessed to avoid semantic deviation during feature extraction, and then the preprocessed target text pair is used as the input of the text matching model, and the text similarity and matching result between the target flood control text and the flood control case text to be matched are determined by the text matching model, thereby achieving the matching of the target flood control text and the flood control case text. While achieving flood control case text matching, the present invention improves the accuracy and efficiency of text matching. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] Figure 1 A schematic diagram of a flow chart of an embodiment of a method for matching texts of flood prevention cases in substations provided by the present invention; Figure 2 A schematic diagram of a flow chart of an embodiment of a text matching process for a substation flood prevention case provided by the present invention; Figure 3 A schematic diagram of a flow chart of an embodiment of a text feature processing flow for a substation flood prevention case provided by the present invention; Figure 4 A schematic diagram of the structure of an embodiment of a text matching device for flood prevention cases in substations provided by the present invention; Figure 5 A schematic structural diagram of an electronic device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0018] The preferred embodiments of the present invention are described in detail below in conjunction with the accompanying drawings, wherein the accompanying drawings constitute a part of this application and are used together with the embodiments of the present invention to illustrate the principles of the present invention, but are not used to limit the scope of the present invention.

[0019] In the description of the present invention, the terms "first" and "second" are used for descriptive purposes only and cannot be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In addition, the meaning of "plurality" is at least two, such as two, three, etc., unless otherwise clearly and specifically defined.

[0020] In the description of the present invention, reference to an "embodiment" means that a particular feature, structure, or characteristic described in conjunction with the embodiment may be included in at least one embodiment of the present invention. The appearance of the phrase in various places in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive of other embodiments. It is explicitly and implicitly understood by those skilled in the art that the described embodiments may be combined with other embodiments.

[0021] Frequent extreme rainstorms have always posed a serious threat to the continued stable operation of substations. Flood prevention case texts are important materials for describing and analyzing the natural disaster prevention process. Through in-depth analysis and matching of rich historical cases and current situations by text matching methods, operation and maintenance managers can quickly obtain reference cases and formulate effective flood prevention strategies to maintain the stable operation of substations.

[0022] Flood prevention case texts usually describe in detail disaster events such as floods and rainstorms that occurred in specific areas, including the background of the disaster, the scope of impact, and the response measures. At the same time, they often contain a large amount of geographical, meteorological, and hydrological data, such as precipitation, water level changes, dam conditions, and other professional content, as well as technical descriptions related to disaster management.

[0023] The text data of substation flood prevention cases are very complex in sentence length, grammatical structure and logical reasoning, which makes it extremely difficult for existing methods to fully consider the text character-level similarity features and capture the nonlinear relationship between features. In addition, due to manual recording, the subjective opinions or personal understanding of the recorder will lead to different expressions of the same problem, which greatly affects the text matching effect.

[0024] In order to solve the above problems, the present invention provides a substation flood prevention case text matching method.

[0025] The specific embodiments are described in detail below: A specific embodiment of the present invention discloses a substation flood prevention case text matching method, combined with Figure 1 Come and see, Figure 1 The flowchart of an embodiment of a method for matching text of substation flood prevention cases provided by the present invention includes step S101 and step S102, wherein: In step S101, a target text pair is constructed based on a target flood control text and a flood control case text to be matched, wherein the flood control text to be matched is any flood control case text in a flood control case text library; In step S102, the target text pair is preprocessed, and the preprocessed target text pair is used as an input of a text matching model, and the text similarity and matching result between the target flood prevention text and the to-be-matched flood prevention case text are determined based on the text matching model; The text matching model is obtained by training flood prevention case text pairs based on manually annotated matching results.

[0026] During implementation, the target flood control text can first be matched with the flood control case texts in the flood control case text library one by one to construct multiple target text pairs.

[0027] After constructing multiple target text pairs, the target text pairs can be preprocessed first to avoid semantic deviation during feature extraction, and then the preprocessed target text pairs are used as inputs to the text matching model. The text matching model is used to determine the text similarity and matching results between the target flood control text and the flood control case text to be matched, thereby matching the target flood control text with the flood control case text. In addition, the text matching model can be trained by manually annotating the flood control case text pairs with matching results. The specific training form is a conventional supervised training process, which will not be described in detail here.

[0028] The substation flood prevention case text matching method provided by the present invention can be applied to substation flood prevention case text matching scenarios, and can also be applied to case text matching in other emergency scenarios, and the present invention does not make specific limitations on this.

[0029] Compared with the prior art, the substation flood control case text matching method provided in this embodiment first constructs the target flood control text and the flood control case text to be matched into a target text pair, so that the similarity feature between the target flood control text and the flood control case text to be matched is easier to extract, and then the target text pair is preprocessed to avoid semantic deviation during feature extraction, and then the preprocessed target text pair is used as the input of the text matching model, and the text similarity and matching result between the target flood control text and the flood control case text to be matched are determined by the text matching model, thereby achieving matching between the target flood control text and the flood control case text. While achieving flood control case text matching, the present invention improves the accuracy and efficiency of text matching.

[0030] Exemplarily, the preprocessing of the target text pair includes: The target text pair is segmented, stop word deleted, and non-stop word data augmented.

[0031] Specifically, when preprocessing the target text pair, operations such as word segmentation, stop word deletion, and non-stop word data augmentation may be performed on the target text pair in sequence.

[0032] When performing word segmentation, the Jieba word segmentation tool can be used for word segmentation. At the same time, the Jieba original word segmentation library can be supplemented according to the proprietary word library of flood control case texts to improve the word segmentation effect.

[0033] At the same time, when deleting stop words, the existing stop word library can also be adjusted according to the actual situation in the flood prevention case text, retaining some words with special meanings, and adding meaningless words in the case text to the stop word library to improve the efficiency of subsequent feature extraction.

[0034] Exemplarily, the performing non-stop word data augmentation on the target text includes: The target text is subjected to synonym replacement, random word deletion, random word exchange and random synonym insertion processing.

[0035] Specifically, when performing non-stop word data augmentation on the target text, non-stop word data augmentation can be achieved through synonym replacement, random word deletion, random word exchange, and random synonym insertion.

[0036] For example, when performing synonym replacement, you can randomly select a specified number of non-stop words in the original text, and then randomly replace the selected word with any of its synonyms. When performing random word deletion, you can randomly delete each word from the original text with a specified probability. When performing random word swapping, you can randomly select two words in the original text and swap their positions in the text, repeating the above operation a specified number of times. When performing random synonym insertion, you can randomly select a word from the text and randomly insert any of its synonyms into any position in the text, repeating the above operation a specified number of times.

[0037] Through the above-mentioned operation of augmenting the non-stop word data, the text semantics can be increased to avoid semantic deviation during feature extraction.

[0038] Exemplarily, determining the text similarity and matching result between the target flood prevention text and the to-be-matched flood prevention case text based on the text matching model includes: Determine semantic features and character-level features of the target flood prevention text and the to-be-matched flood prevention case text based on the text matching model; Performing feature fusion on the semantic features and character-level features of the target flood prevention text and the to-be-matched flood prevention case text to obtain similarity features between the target flood prevention text and the to-be-matched flood prevention case text; The text similarity and matching result between the target flood prevention text and the flood prevention case text to be matched are determined based on the similarity characteristics between the target flood prevention text and the flood prevention case text to be matched.

[0039] Specifically, when determining the text similarity and matching results between the target flood control text and the flood control case text to be matched according to the text matching model, the semantic features and character-level features of the target flood control text and the flood control case text to be matched can be first determined according to the text matching model, and then the semantic features and character-level features of the target flood control text and the flood control case text to be matched are feature fused to obtain the similarity features of the target flood control text and the flood control case text to be matched, and finally, the text similarity and matching results between the target flood control text and the flood control case text to be matched are determined according to the similarity features of the target flood control text and the flood control case text to be matched.

[0040] The accuracy of text matching can be improved by extracting the semantic features and character-level features of the target flood control text and the flood control case text to be matched and performing feature fusion.

[0041] Exemplarily, the semantic features of the target flood prevention text and the flood prevention case text to be matched are extracted based on the ALBERT model, and the character-level features of the target flood prevention text and the flood prevention case text to be matched are extracted based on the character-level feature extraction model. The ALBERT model and the character-level feature extraction model are sub-models within the text matching model.

[0042] Specifically, the text matching model may include an ALBERT model and a character-level feature extraction model. The ALBERT model can be used to extract semantic features of the target flood control text and the flood control case text to be matched, and the character-level feature extraction model can be used to extract character-level features of the target flood control text and the flood control case text to be matched (for example, the character-level features of the two texts can be extracted by calculating the Levenshtein ratio, Jarrow distance and Jarrow-Winkler distance between the two texts).

[0043] Exemplarily, the step of fusing the semantic features and character-level features of the target flood prevention text and the to-be-matched flood prevention case text includes: The semantic features and character-level features of the target flood prevention text and the flood prevention case text to be matched are fused based on the BiLSTM model, and the BiLSTM model is a sub-model within the text matching model.

[0044] Specifically, when performing feature fusion, the BiLSTM model inside the text matching model can be used to fuse the semantic features and character-level features of the target flood control text with the flood control case text to be matched. The BiLSTM model can not only retain the sequential information of the text, but also integrate features at different levels, thereby improving the performance of the model for text matching tasks.

[0045] Exemplarily, the determining the text similarity and matching result between the target flood prevention text and the flood prevention case text to be matched based on the similarity features between the target flood prevention text and the flood prevention case text to be matched includes: Determine the text similarity between the target flood prevention text and the flood prevention case text to be matched based on the similarity characteristics of the target flood prevention text and the flood prevention case text to be matched and the LightGBM model, wherein the LightGBM model is a sub-model within the text matching model; In the case where the text similarity between the target flood prevention text and the to-be-matched flood prevention case text is greater than a similarity threshold, determining that the target flood prevention text matches the to-be-matched flood prevention case text; When the text similarity between the target flood prevention text and the flood prevention case text to be matched is less than or equal to a similarity threshold, it is determined that the target flood prevention text and the flood prevention case text to be matched do not match.

[0046] Specifically, when determining the text similarity and matching results between the target flood control text and the flood control case text to be matched based on the similarity features of the target flood control text and the flood control case text to be matched, the LightGBM model can be used to replace the original output layer of ALBERT to realize interactive feature extraction, enhance the model's ability to understand the correlation between sentences, and conduct in-depth analysis and matching of historical cases and current situations, thereby obtaining the text similarity between the target flood control text and the flood control case text to be matched.

[0047] When the text similarity between the target flood prevention text and the flood prevention case text to be matched is greater than the similarity threshold, it can be determined that the target flood prevention text and the flood prevention case text to be matched are matched; when the text similarity between the target flood prevention text and the flood prevention case text to be matched is less than or equal to the similarity threshold, it can be determined that the target flood prevention text and the flood prevention case text to be matched are not matched. The determination of the matching result between the target flood prevention text and the flood prevention case text to be matched is completed in the LightGBM model.

[0048] The following is a specific application scenario to better illustrate the technical solution of the present invention: The semantics of the substation flood control case text is complex, involving a large number of professional terms and details, which makes it very difficult to process and analyze these texts. In view of the semantic changes that occur in the data augmentation of the flood control case text, and the problem that the ALBERT model cannot fully consider the text character-level similarity features and it is difficult to fully consider the correlation between the features of the two texts, the present invention proposes an improved strategy for case text matching based on ALBERT, through a data augmentation strategy based on semantic protection, to increase the case text without destroying the text semantics; then, BiLSTM is used to capture the sequence relationship and context information between the two text character levels, and enhance the model's ability to identify the similarity between the two texts. In view of the fact that the output of ALBERT cannot accurately capture the nonlinear relationship between the two text sentences, LightGBM is used to replace the original output layer of ALBERT to realize interactive feature extraction, and enhance the model's ability to understand the correlation between sentences. The method proposed in the present invention can improve the accuracy of flood control case text matching, thereby effectively improving the efficiency of substation flood control decision-making, helping to timely warn and optimize resource scheduling, thereby reducing the losses caused by disasters.

[0049] Combination Figure 2 Come and see, Figure 2 This is a flow chart of an embodiment of a text matching process for a substation flood prevention case provided by the present invention, and the specific steps are as follows: 1. Perform data preprocessing.

[0050] (1) 5,000 case text pairs were randomly selected from the historical flood control case text library for annotation for text matching experiments, and divided into training set, test set and validation set according to the ratio of 7:2:1. Each text pair contains two substation flood control case texts. If the two cases are similar, the pair is marked as 1, otherwise it is marked as 0.

[0051] (2) Aiming at the problem that professional vocabulary is difficult to accurately segment, Jieba is selected as the word segmentation tool for substation flood prevention case text preprocessing. Considering that there are a large number of domain-specific words in the substation flood prevention case text, it is difficult to effectively identify and distinguish such words using only the Jieba word segmentation tool. The present invention also expands the original Jieba word segmentation library and builds a case text-specific word library to assist in word segmentation.

[0052] (3) In order to solve the problem of a large number of stop words in the text, we selected the stop word list of Harbin Institute of Technology as the basic stop word list, and deleted some words in the stop word list that have special uses for subsequent research or have special meanings in the case text. At the same time, we manually counted the meaningless words in the case text and added them to the word list to further improve the basic stop word list.

[0053] (4) Data augmentation: a. Synonym replacement: randomly select a specified number of non-stop words in the original text, and then randomly replace the selected words with any of their synonyms to obtain a new text. b. Random deletion: randomly delete each word from the original text with a specified probability to obtain a new text. c. Random exchange based on semantic protection: randomly select two words in the original text and exchange their positions in the text, repeat the above operation a specified number of times, and obtain a new text. d. Random insertion: randomly select a word from the text, and randomly insert any of its synonyms into any position in the text, repeat the above operation a specified number of times, and obtain a new text.

[0054] 2. ALBERT-BiLSTM-LGB text matching and experimental parameter design integrating two improvement strategies.

[0055] The model parameter settings in the text matching experiment are shown in Table 1.

[0056] Table 1: Text matching experimental model parameter settings

[0057] Combination Figure 3 Come and see, Figure 3 This is a flow chart of an embodiment of a text feature processing flow of a substation flood prevention case provided by the present invention. The specific feature processing steps include: (1) ALBERT extracts semantic features: The original data is augmented using an improved algorithm called easy data augmentation (EDA). The ALBERT model is then used to extract the semantic features of the text. These features contain rich language context information and can capture the context and sentence structure.

[0058] (2) Character-level similarity feature extraction: The character-level similarity features of the two texts are obtained by calculating the Levenshtein Ratio (LR), Jaro Distance (JD) and Jaro-Winkler Distance (JWD) of the two texts, thereby obtaining a character-level similarity feature vector.

[0059] For the two texts A and B in the case text pair, their lengths are recorded as and , the formula for calculating the Levenshtein ratio is

[0060] In the formula, is the edit distance between strings A and B, which represents the minimum number of edit operations required to convert string A to string B, including inserting, deleting, and replacing characters.

[0061] The calculation formula of Jarrow distance is:

[0062] Where m is the number of characters matched and t is the number of character conversions.

[0063] The calculation formula of Jarrow-Winkler distance is:

[0064] In the formula, is the common prefix length of the two strings, is the adjustment factor.

[0065] (3) BiLSTM captures the relationship between two texts and performs feature fusion: extracts the character-level similarity features of the augmented text and uses the ALBERT model to extract the semantic features of the text, and then uses BiLSTM to perform feature fusion; BiLSTM can not only retain the sequential information of the text, but also integrate features at different levels, thereby improving the model's performance on text matching tasks.

[0066] (4) LightGBM prediction output: The final generated text feature vector is used as the input of LightGBM to replace the original output layer of ALBERT to obtain the predicted text matching result.

[0067] 3. ALBERT-BiLSTM-LGB text matching integrating two strategies: BiLSTM is used to capture the sequence relationship and contextual information between the two text characters; at the same time, LightGBM is used to replace the original output layer of ALBERT to realize interactive feature extraction, enhance the model's ability to understand the correlation between sentences, and conduct in-depth analysis and matching of rich historical cases and current situations, which can assist operation and maintenance managers to quickly obtain reference cases and formulate effective flood prevention strategies to maintain stable operation of substations.

[0068] The present invention also conducts comparative verification on the effect of the model, and the specific verification process is as follows: 1. Improve strategy effectiveness verification.

[0069] (1) Verification of the effectiveness of feature fusion strategy.

[0070] The BiLSTM feature fusion layer uses BiLSTM to receive feature vectors containing semantic information of two texts, further captures the sequence relationship and contextual information between the two texts, and concatenates the output vector of BiLSTM and the character-level similarity feature vector and passes it to the output layer, which predicts whether the two texts match. Its impact on the ALBERT algorithm is shown in Table 2: Table 2: Comparison of the effects before and after the introduction of the BiLSTM-based feature fusion strategy

[0071] ALBERT+BiLSTM's P, R, and F1 are improved by 3.44%, 3.64%, and 3.55% respectively, which is better than ALBERT. The results show that this strategy can better consider the similarity characteristics of case characters and improve the accuracy of text matching.

[0072] (2) Interactive feature extraction strategy based on LightGBM.

[0073] LightGBM adopts two efficiency-enhancing strategies: unilateral sampling and mutually exclusive feature bundling. The former uses the fact that small gradient samples contribute less to the training model, randomly samples such samples, and retains large gradient samples, thereby reducing the required computing resources while ensuring model performance; the latter bundles feature vectors with low correlation and treats them as a single feature, thereby reducing the total number of features that the decision tree needs to consider during the splitting process, thereby improving model training efficiency.

[0074] The indicators of ALBERT and ALBERT+LightGBM are compared, and their evaluation indicators are shown in Table 3: Table 3: Comparison of the effects before and after the introduction of the interactive feature extraction strategy based on LightGBM

[0075] The precision, recall and F1 value of ALBERT+LightGBM increased by 1.05%, 0.81% and 0.93% respectively. This shows that LightGBM is effective. This is because LightGBM can better capture the interactive features between two texts by deeply learning the complex relationships and interactions between different text features, thereby effectively completing the text matching task.

[0076] 2. Improve strategy ablation experiment.

[0077] The present invention abbreviates the model that introduces the above two strategies as ALBERT-BiLSTM-LGB. In order to analyze how the two improvement strategies work together, this section conducts an ablation experiment on the feature fusion strategy and the prediction improvement strategy. The results are shown in Table 4: Table 4: Ablation experiment results of text matching improvement strategy

[0078] The results show that both the feature fusion strategy and the prediction improvement strategy can improve the P, R and F1 of the model, and the former has a greater improvement. This shows that compared with the problem that the ALBERT output layer is difficult to capture the nonlinear relationship between features, the model cannot fully consider the problem of text character-level similarity features, which has a greater impact on model performance. When the two strategies work together, the P, R and F1 of the model are significantly higher than when any one strategy is introduced. At this time, compared with the original ALBERT model, the three performance indicators are improved by 4.06%, 5.66% and 4.89% respectively, that is, the feature fusion strategy and the prediction improvement strategy can work at the same time, and the effect is better than a single strategy. This shows that the ALBERT-BiLSTM-LGB improved model has better text matching performance and can effectively improve the decision-making efficiency of substation flood control.

[0079] 3. Comparative experiments and analysis.

[0080] Aiming at the text matching task for substation flood prevention decision-making, the present invention conducts comparative experiments on the improved ALBERT model with mainstream text matching algorithms Word2Vec, DSSM, DRMM and ALBERT on the same data set.

[0081] The text matching algorithm Word2Vec based on simple vector similarity has the worst performance with P, R, and F1 of 72.61%, 67.4%, and 69.91% respectively. The text matching algorithms DSSM and DRMM based on deep learning have small differences in various indicators, and the latter performs better than the former, with P, R, and F1 reaching 81.53%, 77.92%, and 79.68% respectively. On this basis, the pre-trained text matching algorithm ALBERT improves the three indicators by 2.79%, 2.65%, and 2.72% respectively, and the ALBERT-BiLSTM-LGB improved algorithm proposed in the present invention solves the adaptability problem of ALBERT when applied to case texts, and further improves P, R, and F1 to 88.38%, 86.23%, and 87.29%, which are significantly higher than other mainstream text matching algorithms, proving the superiority of the ALBERT-BiLSTM-LGB improved algorithm.

[0082] Substation flood prevention case text matching can quickly find similar historical cases when a disaster occurs, and the accuracy of the matching directly affects the efficiency of operation and maintenance personnel in making flood prevention decisions. In view of the large number of flood prevention case texts, complex professional terms, and difficulty in understanding, as well as the problem that the text character-level similarity features cannot be fully considered in the ALBERT algorithm training process and the output layer is difficult to capture the nonlinear relationship between features, this paper proposes an improved ALBERT-BiLSTM-LGB text matching algorithm that integrates two improvement strategies. According to the experimental results, it can be concluded that: (1) Ablation experiments show that the two improvement strategies work best when they work together. The ALBERT-BiLSTM-LGB algorithm based on these two strategies improves the model’s P, F1, and R by 4.06%, 5.66%, and 4.89%, respectively.

[0083] (2) Comparative experiments have shown that the improved ALBERT-BiLSTM-LGB algorithm has more advantages than other mainstream text matching algorithms, with its P, R and F1 reaching 88.38%, 86.23% and 87.29% respectively.

[0084] In summary, the ALBERT-BiLSTM-LGB algorithm proposed in this invention can effectively support site flood prevention work and provide strong support for flood prevention work.

[0085] The embodiment of the present invention also provides a substation flood prevention case text matching device, combined with Figure 4 Come and see, Figure 4 The schematic diagram of the structure of an embodiment of a text matching device for flood prevention cases of substations provided by the present invention is as follows. The text matching device 400 for flood prevention cases of substations comprises: A construction module 401 is used to construct a target text pair based on a target flood control text and a to-be-matched flood control case text, wherein the to-be-matched flood control text is any flood control case text in a flood control case text library; A determination module 402 is used to preprocess the target text pair, and use the preprocessed target text pair as an input of a text matching model, and determine the text similarity and matching result between the target flood prevention text and the to-be-matched flood prevention case text based on the text matching model; The text matching model is obtained by training flood prevention case text pairs based on manually annotated matching results.

[0086] The specific implementation methods of each module of the substation flood prevention case text matching device can refer to the description of the above-mentioned substation flood prevention case text matching method, and have similar beneficial effects, which will not be repeated here.

[0087] The embodiment of the present invention further provides an electronic device, Figure 5 Come and see, Figure 5 This is a structural diagram of an embodiment of an electronic device provided by the present invention. The electronic device 500 includes a processor 501, a memory 502, and a computer program stored in the memory 502 and executable on the processor 501. When the processor 501 executes the program, the substation flood prevention case text matching method as described above is implemented.

[0088] As a preferred embodiment, the electronic device 500 further includes a display 503 for displaying that the processor 501 executes the substation flood prevention case text matching method as described above.

[0089] Exemplarily, the computer program may be divided into one or more modules / units, one or more modules / units are stored in the memory 502, and are executed by the processor 501 to complete the present invention. One or more modules / units may be a series of computer program instruction segments that can complete specific functions, and the instruction segments are used to describe the execution process of the computer program in the electronic device 500. For example, the computer program may be divided into the construction module 401 and the determination module 402 in the above embodiment, and the specific functions of each module are as described above, and are not described one by one here.

[0090] The electronic device 500 may be a desktop computer, a notebook, a PDA or a smart phone with an adjustable camera module.

[0091] Among them, the processor 501 may be an integrated circuit chip with signal processing capabilities. The above-mentioned processor 501 may be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it may also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The methods, steps and logic block diagrams disclosed in the embodiments of the present invention can be implemented or executed. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.

[0092] The memory 502 may be, but is not limited to, a random access memory (RAM), a read only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable read-only memory (EEPROM), etc. The memory 502 is used to store programs, and the processor 501 executes the program after receiving an execution instruction. The process definition method disclosed in any of the above embodiments of the present invention may be applied to the processor 501, or implemented by the processor 501.

[0093] The display 503 may be an LCD display screen or an LED display screen, for example, a display screen on a mobile phone.

[0094] Understandably, Figure 5 The structure shown is only a schematic diagram of the structure of the electronic device 500. The electronic device 500 may also include Figure 5 More or fewer components as shown. Figure 5 Each component shown in the figure can be implemented by hardware, software or a combination thereof.

[0095] The electronic device provided according to the above embodiment of the present invention can be implemented with reference to the specific description of the substation flood prevention case text matching method according to the present invention, and has similar beneficial effects as the substation flood prevention case text matching method, which will not be repeated here.

[0096] An embodiment of the present invention further provides a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the substation flood prevention case text matching method as described above is implemented.

[0097] Generally speaking, the computer instructions for implementing the method of the present invention can be carried by any combination of one or more computer-readable storage media. Non-transitory computer-readable storage media can include any computer-readable media except for the signal itself that is temporarily propagating.

[0098] Computer-readable storage media may be, for example, but not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatuses, or devices, or any combination thereof. More specific examples of computer-readable storage media (a non-exhaustive list) include: an electrical connection having one or more conductors, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In this document, a computer-readable storage medium may be any tangible medium that contains or stores a program that may be used by or in conjunction with an instruction execution system, apparatus, or device.

[0099] Computer program codes for performing the operations of the present invention may be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages, in particular, Python suitable for neural network computing and platform frameworks based on TensorFlow, PyTorch, etc. may be used. The program code may be executed entirely on the user's computer, partially on the user's computer, as an independent software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0100] Those skilled in the art will appreciate that all or part of the processes of the above-mentioned embodiments can be implemented by instructing related hardware through a computer program, and the program can be stored in a computer-readable storage medium, wherein the computer-readable storage medium is a disk, an optical disk, a read-only storage memory, or a random access memory, etc.

[0101] The present invention discloses a substation flood control case text matching method and device. Firstly, a target flood control text and a to-be-matched flood control case text are constructed as a target text pair, so that the similarity feature between the target flood control text and the to-be-matched flood control case text is more easily extracted. Then, the target text pair is preprocessed to avoid semantic deviation during feature extraction. Then, the preprocessed target text pair is used as the input of a text matching model. The text similarity and matching result between the target flood control text and the to-be-matched flood control case text are determined by the text matching model, thereby achieving matching between the target flood control text and the flood control case text. The present invention improves the accuracy and efficiency of text matching while achieving flood control case text matching.

[0102] The above description is only a preferred specific implementation manner of the present invention, but the protection scope of the present invention is not limited thereto. Any changes or substitutions that can be easily conceived by any technician familiar with the technical field within the technical scope disclosed by the present invention should be covered within the protection scope of the present invention.

Claims

1. A substation flood prevention case text matching method, characterized in that: include: Constructing a target text pair based on the target flood prevention text and the flood prevention case text to be matched, wherein the flood prevention text to be matched is any flood prevention case text in the flood prevention case text library; Preprocessing the target text pair, and using the preprocessed target text pair as input of a text matching model, and determining the text similarity and matching result between the target flood prevention text and the to-be-matched flood prevention case text based on the text matching model; The text matching model is obtained by training flood prevention case text pairs based on manually annotated matching results.

2. The substation flood prevention case text matching method according to claim 1 is characterized in that: The preprocessing of the target text pair includes: The target text pair is segmented, stop word deleted, and non-stop word data augmented.

3. The substation flood prevention case text matching method according to claim 2 is characterized in that: The performing non-stop word data augmentation on the target text comprises: The target text is subjected to synonym replacement, random word deletion, random word exchange and random synonym insertion processing.

4. The substation flood prevention case text matching method according to claim 1 is characterized in that: The determining, based on the text matching model, the text similarity and matching result between the target flood prevention text and the to-be-matched flood prevention case text comprises: Determine semantic features and character-level features of the target flood prevention text and the to-be-matched flood prevention case text based on the text matching model; Performing feature fusion on the semantic features and character-level features of the target flood prevention text and the to-be-matched flood prevention case text to obtain similarity features between the target flood prevention text and the to-be-matched flood prevention case text; The text similarity and matching result between the target flood prevention text and the flood prevention case text to be matched are determined based on the similarity characteristics between the target flood prevention text and the flood prevention case text to be matched.

5. The substation flood prevention case text matching method according to claim 4 is characterized in that: The semantic features of the target flood prevention text and the flood prevention case text to be matched are extracted based on the ALBERT model, and the character-level features of the target flood prevention text and the flood prevention case text to be matched are extracted based on the character-level feature extraction model. The ALBERT model and the character-level feature extraction model are sub-models within the text matching model.

6. The substation flood prevention case text matching method according to claim 4 is characterized in that: The step of fusing the semantic features and character-level features of the target flood prevention text and the to-be-matched flood prevention case text comprises: The semantic features and character-level features of the target flood prevention text and the flood prevention case text to be matched are fused based on the BiLSTM model, and the BiLSTM model is a sub-model within the text matching model.

7. The substation flood prevention case text matching method according to claim 4 is characterized in that: The determining of the text similarity and matching result between the target flood prevention text and the flood prevention case text to be matched based on the similarity features between the target flood prevention text and the flood prevention case text to be matched includes: Determine the text similarity between the target flood prevention text and the flood prevention case text to be matched based on the similarity characteristics of the target flood prevention text and the flood prevention case text to be matched and the LightGBM model, wherein the LightGBM model is a sub-model within the text matching model; In the case where the text similarity between the target flood prevention text and the to-be-matched flood prevention case text is greater than a similarity threshold, determining that the target flood prevention text matches the to-be-matched flood prevention case text; When the text similarity between the target flood prevention text and the flood prevention case text to be matched is less than or equal to a similarity threshold, it is determined that the target flood prevention text and the flood prevention case text to be matched do not match.

8. A substation flood prevention case text matching device, characterized in that: include: A construction module, used to construct a target text pair based on a target flood control text and a flood control case text to be matched, wherein the flood control text to be matched is any flood control case text in a flood control case text library; A determination module, used to preprocess the target text pair, and use the preprocessed target text pair as an input of a text matching model, and determine the text similarity and matching result between the target flood prevention text and the flood prevention case text to be matched based on the text matching model; The text matching model is obtained by training flood prevention case text pairs based on manually annotated matching results.

9. An electronic device, characterized in that: It includes a memory and a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, the substation flood prevention case text matching method according to any one of claims 1 to 7 is implemented.

10. A computer-readable storage medium, characterized in that: A computer program is stored thereon, and when the computer program is executed by a processor, the substation flood prevention case text matching method as described in any one of claims 1 to 7 is implemented.