Method, device, terminal and non-transitory storage medium for partitioning power grid service data
By using the ATT-ALE-TextRNN model and the DeepFM model to process power grid business data, the problems of domain name confusion and unclear features in power grid data models have been solved, and more accurate semantic domain segmentation and feature extraction have been achieved.
Patent Information
- Application Number
- CN202111159160.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-09-30
- Publication Date
- 2026-02-06
- Estimated Expiration
- 2041-09-30
AI Technical Summary
In the power grid business data model, the relevant characteristics of the tables are difficult to represent clearly, the domain names are seriously confused, and the entity connection relationships are unclear, which leads to difficulties in data processing.
The ATT-ALE-TextRNN model is used to process descriptive features, and the DeepFM model is combined to process discrete features. Through deep learning and natural language processing techniques, power grid business data is identified and segmented.
It improves the semantic recognition accuracy and domain segmentation effect of power grid data models, reduces category confusion, and enhances the diversity of feature distribution and combined computation performance.
Smart Images

Figure CN114595324B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application belongs to the technical field of data processing, and particularly relates to a power grid business data domain division method and device, a terminal and a non-transitory storage medium. BACKGROUND
[0002] In the data model of power grid business, the related features of tables need to be processed, and semantic source data needs to be intelligently extracted as input for intelligent analysis. The current data model is large in quantity and involves many professional categories, and many terms are difficult to determine through grammar rules, so multi-feature semantic information needs to be constructed to describe together. In addition, the feature space is large, the domain features are not clear, and the entity connection relationship of related tables is not clear, which can easily cause domain name confusion. SUMMARY
[0003] In view of the problems in the prior art, the present disclosure provides a power grid business data domain division method, device, terminal and non-transitory storage medium.
[0004] The present disclosure provides a power grid business data domain division method, comprising:
[0005] For power grid business data, determining the features of the power grid business data; wherein the features include descriptive features and discrete features;
[0006] Determining the category of first data whose features are descriptive features through a first model;
[0007] Determining the category of second data whose features are discrete features through a second model; and
[0008] Dividing the power grid business data into domains using the category of the first data and the category of the second data.
[0009] In the embodiments of the present disclosure, the determining the features of the data comprises:
[0010] Preprocessing the data; wherein the preprocessing includes at least one of split matching, statistics, word segmentation and stop word removal; and
[0011] Extracting the features of the preprocessed data through a bag-of-words model and / or a feature extraction model based on word vectors.
[0012] In the embodiments of the present disclosure, the determining the category of first data whose features are descriptive features through a first model comprises:
[0013] Extracting domain name information, label information and word information from the first data;
[0014] Vectorizing the domain name information and label information to obtain vectorized data;
[0015] vectorizing the word information to obtain a word vector;
[0016] obtaining an attention value according to the word vector;
[0017] converting the word vector into a fixed-length vector; and
[0018] classifying the vectorized data and the fixed-length vector according to the attention value to obtain a classification result.
[0019] In the embodiments of the present disclosure, the first model comprises: a text embedding ALE layer, an ATT layer, a TextRNN layer and a softmax perception layer; the ATT layer comprises a single layer or multiple layers;
[0020] When the ATT layer is a single layer, the method further comprises:
[0021] obtaining a corresponding weight according to the word vector;
[0022] weighting the word vector according to the corresponding weight to obtain a weight value; and
[0023] weighting and summing the word vector and the weight value to obtain the attention value;
[0024] When the ATT layer is a multiple layer, the method further comprises:
[0025] converting the word vector into a sentence vector on a first layer; and
[0026] converting the sentence vector into a paragraph vector on a second layer.
[0027] In the embodiments of the present disclosure, the first data whose feature is a descriptive feature obtained by the first model further comprises:
[0028] obtaining a word bank of keywords;
[0029] extracting, from the word bank, a class label with the highest frequency of occurrence of each keyword; and
[0030] re-encoding the first data so that each data group in the first data corresponds to a multi-dimensional vector; wherein each dimension in the multi-dimensional vector represents a statistical value of a class label appearing in the data group.
[0031] In the embodiments of the present disclosure, the second data whose feature is a discrete feature determined by the second model comprises:
[0032] extracting a domain continuous feature from the first data;
[0033] extracting discretization features from the second data;
[0034] performing second-order cross calculation on the domain continuous features and the discretization features to obtain a calculation result; and
[0035] obtaining a classification result according to the calculation result and high-dimensional embedding of the domain continuous features in a deep measure.
[0036] In the embodiments of the present disclosure, the discretization features include domain discretization features and source system discretization features.
[0037] The method further includes:
[0038] discretization one-hot vector representation is adopted for the domain discretization features; and
[0039] discrete value encoding processing is performed on the source system discretization features.
[0040] The present disclosure provides an apparatus for dividing power grid business data into domains, which includes:
[0041] a judging module configured to judge features of power grid business data;
[0042] a determining module configured to determine, by a first model, a category of first data in which the features are descriptive features, and determine, by a second model, a category of second data in which the features are discrete features; and
[0043] a domain dividing module configured to divide the power grid business data into domains by using the category of the first data and the category of the second data.
[0044] The present disclosure provides a terminal, which includes:
[0045] at least one memory and at least one processor;
[0046] The at least one memory is configured to store program code, and the at least one processor is configured to invoke the program code stored in the at least one memory to execute the method described in any one of the above.
[0047] The present disclosure provides a non-transitory storage medium configured to store program code, which, when executed by a computer device, causes the computer device to execute the method described in any one of the above.
[0048] The technical solutions of the present disclosure have the following positive effects:
[0049] (1) The disclosure is directed to the identification and classification of grid data model domain name related semantic attributes. The first model ALE-TextRNN model is proposed according to the text polarity classification problem of table description characteristics. The model can capture the importance of different context information to the given category tendency, facilitate the differentiation of subtle category differences in the multi-classification task, and reduce category confusion.
[0050] (2) For the fields and source system characteristics of the table, the disclosure proposes to use an improved DeepFM model to explore the semantic dependency relationship between discrete and classified features. Without the need for manual design of input features, the feature distribution diversity can be increased, and the FM side can supervise the embedding layer to effectively reduce the feature dimension and redundancy, and improve the combination calculation performance.
[0051] (3) The semantic of multi-form features is mined and identified, and the evaluation method is redefined. The higher one of the two parts regression prediction scores determines the final result, thereby obtaining more accurate semantics and more ideal domain effect. BRIEF DESCRIPTION OF DRAWINGS
[0052] The features, advantages, and technical and industrial significance of the application will be described below with reference to the drawings, in which the same reference numerals indicate the same elements, and wherein:
[0053] Figure 1 The flowchart of the power grid business data domain method of the embodiment of the disclosure.
[0054] Figure 2 The principle diagram of fastText of the embodiment of the disclosure.
[0055] Figures 3a-3b The principle diagram of TextCNN of the embodiment of the disclosure.
[0056] Figure 4 The principle diagram of TextRNN of the embodiment of the disclosure.
[0057] Figure 5 The framework diagram of TextRNN+attention of the embodiment of the disclosure.
[0058] Figure 6 The framework diagram of Hierarchical Attention of the embodiment of the disclosure.
[0059] Figure 7 The framework diagram of Wide&Deep of the embodiment of the disclosure.
[0060] Figure 8 The architecture diagram of the first model of the embodiment of the disclosure.
[0061] Figure 9 A schematic diagram of the principle of the RNN of the embodiment of the present disclosure.
[0062] Figure 10 A schematic diagram of the principle of the softmax of the embodiment of the present disclosure.
[0063] Figure 11 A structural schematic diagram of the second model of the embodiment of the present disclosure.
[0064] Figure 12 A structural schematic diagram of the power grid service data domain device of the embodiment of the present disclosure. DETAILED DESCRIPTION
[0065] The present application will now be described in further detail with reference to the drawings. These drawings are simplified schematic diagrams, and only illustrate the basic structure of the present application in a schematic manner, and thus only show the components related to the present application.
[0066] In the data model of the power grid service, the domain name feature can be the most core demarcation between various data sources, represents the common features and applicable scope of all data under a table, and is the basic work for subsequent semantic recognition and knowledge mining. Therefore, we need to take the domain name of the entity table as an important attribute value for constructing the graph, extract the semantics related to the domain name from the description features or other features of the table, and use the same to classify different domains and other attributes under the domain, and complete the semantic attribute information.
[0067] With the rapid development of electronic office, mobile terminals and social media, a large amount of short text has been accumulated in the Internet database and needs to be processed urgently. Moreover, the continuity and density of the original corpus data make them have certain local rules, so solving the text representation and classification problem based on deep learning has become a very important field in natural language processing. The text classification model mainly includes sentiment polarity analysis and subject category classification in application. The sentiment polarity analysis can find out user preferences by mining user feedback, which can help companies and manufacturers to further promote products. The subject category classification is helpful for mining public expectations, implementing public opinion monitoring and identifying sensitive topics.
[0068] Please refer to Figure 1 , Figure 1 A flowchart of the power grid service data domain method of the embodiment of the present disclosure, comprising the following steps.
[0069] S100, for the power grid service data, judging the characteristics of the power grid service data; wherein the characteristics include descriptive features and discrete features.
[0070] Specifically, the embodiments of the present disclosure can include pre-processing the data, wherein the pre-processing includes at least one of split matching, statistics, word segmentation, and removing stop words; and extracting the features of the pre-processed data through a bag-of-words model and / or a feature extraction model based on a word vector.
[0071] More specifically, the embodiments of the present disclosure can first perform original sentence split matching or word statistics on the text, so as to perform a series of pre-processing operations such as Chinese word segmentation or stop word removal; and then perform text feature extraction, mainly including the following methods:
[0072] (1) Bag-of-words model
[0073] The embodiments can establish a dictionary library containing all words of the training corpus and represent each word with a unique identifiable number by one-hot, wherein the word vector dimension and the number of words in the dictionary library are the same.
[0074] (2) Text feature extraction Term Frequency-Inverse Document Frequency
[0075] The embodiments can use two parameters of the frequency of a word appearing in a document (TF) and the probability of each word appearing in the document (IDF) to measure the importance of the word in the text, which can respectively represent the importance of the word in the document and between documents. The characteristic value expression is:
[0076] TF_IDF(i,j) = TF i,j *IDF i (1)
[0077] Wherein, TF_IDF(i,j) is the importance index of word i in document j, which is obtained by multiplying the term frequency by the inverse document frequency; TF i,j represents the number of times that the word i appears in the document j, IDF i represents the inverse document frequency of the word i,
[0078] (3) Feature extraction model based on word vector
[0079] The embodiments can map each word into a dimension in a large text corpus by training a neural network, such as a word2vec model, which can obtain a vector to represent each word by training a large amount of corpus, thereby improving the efficiency and grammatical semantic expression.
[0080] The deep learning text classification model performs feature expression, mainly including the following ways:
[0081] (1) fastText: such as Figure 2 As shown, Figure 2 This is a schematic diagram illustrating the principle of fastText in this embodiment. This embodiment averages and normalizes all word vectors in a sentence, and uses the n-gram trick to obtain local sequence information.
[0082] (2) TextCNN: such as Figures 3a-3b As shown, Figures 3a-3b This is a schematic diagram illustrating the principle of TextCNN according to an embodiment of this disclosure. This embodiment can focus more on local sequence classification information based on the FastText trick, achieving better prediction accuracy. However, due to the introduction of one-dimensional convolution, it is necessary to specify several convolution kernels of different sizes to obtain different widths of field of view. At the same time, it is necessary to introduce a dynamic pooling (k-max pooling) method to retain the k largest information related to the global sequence.
[0083] (3) TextRNN: such as Figure 4 As shown, Figure 4 This is a schematic diagram illustrating the principle of TextRNN according to an embodiment of this disclosure. In this embodiment, k can more flexibly model variable-length text sequence information, achieving a better effect in representing text context information.
[0084] (4) TextRNN+attention: such as Figure 5 As shown, Figure 5 This is a schematic diagram of the TextRNN+attention framework according to an embodiment of this disclosure. This embodiment introduces an attention mechanism to recognize the semantics of sentiment polarity. By adding N rounds of aspect embedding to the hidden layers of the basic LSTM, it can capture important information about responses to a given polarity. Sentiment classification refers to identifying the positive or negative sentiment tendencies contained in a corpus, extracting the attitudes and opinions of the text's subject. Due to the implicit and ambiguous nature of information expression, it is considered a special type of text classification problem. It can be learned through supervised, semi-supervised, and unsupervised tasks. Supervised sentiment classification requires labeling a large number of samples with fine-grained sentiment polarity vocabulary and using multi-classification algorithms to learn the feature space; semi-supervised learning can solve the problem of insufficient corpus labeling through collaborative learning; unsupervised learning can obtain sentiment tendencies by calculating the pointwise mutual information between sentiment seed words and text words.
[0085] S200, the category of the first data whose features are descriptive features is determined by the first model.
[0086] Specifically, the embodiments of the present disclosure can include extracting domain name information, label information and word information from the first data; vectorizing the domain name information and the label information to obtain vectorized data; vectorizing the word information to obtain a word vector; obtaining an attention value according to the word vector; converting the word vector into a fixed-length vector; and classifying the vectorized data and the fixed-length vector according to the attention value to obtain a classification result. Wherein, the first model (ATT-ALE-TextRNN model) includes: a text embedding ALE layer, an ATT layer, a TextRNN layer and a softmax perception layer; the ATT layer includes a single layer or multiple layers. More specifically, when the ATT layer is a single layer, the embodiments of the present disclosure can include: obtaining a corresponding weight according to the word vector; weighting the word vector according to the corresponding weight to obtain a weight value; and weighted summing the word vector and the weight value to obtain the attention value. When the ATT layer is a multiple layer, the embodiments of the present disclosure can further include: converting the word vector into a sentence vector on a first layer; and converting the sentence vector into a paragraph vector on a second layer. In addition, the embodiments of the present disclosure can further include obtaining a keyword library; extracting a class label with the highest frequency of occurrence of each keyword from the keyword library; and re-encoding the first data, so that each data group in the first data corresponds to a multi-dimensional vector; wherein each dimension in the multi-dimensional vector represents a statistical value of a class label appearing in the data group.
[0087] In order to prevent domain name confusion, the embodiments of the present disclosure can connect the text information and the information related to the domain name to obtain a fusion feature, and then input the fusion feature into a deep attention network to identify the most important information under different domains of the text. Please refer to Figure 5 , the embodiments can first learn the attention weight of the word and sentence by hierarchical attention, obtain the core information in the sentence, and then realize the classification task of the text through the TextRNN structure. In this scheme, a keyword weight learning model is introduced, and a Hierarchical Attention Network is added to the structure of TextRNN. Please refer to Figure 6 , Figure 6A schematic diagram of a framework of Hierarchical Attention of embodiments of the present disclosure. The Hierarchical Attention Network can be used for classification problems of long texts: the first layer can represent word vectors as sentence vectors through TextRNN+Attention, and the second layer can represent sentence vectors as vectors of the whole text section through the same structure; a network only containing a single layer of Attention can learn different external weights for different pixels on the same feature map in image learning, and be transferred to a single layer feature map, while considering the similarity between words based on the corpus, and performing word-by-word weighting. The hierarchical attention network refers to a classification problem of long texts, the first layer first represents word vectors as sentence vectors through TextRNN+Attention, and the second layer then represents sentence vectors as vectors of the whole text section through the same structure. For details, please refer to the following formula:
[0088] u t =tanh(W w h t +b w ) (2)
[0089] α t =exp(u t T u w ) / (∑ t exp(u t T u w )) (3)
[0090]
[0091] where t represents the t-th word, h t represents the word vector of the t-th word; u t is the hidden layer representation of h t , which is obtained by h t through single-layer neural network operation in formula (2); u w is a randomly initialized weight vector, which is then trained together with the model parameters; formula (3) performs softmax standardization on the hidden layer representation u t of h t to obtain α t ; s t is the vector representation of the t-th sentence, which is obtained by weighted calculation of α t and the word vector h t of the t-th word.
[0092] Based on the above steps, the model trained by the embodiments of the present disclosure has better text representation and higher classification accuracy, and the importance of words and sentences in text classification is expressed through an intuitive method, thereby improving the interpretability of the model.
[0093] For the descriptive continuous text features, the semantic information related to the labels can be obtained by means of the text classification algorithm. The TextCNN algorithm can extract the local sequence information of the text, and the TextRNN algorithm can learn the context relationship of the sequence without considering the length limitation of the sequence, and is more suitable for the case where the length of the corpus cannot be fixed. It is found in actual verification that the TextCNN can achieve an accuracy of 69%, and although the TextRNN has a slower training speed, the accuracy is slightly higher than that of the TextCNN, which can reach 73%.
[0094] If the representative features are missing, the class confusion may occur, for example, the feature words under two domain names have a certain similarity, and the corpus is short. Therefore, in order to enhance the semantic information related to the corpus and the class, the embodiments of the present disclosure add the attention mechanism in natural language processing (NLP) to focus on the core features of the original corpus. In addition, according to the word frequency statistics of the dictionary, the original corpus is re-encoded and added to the last hidden layer to jointly affect the class prediction result.
[0095] Please refer to Figure 7 , Figure 7 The Wide&Deep framework schematic diagram of the embodiments of the present disclosure. The embodiments of the present disclosure can utilize the network architecture of wide&deep to generate the word library of high-frequency keywords according to the training corpus; then extract the class label with the highest frequency of each keyword, re-encode the original sentence, and each sentence corresponds to, for example, a 10-dimensional vector, each dimension represents the word count of the class label appearing in the sentence, which can be used as the class weight when the full connection layer softmax outputs, to strengthen the mapping relationship of the keywords to the corresponding labels and the class semantics in the original sentence.
[0096] Please refer to Figure 8 , Figure 8The figure is a schematic diagram of the architecture of the first model of the embodiments of the present disclosure. The embodiments of the present disclosure can connect the topic, such as label-aspect embedding, that needs to be reinforced with the text information as input, add N times of the polarity information of the topic on the hidden layer, calculate the attention score together, utilize the long short-term memory network to facilitate the sequence feature extraction, better mine and utilize the polarity information and the text key information. The attention mechanism can dynamically change the weight according to the input data. For the neural network without the attention mechanism, the neural network weight and the input word vector are not related, and the weight cannot be dynamically adjusted according to the input. The attention mechanism can input different weights according to different word vectors, give different weights to different word vectors, and obtain the weight by comparing different word vectors. Specifically, first, the word vector is input, the attention is weighted (attention weighting) to the input word vector, and then the word vector and the weight are summed to obtain the corresponding attention value, that is, the attention score.
[0097] The embodiments of the present disclosure can first input the second-level domain name information and the text (table description) information together, then train and share the weight information by using the bidirectional RNN network, fuse the obtained domain name features and text features, and finally process the fused features by using the deep attention mechanism, so that the polarity division tendency of different domain names in the text can be effectively recognized, and the recognition ability of the entire model for the domain name related semantics is improved.
[0098] The following will describe the layers included in the first model (ATT-ALE-TextRNN model), including the text embedding ALE layer, the ATT layer, the TextRNN layer and the softmax perception layer.
[0099] (1) Text embedding ALE layer
[0100] The embodiments of the present disclosure introduce the ALE module / layer (attention aspect-level embedding) for the detection of fine-grained polarity classification. The embodiments input the original corpus encoding and the second-level domain name encoding at the input end, and the advantages are as follows: ① By training the aspect-level embedding into another vector space, the information of the aspect can be more fully utilized, and the domain name related semantics in the original corpus can be further reinforced. ② The problem of inconsistency between the word vector and the aspect-level embedding is solved, and the most important information responding to the given aspect-level is captured. When different second-level domain names are given, the model can capture the most important part of the sentence at the moment and the part that has a distinguishing degree when different aspect-levels are given.
[0101] (2)ATT layer
[0102] The embodiments of the present disclosure can calculate the weight between the secondary domain name and the output vector of the original feature processed by the deep network, so as to calculate the attention degree of the content of the original corpus and the semantic of the domain name, so that the model can pay attention to different parts of the sentence, thereby capturing the potential correlation between the content and the domain name. For example, a matrix composed of hidden layer vectors [h1, h2, h3, …, hN], where the size of the hidden layer is d, the length of the given sentence is N, and v la The attention mechanism generates an attention weight vector α and a weighted hidden layer vector r for representing the weighting of the sentence with a given classification polarity. For details, refer to the following formula:
[0103]
[0104] α=softmax(w T M) (6)
[0105] r=Hα T (7)
[0106] wherein, represents the process of connecting the repetition on, that is, the process of linear transformation of the repetition for N times, and the number of times is the length of the sentence. The final sentence can be represented as follows:
[0107] h * =tanh(W P r+W x h N ) (8)
[0108] y=softmax(W s h * +b s ) (9)
[0109] wherein, h* can be considered as a new feature representation of the original sentence after adding a given secondary domain name. Then, a linear layer is added to convert the sentence vector into a vector e with a length equal to the number of categories, and finally, the e is converted into a conditional probability distribution through a softmax layer. The loss function is also defined as a cross-entropy function.
[0110] (3)TextRNN layer
[0111] A neural network model can represent variable-length text as a fixed-length vector, which usually consists of a projection layer that maps words, sub-word units or n-grams to vector representations (which can be trained first using unsupervised methods), and then combines them with different neural network architectures to model text, such as neural bag-of-words model, convolutional neural network, recurrent neural network, etc. Among them, the recurrent neural network (RNN) is very suitable for processing variable-length text due to its recursive structure, and can be used to process natural language problems, recursively transition the internal hidden state of the input sequence according to the activation of the input sequence and the previous hidden state vector at different time steps. Please refer to Figure 9 , Figure 9 The principle diagram of the RNN of the embodiment of the present disclosure. The embodiment of the present disclosure can complete the sequence mapping of the input vector to the fixed-length vector through the RNN, and then input the softmax layer to predict the probability distribution of the category, which is used for classification or other tasks; At the same time, by training the network parameters, the cross-entropy of the prediction and the real distribution is minimized.
[0112] In order to avoid gradient explosion or disappearance in the training process due to the lack of learning of long-distance correlation in the sequence, for example, the gradient vector grows or decays in the form of exponential for a long time, the embodiment of the present disclosure further introduces the LSTM network. The internal independent memory unit of LSTM includes many variants. In the embodiment, the TextRNN model uses the LSTM unit at each time step t to be defined as a set of d vectors, each LSTM unit contains an input gate, a forget gate and an output gate, and also contains a hidden state and a storage unit, and d represents the number of LSTM units. The algorithm formula is as follows:
[0113] i t =σ(W i x t +U i h t-1 +V i c t-1 ) (10)
[0114] f t =σ(W f x t +U f h t-1 +V f c t-1 ) (11)
[0115] o t =σ(W o x t +U o h t-1 +V o c t-1 ) (12)
[0116]
[0117]
[0118] h t =o t ⊙tanh(c t ) (15)
[0119] The hidden layer of the RNN has only one state, i.e. h, which is very sensitive to short-term input, and the LSTM increases the state c to save long-term state. In the above formula, at time t, the input of the LSTM includes: the input value x of the network at the current time t , the output value h of the LSTM at the last time t-1 , and the unit state c at the last time t-1 . The output of the LSTM includes: the output value h of the LSTM at the current time t , and the unit state c at the current time t t . In formula (10), W i represents the weight matrix of the input gate, and in formula (11), W f represents the weight matrix of the forgetting gate.
[0120] (4) Perceptron layer softmax
[0121] Please refer to Figure 10 , Figure 10 for the principle diagram of the softmax of the embodiment of the present disclosure. The embodiment of the present disclosure can use the softmax regression model as the output layer of the deep learning network, and output the probability of a certain sample on all possible categories in the form of a probability value. The formula and principle are as follows:
[0122]
[0123] Wherein, V i represents the output value of the i th node, and the output value of the multi-classification can be converted into a probability distribution with a range of [0, 1] and 1 through the Softmax function.
[0124] S300, determining the category of the second data with discrete features through the second model.
[0125] In particular, embodiments of the present disclosure can include extracting domain continuous features from the first data; extracting discrete features from the second data; performing second-order cross calculation on the domain continuous features and the discrete features to obtain a calculation result; and obtaining a classification result according to the calculation result and high-dimensional embedding of the domain continuous features in a deep measurement. Wherein, the discrete features include domain discrete features and source system discrete features. More specifically, embodiments of the present disclosure can also include adopting a discrete one-hot vector representation for the domain discrete features; and performing discrete value encoding processing on the source system discrete features.
[0126] In the CTR estimation of the recommendation system, it is necessary to determine whether a commodity can be recommended according to the click rate of the CTR estimation. Whether a user clicks an advertisement in an interface determines the conversion rate of the advertisement. Due to the large number of users, advertisements and corresponding cross description features, such as user age, gender, region, position, mobile phone type, advertisement size, industry, real-time feedback information, and advertisement and gender cross CTR, etc. Since the advertisement click itself is a sparse event, many combined features in the training data set appear very few times, which will directly lead to insufficient learning of the model on these features and overfitting. Therefore, in the CTR estimation and determination of whether an advertisement can be clicked, in addition to single features, features are often combined. LR, GBDT and other algorithms consider that all cross features are independent of each other, even if two cross features have relevance from a business perspective. This leads to the fact that the model is optimized independently when the parameters are optimized, and the correlation between the features in the business cannot be fully utilized, which will lead to overfitting. Preferably, compared with LR and GBDT, the factorization machine (FM) algorithm can extract features and combine them by calculating the inner product of the hidden vectors when there are many sparse features, so as to learn the feature combinations that rarely or never appear, and facilitate automatic processing of feature cross. That is, under the condition that the combined features do not coexist sufficiently, cross features are efficiently learned. For example: features a and b have never appeared together in the training data, but features b and c often coexist, and features a and c also often coexist, so it can be considered that features a and b have some correlation in the FM model. The following is the comparison formula of the LR method and FM:
[0127]
[0128]
[0129] Wherein, x is an n-dimensional vector, x i represents the value of the i-th dimension of the vector, x j represents the value of the j-th dimension of the vector, w ij is the corresponding weight; <v i , vj represents the i-th dimension of vector v i represents the dot product of vectors v j , wherein v i represents the i-th dimension of coefficient matrix V, v j represents the j-th dimension of coefficient matrix V.
[0130] In addition to the linear part, the embodiments of the present disclosure introduce a quadratic cross term to achieve linear training complexity. When performing domain name classification of the table, several field features can be regarded as advertisement features, and high-dimensional discrete feature low-dimensional dense embedding and feature combination can be performed to mine effective feature information. The embodiments of the present disclosure fuse the field information in the feature processing process, and the features of the same nature are attributed to the same field. The improved formula of the quadratic cross term is as follows:
[0131]
[0132] wherein the sample x is an n-dimensional vector, x i represents the i-th dimension of the vector, x j represents the j-th dimension of the vector, f j represents the field to which the j-th feature belongs, v i,fj represents the corresponding hidden vector of x i .
[0133] The calculation of the second-order cross feature can solve the problem of the limitation of the calculation complexity, and the actual verification classification accuracy can reach 62%.
[0134] DNN is also called a multi-layer perception machine, which can be regarded as a neural network with many hidden layers, because it looks locally and has the same principle as the perception machine, that is, the linear relationship and the activation function together constitute a nonlinear relationship. The internal main network structure can be roughly divided into three categories: input layer, hidden layer and output layer. The layers are fully connected, that is, any neuron of the previous layer is connected to any neuron of the next layer. Because of its full connection structure, it has the ability of high-order feature representation.
[0135] Please refer to Figure 11 , Figure 11 for the structural diagram of the second model of the embodiments of the present disclosure. The second model (DeepFM model) of the embodiments of the present disclosure can consider the high-order feature representation and the calculation parallelism of the model, and introduce the field discretization feature and the source system discretization feature into the FM layer respectively, and add the field continuous feature to the FM to perform the second-order cross calculation with the discrete features. Combined with the high-dimensional embedding of the continuous features on the depth side, the logsitic score and the softmax normalization output are finally calculated together, and they jointly affect the prediction result.
[0136] S400, performing power grid business data domain division by using the category of the first data and the category of the second data.
[0137] In the embodiments of the present disclosure, if the category of the first data is equivalent to the category of the second data, the equivalent result can be taken as the final result with high confidence.
[0138] The present disclosure provides a power grid data model domain division method based on natural language processing technology, which combines table description features and table discrete features, and designs an ATT-ALE-TextRNN text classification model based on table description features and a DeepFM classification model based on table discrete features.
[0139] The present disclosure provides a data model domain division method based on natural language processing technology. In the domain name classification task of a data table, a plurality of features of the table can be divided into continuous text features and other discrete category features according to different forms. In the field of recommendation algorithms, there are model architectures that combine continuous and discrete inputs, but since the correlation between the text features and the discrete features of most tables is not strong, there are few overlapping words, and the categories of the field features are large, the training effect of traditional single models is not good. For the descriptive features of the table and the discrete features of the table, this patent uses suitable models for prediction respectively, and finally integrates the two models to achieve better training effect.
[0140] See Figure 12 The embodiments of the present disclosure also provide an apparatus 10 for power grid business data domain division, which comprises a judgment module 11, a determination module 13 and a domain division module 15. The judgment module 11 can be used to judge the features of the power grid business data. The determination module 13 can be used to determine the category of the first data whose feature is a descriptive feature by using a first model, and determine the category of the second data whose feature is a discrete feature by using a second model. The domain division module 15 can be used to perform power grid business data domain division by using the category of the first data and the category of the second data.
[0141] For the embodiments of the apparatus, since they basically correspond to the embodiments of the method, the relevant parts are described in the part of the embodiments of the method. The apparatus embodiments described above are only illustrative, and the modules described as separate modules can or can not be separated. Part or all of the modules can be selected to achieve the purpose of the embodiments according to actual needs. Those skilled in the art can understand and implement without creative labor.
[0142] The model designed and trained by means of deep learning and natural language processing technology has better text representation and higher classification accuracy, and when applied to the power grid business data model, can realize automatic semantic classification and association of information in the power grid data model domain, and finally realize automatic mapping of the business data model.
[0143] It should be understood that the specific embodiments described above are merely for the purpose of interpretation of the present application and are not intended to limit the present application. The obvious changes or modifications derived from the spirit of the present application are still within the scope of protection of the present application.
[0144] In this specification, whenever the words "exemplary embodiment", "preferred embodiment", "one embodiment", or the like are used, it is meant to refer to a particular feature, structure, or characteristic described in connection with this embodiment. The appearance of the words "exemplary embodiment", "preferred embodiment", "one embodiment", or the like in various places in the specification are not necessarily all referring to the same embodiment. Furthermore, when a particular feature, structure, or characteristic is described in connection with any embodiment / embodiments, it is submitted that it is within the purview of one of ordinary skill in the art to effect such feature, structure, or characteristic in connection with other ones of the embodiments.
[0145] The embodiments of the present application are described in detail above. However, aspects of the present application are not limited to the above-described embodiments. Various modifications and replacements can be applied to the above-described embodiments without departing from the scope of the present application.
Claims
1. A method for power grid service data domain partitioning, comprising: judging a feature of power grid service data, wherein the feature comprises a descriptive feature and a discrete feature; determining a category of first data with the descriptive feature by a first model, wherein the first model comprises a text embedding ALE layer, an ATT layer, a TextRNN layer, and a softmax perception layer; determining a category of second data with the discrete feature by a second model, wherein the second model is a DeepFM model; and partitioning the power grid service data by using the category of the first data and the category of the second data. The determining of the category of the second data with the discrete feature by the second model comprises: extracting a domain continuous feature from the first data; extracting a discrete feature from the second data; performing a second-order cross calculation on the domain continuous feature and the discrete feature to obtain a calculation result; and obtaining a classification result according to the calculation result and a high-dimensional embedding of the domain continuous feature in a deep measurement.
2. The method of claim 1, wherein, The judging of the feature of the data comprises: preprocessing the data, wherein the preprocessing comprises at least one of split matching, statistics, word segmentation, and stop word removal; and extracting the feature of the preprocessed data by a bag-of-words model and / or a feature extraction model based on a word vector.
3. The method of claim 1, wherein, The determining of the category of the first data with the descriptive feature by the first model comprises: extracting domain name information, label information, and word information from the first data; vectorizing the domain name information and the label information to obtain vectorized data; vectorizing the word information to obtain a word vector; obtaining an attention value according to the word vector; converting the word vector into a fixed-length vector; and classifying the vectorized data and the fixed-length vector according to the attention value to obtain a classification result.
4. The method of claim 3, wherein, The ATT layer comprises a single layer or multiple layers. When the ATT layer is a single layer, the method further comprises: obtaining a corresponding weight according to the word vector; weighting the word vector according to the corresponding weight to obtain a weight value; and weighting and summing the word vector and the weight value to obtain the attention value. When the ATT layer is a multiple layer, the method further comprises: converting the word vector into a sentence vector on a first layer; and converting the sentence vector into a paragraph vector on a second layer.
5. The method of claim 1, wherein, The determining of the category of the first data with the descriptive feature by the first model further comprises: obtaining a keyword library; extracting a category label with the highest frequency of occurrence of each keyword from the keyword library; and re-encoding the first data so that each data group in the first data corresponds to a multi-dimensional vector, wherein each dimension in the multi-dimensional vector represents a statistical value of a category label appearing in the data group.
6. The method of claim 1, wherein, The discrete feature comprises a domain discrete feature and a source system discrete feature. The method further comprises: representing the domain discrete feature by a discrete one-hot vector; and performing a discrete value encoding process on the source system discrete feature.
7. An apparatus for power grid service data domain partitioning, comprising: a judging module configured to judge a feature of power grid service data; a determining module configured to determine a category of first data with the feature as a descriptive feature by a first model, and determine a category of second data with the feature as a discrete feature by a second model; the first model comprises a text embedding ALE layer, an ATT layer, a TextRNN layer, and a softmax perception layer; and the second model is a DeepFM model; and a domain partitioning module configured to perform power grid service data domain partitioning by using the category of the first data and the category of the second data. In the method, the determining the category of the second data with the feature as the discrete feature by the second model comprises: extracting a domain continuous feature from the first data; extracting a discretized feature from the second data; performing a second-order cross calculation on the domain continuous feature and the discretized feature to obtain a calculation result; and obtaining a classification result according to a high-dimensional embedding of the domain continuous feature in a deep measurement and the calculation result.
8. A terminal, comprising: at least one memory and at least one processor; wherein the at least one memory is configured to store program code, and the at least one processor is configured to invoke the program code stored in the at least one memory to execute the method in any one of claims 1 to 6.
9. A non-transitory storage medium for storing program code, wherein the program code is executed by a computer device to cause the computer device to execute the method in any one of claims 1 to 6.
Citation Information
Patent Citations
Source code file multi-service label automatic classification method
CN110069252A
Method for training target domain classification model through unsupervised domain adaptation
CN110880019A