Expert portrait label extraction method and device in the power field based on part-of-speech tagging and sub-character enhancement

By combining part-of-speech annotation and sub-character enhancement techniques, the problem of traditional methods being difficult to deeply understand text semantics and ignore word structure is solved, and more accurate and rich feature representation is achieved, which improves the classification effect of expert portraits in the power field.

CN118747217BActive Publication Date: 2025-04-11SHANWEI HUINENG INTEGRATED ENERGY SERVICE CO LTD +2
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410811020.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-06-21
Publication Date
2025-04-11
Estimated Expiration
2044-06-21

AI Technical Summary

Technical Problem

The traditional method of building portraits of experts in the power field is difficult to understand the deep semantics of the text in depth, and ignore the structure and correlation information inside the words, resulting in inaccurate feature representation and poor classification effect.

Method used

Using methods based on part-of-speech annotation and sub-character enhancement, the grammatical information of words is obtained through part-of-speech annotation, and a finer-grained word embedding vector is generated through sub-character enhancement technology, combining part-of-speech vectors and sub-character enhancement vectors, dynamically adjusting the feature contribution degree, and extracting long-distance dependencies.

Benefits of technology

It improves the accuracy and richness of feature representation, enhances the model's processing ability of unknown words and polysemes, improves the text feature representation method, and improves the accuracy and generalization ability of the classification model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118747217B_ABST
    Figure CN118747217B_ABST
Patent Text Reader

Abstract

The present invention discloses a method and device for extracting labels of expert portraits in the power field based on part-of-speech tagging technology and sub-character enhancement, obtains a cleaned sample set after deduplication and missing value processing of the original data; clusters the sample set and annotates the clustering results; uses Jieba to perform word segmentation and part-of-speech tagging, combines words and parts of speech to form part-of-speech vectors; decomposes Chinese words into sub-characters through Cangjie codes, generates sub-character enhanced vectors by embedding words and sub-character n-gram vectors; uses GRU update gate mechanism to fuse sub-character enhanced vectors with part-of-speech vectors; extracts local and long-range features through DPCNN to obtain the final feature vector, and then uses fully connected layers and SoftMax layers for classification to complete the label extraction of the model. The present invention combines part-of-speech tagging and sub-character enhancement technology, can more accurately capture the grammatical and semantic information of words, improve the accuracy of feature representation, and help the model better understand and process input text.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the fields of user portrait and natural language processing, and in particular to a method and device for extracting expert portrait labels in the electric power field based on part-of-speech tagging and sub-character enhancement. Background Art

[0002] In the power industry, the construction and management of expert systems is the key to improving decision-making efficiency and quality. With the increasing popularity of data-driven decision-making, how to effectively extract valuable information from a large amount of power expert-related data and build accurate expert portraits has become an important issue in the development of the industry.

[0003] Traditional methods for building expert portraits in the power sector usually rely on single data processing techniques, such as simple statistical analysis or basic machine learning methods, which often fail to deeply explore the complex relationships and potential features in the data. In addition, traditional text processing methods are difficult to fully capture semantic and grammatical information, resulting in inaccurate feature representation and poor classification results. The main problems include:

[0004] 1. Traditional text processing methods often fail to deeply understand the deep semantics of the text, which makes it difficult to accurately capture the key features of expert portraits in classification tasks.

[0005] 2. Relying solely on traditional methods such as the bag-of-words model to extract text features often ignores the internal structure and association information of words, resulting in incomplete feature representation and affecting the accuracy and generalization ability of the classification model.

[0006] 3. Existing technologies usually adopt static methods for feature fusion and lack an effective mechanism to dynamically adjust the contribution of different features, which limits the model's ability to adapt to complex data relationships.

[0007] 4. Since traditional methods have limited processing capabilities for unknown words and polysemous words, the classification effect of domain expert portraits is poor in practical applications, affecting the reliability and stability of the system. Summary of the invention

[0008] Purpose of the invention: In order to overcome the deficiencies of the above-mentioned prior art, the present invention provides a method and device for extracting labels for expert portraits in the power field based on part-of-speech tagging and sub-character enhancement. By combining part-of-speech tagging and sub-character enhancement technology, it is possible to more accurately capture the grammatical and semantic information of words, improve the accuracy of feature representation, and help the model better understand and process input text. At the same time, by generating a more fine-grained word embedding vector, it is possible to capture subtle changes and structural information within the word, enhance the model's ability to handle unseen words and polysemous words, and thus improve the richness and generalization of feature representation.

[0009] Technical solution: The present invention discloses a method for extracting expert portrait labels in the power field based on part-of-speech tagging and sub-character enhancement, comprising the following steps:

[0010] Step 1: Input the original power field expert dataset D1, remove duplicates and clear missing values ​​from the data in the dataset to obtain the cleaned sample set D2;

[0011] Step 2: Use the K-means algorithm to cluster the sample set D2, generate N clusters of power experts, and annotate the clustering results to generate the annotated sample set D4;

[0012] Step 3: Use Jieba to perform word segmentation and part-of-speech tagging, and combine words and parts of speech to form a part-of-speech vector E pos ;

[0013] Step 4: Chinese words are decomposed into sub-characters through Cangjie code, and the word embedding and sub-character n-gram vectors are used to generate sub-character enhanced vectors V cangjie ;

[0014] Step 5: Use the GRU update gate mechanism to enhance the sub-character vector V cangjie Fusion with part-of-speech vectors pos ;

[0015] Step 6: Extract local and long-range features through DPCNN to obtain the final feature vector, and then use the fully connected layer and SoftMax layer for classification to complete the label extraction of the model.

[0016] Furthermore, the specific method of step 2 is:

[0017] Step 2.1: Use the k-means algorithm to cluster the sample set D2 and obtain N clusters of cluster points;

[0018] Step 2.2: Define D3 as the clustered power expert dataset, D3 = {data1, data2, data3, ..., data N}, where data N It is the Nth expert point cluster dataset in the power field;

[0019] Step 2.3: Label the N power domain expert point clusters in the data set D3 as the power domain expert data set to generate the labeled sample set D4 = {d1, d2, ..., d a ,...,d N}, where d a ={label,data a}, where label is a text label, data a For text content.

[0020] Furthermore, the specific method of step 3 is:

[0021] Step 3.1: Use Jieba technology to segment the input text and obtain the word set S = {w1,w2,...,w m} and the corresponding part-of-speech set P = {p1,p2,...,p m}, where w i and p i Respectively represent words and corresponding part-of-speech tags, and m represents the total number of words in the text;

[0022] Step 3.2: Translate word w i and the specified part-of-speech tag p i Associated to form a sequence of word-part-of-speech pairs:

[0023] WP={<w1,p1>,<w2,p2>,...<w m ,p m >};

[0024] Step 3.3: Define the loop variable i and set its initial value to 1;

[0025] Step 3.4: If i≤m, jump to step 3.5, otherwise jump to step 3.7;

[0026] Step 3.5: Use a large-scale word-part-of-speech corpus PWE model training and introduce part-of-speech related weight factors to construct the part-of-speech vector representation of the word-part-of-speech pair sequence. The calculation formula is:

[0027]

[0028] in, Represents the part-of-speech vector of the i-th word in the text, Φ(p t+i ,p t ) indicates that from p t+i to p t The core weight factor of the part-of-speech tag related weight, represents a static word vector trained in a specific context window, and c represents the size of the context window, i.e., c words are taken from the current position to the left and right to consider;

[0029] Step 3.6: Increase the value of loop variable i and jump to step 3.4;

[0030] Step 3.7: End the loop and get the vector of the fused part of speech

[0031] Furthermore, the specific method of step 4 is:

[0032] Step 4.1: Use Jieba technology to segment the input text and obtain the word set S = {w1,w2,...,w m}, where w i represents a word, and m represents the total number of words in the text;

[0033] Step 4.2: Define the loop variable j and set its initial value to 1;

[0034] Step 4.3: If j≤m, jump to step 4.4, otherwise jump to step 4.10;

[0035] Step 4.4: For each word w j Convert to its corresponding Cangjie code form C(w j );

[0036] Step 4.5: Represent word w using bag-of-words sub-character n-grams j , let word w j The sub-character n-gram set is represented as {C j,1 ,C j,2 ,...,C j,n};

[0037] Step 4.6: Decompose the n-gram of the word according to the Cangjie code, and each n-gram is represented by C j,q , where q = 1, 2, ..., n;

[0038] Step 4.7: Take n-gram as the input of FastText model, train both sub-character n-gram and word itself, and get two types of vectors: one is word sub-character n-gram feature vector V j,q , the other is the word feature vector

[0039] Step 4.8: Take the mean of these two vectors as the embedding vector of the input word. j , whose embedding vector is composed of word embeddings and sub-character n-gram vector V j,q The mean value of is calculated, and the calculation formula is:

[0040]

[0041] Where n represents word w j The number of sub-character n-grams into which it is decomposed, Word w j The overall feature vector of V, which is the embedding representation of the word as a whole unit, j,q Word w jThe feature vector of the qth sub-character n-gram;

[0042] Step 4.9: Increase the value of loop variable j and jump to step 4.3;

[0043] Step 4.10: End the loop and get the sub-character enhanced vector V cangjie =[V1,V2,...,V m ], where V j Represents the sub-character augmented vector of the j-th word in the text.

[0044] Furthermore, the specific method of step 5 is:

[0045] Step 5.1: First, transform E pos and V cangjie The dimensions of these two vectors are aligned, and the calculation formula is: Among them, W v is the transformation matrix, represents the transformed feature vector, V represents the feature vector enhanced by the sub-character;

[0046] Step 5.2: Then, the degree of information retention is determined by the update gate mechanism of GRU, and the calculation formula is: Among them, g w Indicates the degree of information retention, E pos represents the feature vector of fused part of speech, σ represents the sigmoid activation function, and w i With w c is the weight of the update gate, b g represents the bias of the update gate;

[0047] Step 5.3: Finally, the sub-character enhanced feature vector V cangjie and the part-of-speech vector E pos The feature fusion can be expressed as: Among them, V fusion represents the fused feature vector, and g is the degree of information retention obtained from the update gate.

[0048] Furthermore, the specific method of step 6 is:

[0049] Step 6.1: Use equal-length convolution to generate features with a convolution kernel W of size h. The features generated by word embedding can be expressed by the following formula:

[0050] x i =f(WV fusion(i:i+h-1) +b)

[0051] Among them, b is the bias, h represents the size of the convolution kernel, f is the nonlinear transformation function, W is the task-specific parameter matrix, Vfusion(i:i+h-1) It refers to a subset of the feature vectors of the word embedding layer. This subset contains the feature vectors from the i-th feature vector to the i+h-1-th feature vector. The size of this subset is determined by the size of the convolution kernel.

[0052] Step 6.2: Perform maximum pooling on the convolutional features and perform residual connection. The pooling stride is 2 and the calculation formula is:

[0053]

[0054] x=px+x

[0055] Where x is the final output vector, Maxpool represents the maximum pooling operation, px is the word vector after 1 / 2 pooling, len is the sequence length, and k is the number of loops;

[0056] Step 6.3: Connect the output of the convolutional layer into a vector matrix, and use the fully connected layer and the SoftMax layer to output the final classification result. First, the final feature representation is obtained by the linear transformation of the fully connected layer: X = Wx + b, where W is the weight matrix and b is the bias; then calculate the probability P of belonging to a certain category i i :

[0057]

[0058] Among them, X i represents the final feature representation, L represents the number of categories, and W o is the weight matrix, b o is bias;

[0059] Step 6.4: Determine the classification category by selecting the category with the highest probability: Y = argmax(P i );

[0060] Step 6.5: Use the classification result as the final label extraction result to complete the label extraction of the expert portrait in the power field.

[0061] The present invention also discloses a device for extracting labels from expert portraits in the electric power field based on part-of-speech tagging and sub-character enhancement, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the device implements the above-mentioned method for extracting labels from expert portraits in the electric power field based on part-of-speech tagging and sub-character enhancement when the computer program is loaded into the processor.

[0062] Beneficial effects:

[0063] 1. The present invention improves the accuracy and precision of expert portrait labels: By combining part-of-speech tagging and sub-character enhancement technology, the method can more accurately capture the grammatical and semantic information in the expert data in the power field. This helps to build a more accurate and comprehensive expert portrait and improves the accuracy and precision of label extraction.

[0064] 2. The present invention enhances the model’s ability to handle unseen words and polysemous words: Sub-character enhancement technology can generate more fine-grained word embedding vectors, thereby enhancing the model’s ability to handle unseen words and polysemous words. This helps to improve the richness and generalization of feature representation.

[0065] 3. The present invention improves the method of text feature representation: Traditional methods often ignore the internal structure and association information of words, while the sub-character enhancement technology in the present invention can capture the structural information of words more comprehensively, thereby improving the method of text feature representation and improving the accuracy and generalization ability of the classification model.

[0066] 4. The present invention optimizes the feature fusion and classification model: by using the GRU update gate mechanism to fuse the sub-character enhanced feature vector with the part-of-speech vector, the contribution between different features can be dynamically adjusted, thereby optimizing the feature fusion process. At the same time, by utilizing the DPCNN that captures long-distance text information, our model can extract long-distance dependencies, improve the richness of word embedding, reduce the loss of key information, simplify the training of deep networks, and ultimately improve classification accuracy. BRIEF DESCRIPTION OF THE DRAWINGS

[0067] Figure 1 A diagram for the abstract;

[0068] Figure 2 It is a flow chart of the present invention;

[0069] Figure 3 Flowchart for combining words and parts of speech to form part-of-speech vectors;

[0070] Figure 4 Vector flow graph enhanced for generating sub-characters;

[0071] Figure 5 Schematic diagram of the update gate of the gating unit. DETAILED DESCRIPTION

[0072] The present invention is further explained below in conjunction with specific embodiments. It should be understood that these embodiments are only used to illustrate the present invention and are not used to limit the scope of the present invention. After reading the present invention, various equivalent forms of modifications to the present invention by those skilled in the art all fall within the scope defined by the claims attached to this application.

[0073] The present invention discloses a method and device for extracting expert portrait labels in the power field based on part-of-speech tagging and sub-character enhancement, which specifically comprises the following steps:

[0074] Step 1: Input the original power expert dataset D1, remove duplicates and clear missing values ​​from the data in the dataset, and obtain the cleaned sample set D2:

[0075] Step 1.1: Define Data = {id, content} as a single piece of data to be cleaned, where id represents the sequence number of the data and content represents the content of the data.

[0076] Step 1.2: Define D1 as the original data set, D1 = {Data1, Data2, ..., Data m ,...,Data len(D1)}, Data m is the mth data item in D1, where len(D1) is the number of data in D1, and the variable m∈[1,len(D1)];

[0077] Step 1.3: Remove duplicates and clear missing values ​​from the data set D1.

[0078] Step 1.4: Finally, we get the cleaned data set D2 = {D1, D2, ..., D n ,...,D len(D2)},Data n is the nth data item in D2, where len(D2) is the number of data in D2, and the variable n∈[1,len(D2)].

[0079] Step 2: Use the K-means algorithm to cluster the sample set D2, generate N clusters of power experts, and annotate the clustering results:

[0080] Step 2.1: Use the k-means algorithm to cluster the sample set D2 and obtain N clusters of cluster points.

[0081] Step 2.2: Define D3 as the clustered power expert dataset, D3 = {data1, data2, data3, ..., data N}, where data N It is the Nth expert point cluster dataset in the power field.

[0082] Step 2.3: Label the N power domain expert point clusters in the data set D3 as the power domain expert data set to generate the labeled sample set D4 = {d1, d2, ..., d a ,...,d N}, where da ={label,data a}, where label is a text label, data a For text content.

[0083] Step 3: Use Jieba to perform word segmentation and part-of-speech tagging, and combine words and parts of speech to form part-of-speech vectors, as follows: Figure 3 As shown:

[0084] Step 3.1: Use Jieba technology to segment the input text and obtain the word set S = {w1,w2,...,w m} and the corresponding part-of-speech set P = {p1,p2,...,p m}.

[0085] Step 3.2: Translate word w i and the specified part-of-speech tag p i Associated to form a sequence of word-part-of-speech pairs:

[0086] WP={<w1,p1>,<w2,p2>,...<w m ,p m >}.

[0087] Step 3.3: Define the loop variable i and assign its initial value to 1.

[0088] Step 3.4: If i≤m, jump to step 3.5, otherwise jump to step 3.7; where m represents the total number of words in the text.

[0089] Step 3.5: Use a large-scale word-part-of-speech corpus PWE model training and introduce part-of-speech related weight factors to construct the part-of-speech vector representation of the word-part-of-speech pair sequence. The calculation formula is:

[0090]

[0091] Among them, Φ(p t+i ,p t ) indicates that from p t+i to p t The core weight factor of the part-of-speech tag related weight, Represents a static word vector trained in a specific context window, and c represents the size of the context window, that is, c words are taken to the left and right from the current position to consider.

[0092] Step 3.6: Increase the value of loop variable i and jump to step 3.4.

[0093] Step 3.7: End the loop and get the vector of the fused part of speech in Represents the part-of-speech vector of the i-th word in the text.

[0094] Step 4: Chinese words are decomposed into sub-characters through Cangjie code, and the word embedding and sub-character n-gram vectors are used to generate sub-character enhanced vectors, as shown below: Figure 4 As shown:

[0095] Step 4.1: Use Jieba technology to segment the input text and obtain the word set S = {w1,w2,...,w m}.

[0096] Step 4.2: Define the loop variable j and assign its initial value to 1.

[0097] Step 4.3: If j≤m, jump to step 4.4, otherwise jump to step 4.10. Where m represents the total number of words in the text.

[0098] Step 4.4: For each word w j Convert to its corresponding Cangjie code form C(w j ).

[0099] Step 4.5: Represent word w using bag-of-subcharacter n-grams j , let word w j The sub-character n-gram set is represented as {C j,1 ,C j,2 ,...,C j,n}.

[0100] Step 4.6: Decompose the n-gram of the word according to the Cangjie code, and each n-gram is represented by C j,q , where q=1,2,...,n.

[0101] Step 4.7: Take n-gram as the input of FastText model, train both sub-character n-gram and word itself, and get two types of vectors: one is word sub-character n-gram feature vector V j,q , the other is the word feature vector

[0102] Step 4.8: Take the mean of these two vectors as the embedding vector of the input word. j , whose embedding vector is composed of word embeddings and sub-character n-gram vector V j,q The mean value of is calculated, and the calculation formula is:

[0103]

[0104] Where n represents word w j The number of sub-character n-grams into which it is decomposed, Word w j The overall feature vector of V, which is the embedding representation of the word as a whole unit, j,q Word w j The feature vector of the qth sub-character n-gram, where q = 1, 2, ..., n.

[0105] Step 4.9: Increase the value of loop variable j and jump to step 4.3.

[0106] Step 4.10: End the loop and get the sub-character enhanced vector V cangjie =[V1,V2,...,V m ], where V j Represents the sub-character augmented vector of the j-th word in the text.

[0107] Step 5: Use the GRU update gate mechanism to enhance the sub-character vector V cangjie and the part-of-speech vector E pos Fusion, such as Figure 5 As shown:

[0108] Step 5.1: First, transform E pos and V cangjie The dimensions of these two vectors are aligned, and the calculation formula is:

[0109]

[0110] Among them, W v is the transformation matrix, represents the transformed feature vector, and V represents the feature vector enhanced by the sub-character.

[0111] Step 5.2: Then, the degree of information retention is determined by the update gate mechanism of GRU, and the calculation formula is:

[0112]

[0113] Among them, g w Indicates the degree of information retention, E pos represents the feature vector of fused part of speech, σ represents the sigmoid activation function, and w i With w c is the weight of the update gate, b g Represents the bias of the update gate.

[0114] Step 5.3: Finally, the sub-character enhanced feature vector V cangjie and the part-of-speech vector E posThe feature fusion can be expressed as:

[0115]

[0116] Among them, V fusion represents the fused feature vector, and g is the degree of information retention obtained from the update gate.

[0117] Step 6: Extract local and long-range features through DPCNN to obtain the final feature vector, and then use the fully connected layer and SoftMax layer for classification to complete the label extraction of the model:

[0118] Step 6.1: Use equal-length convolution to generate features with a convolution kernel W of size h. The features generated by word embedding can be expressed by the following formula:

[0119] x i =f(WV fusion(i:i+h-1) +b)

[0120] Among them, b is the bias, h represents the size of the convolution kernel, f is the nonlinear transformation function, W is the task-specific parameter matrix, V fusion(i:i+h-1) It refers to a subset of the feature vectors of the word embedding layer. This subset contains the feature vectors from the i-th feature vector to the i+h-1-th feature vector. The size of this subset is determined by the size of the convolution kernel.

[0121] The calculation formula is:

[0122]

[0123] x=px+x

[0124] Where x is the final output vector, Maxpool represents the maximum pooling operation, px is the word vector after 1 / 2 pooling, len is the sequence length, and k is the number of loops;

[0125] Step 6.3: Connect the output of the convolutional layer into a vector matrix, and use the fully connected layer and the SoftMax layer to output the final classification result. First, the final feature representation is obtained by the linear transformation of the fully connected layer: X = Wx + b, where W is the weight matrix and b is the bias; then calculate the probability P of belonging to a certain category i i :

[0126]

[0127] Among them, X i represents the final feature representation, L represents the number of categories, and W o is the weight matrix, b o is bias;

[0128] Step 6.4: Determine the classification category by selecting the category with the highest probability: Y = argmax(P i ).

[0129] Step 6.5: Use the classification result as the final label extraction result to complete the label extraction of the expert portrait in the power field.

[0130] Step 6.6: Save and encapsulate the model as a label extraction method for expert portraits in the power field enhanced by part-of-speech tagging technology and sub-character enhancement.

[0131] The present invention discloses a device for extracting labels for expert portraits in the electric power field based on part-of-speech tagging and sub-character enhancement, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor. When the computer program is loaded into the processor, the method for extracting labels for expert portraits in the electric power field based on part-of-speech tagging technology and sub-character enhancement is implemented.

[0132] The above embodiments are only for illustrating the technical concept and features of the present invention, and their purpose is to enable people familiar with the technology to understand the content of the present invention and implement it accordingly, and they cannot be used to limit the protection scope of the present invention. Any equivalent transformation or decoration made according to the spirit of the present invention should be included in the protection scope of the present invention.

Claims

1. A method for extracting expert portrait labels in the power field based on part-of-speech tagging and sub-character enhancement, characterized in that: The steps include: Step 1: Input the original power field expert dataset D1, remove duplicates and clear missing values ​​from the data in the dataset to obtain the cleaned sample set D2; Step 2: Use the K-means algorithm to cluster the sample set D2, generate N clusters of power experts, and annotate the clustering results to generate the annotated sample set D4; Step 3: Use Jieba to perform word segmentation and part-of-speech tagging, and combine words and parts of speech to form a part-of-speech vector E pos ; Step 4: Use Jieba technology to segment the input text and obtain a word set. Convert each word in the word set into the corresponding Cangjie code form, and use sub-character n-grams bag of words to represent the word to obtain a sub-character n-gram set. Decompose the word n-gram according to the Cangjie code to obtain each sub-character n-gram. Use the sub-character n-gram as the input of the FastText model, train both the sub-character n-gram and the word itself, and obtain two types of vectors: one is the word sub-character n-gram feature vector, and the other is the word feature vector. The mean of these two vectors is used as the embedding vector of the input word, and finally the sub-character enhanced vector V is obtained. cangjie ; Step 5: Use the GRU update gate mechanism to enhance the sub-character vector V cangjie Fusion with part-of-speech vectors pos ; Step 6: Extract local and long-range features through DPCNN to obtain the final feature vector, and then use the fully connected layer and SoftMax layer for classification to complete the label extraction of the model.

2. The method for extracting expert portrait labels in the power field based on part-of-speech tagging and sub-character enhancement according to claim 1 is characterized in that: The specific method of step 2 is: Step 2.1: Use the k-means algorithm to cluster the sample set D2 and obtain N clusters of cluster points; Step 2.2: Define D3 as the clustered power expert dataset, D3 = {data1, data2, data3, ..., data N }, where data N It is the Nth expert point cluster dataset in the power field; Step 2.3: Label the N power domain expert point clusters in the data set D3 as the power domain expert data set to generate the labeled sample set D4 = {d1, d2, ..., d a ,...,d N }, where d a ={label,data a }, where label is a text label, data a For text content.

3. The method for extracting expert portrait labels in the power field based on part-of-speech tagging and sub-character enhancement according to claim 1 is characterized in that: The specific method of step 3 is: Step 3.1: Use Jieba technology to segment the input text and obtain the word set S = {w1,w2,...,w m } and the corresponding part-of-speech set P = {p1,p2,...,p m }, where w i and p i Respectively represent words and corresponding part-of-speech tags, and m represents the total number of words in the text; Step 3.2: Translate word w i and the specified part-of-speech tag p i Associated to form a sequence of word-part-of-speech pairs: W-P={<w1,p1>,<w2,p2>,...<w m ,p m >}; Step 3.3: Define the loop variable i and set its initial value to 1; Step 3.4: If i≤m, jump to step 3.5, otherwise jump to step 3.7; Step 3.5: Use a large-scale word-part-of-speech corpus PWE model training and introduce part-of-speech related weight factors to construct the part-of-speech vector representation of the word-part-of-speech pair sequence. The calculation formula is: in, Represents the part-of-speech vector of the i-th word in the text, Φ(p t+i ,p t ) indicates that from p t+i to p t The core weight factor of the part-of-speech tag related weight, represents a static word vector trained in a specific context window, and c represents the size of the context window, i.e., c words are taken from the current position to the left and right to consider; Step 3.6: Increase the value of loop variable i and jump to step 3.4; Step 3.7: End the loop and get the vector of the fused part of speech 4. The method for extracting expert portrait labels in the power field based on part-of-speech tagging and sub-character enhancement according to claim 1 is characterized in that: The specific method of step 4 is: Step 4.1: Use Jieba technology to segment the input text and obtain the word set S = {w1,w2,...,w m }, where w i represents a word, and m represents the total number of words in the text; Step 4.2: Define the loop variable j and set its initial value to 1; Step 4.3: If j≤m, jump to step 4.4, otherwise jump to step 4.10; Step 4.4: For each word w j Convert to its corresponding Cangjie code form C(w j ); Step 4.5: Represent word w using bag-of-words sub-character n-grams j , let word w j The sub-character n-gram set is represented as {C j,1 ,C j,2 ,...,C j,n }; Step 4.6: Decompose the sub-character n-gram of the word according to the Cangjie code, and each sub-character n-gram is represented by C j,q , where q = 1, 2, ..., n; Step 4.7: Use sub-character n-grams as input to the FastText model, train both sub-character n-grams and words themselves, and obtain two types of vectors: one is the word sub-character n-gram feature vector V j,q , the other is the word feature vector Step 4.8: Take the mean of these two vectors as the embedding vector of the input word. For a given word w j , whose embedding vector is composed of word embeddings and sub-character n-gram vector V j,q The mean value of is calculated, and the calculation formula is: Where n represents word w j The number of sub-character n-grams into which it is decomposed, Representation word w j The overall feature vector of V, which is the embedding representation of the word as a whole unit, j,q Representation word w j The feature vector of the qth sub-character n-gram; Step 4.9: Increase the value of loop variable j and jump to step 4.3; Step 4.10: End the loop and get the sub-character enhanced vector V cangjie =[V1,V2,...,V m ], where V j Represents the sub-character augmented vector of the j-th word in the text.

5. The method for extracting expert portrait labels in the power field based on part-of-speech tagging and sub-character enhancement according to claim 1 is characterized in that: The specific method of step 5 is: Step 5.1: First, transform E pos and V cangjie The dimensions of these two vectors are aligned, and the calculation formula is: Among them, W v is the transformation matrix, represents the transformed feature vector, V represents the feature vector enhanced by the sub-character; Step 5.2: Then, the degree of information retention is determined by the update gate mechanism of GRU, and the calculation formula is: Among them, g w Indicates the degree of information retention, E pos represents the feature vector of fused part of speech, σ represents the sigmoid activation function, and w q With w c is the weight of the update gate, b g represents the bias of the update gate; Step 5.3: Finally, the sub-character enhanced feature vector V cangjie and the part-of-speech vector E pos The feature fusion can be expressed as: Among them, V fusion represents the fused feature vector, and g is the degree of information retention obtained from the update gate.

6. The method for extracting expert portrait labels in the power field based on part-of-speech tagging and sub-character enhancement according to claim 1 is characterized in that: The specific method of step 6 is: Step 6.1: Use equal-length convolution to generate features with a convolution kernel W of size h. The features generated by word embedding can be expressed by the following formula: x i =f(WV fusion(i:i+h-1) +b) Among them, b is the bias, h represents the size of the convolution kernel, f is the nonlinear transformation function, W is the task-specific parameter matrix, V fusion(i:i+h-1) It refers to a subset of the feature vectors of the word embedding layer. This subset contains the feature vectors from the i-th feature vector to the i+h-1-th feature vector. The size of this subset is determined by the size of the convolution kernel. Step 6.2: Perform maximum pooling on the convolutional features and perform residual connection. The pooling stride is 2 and the calculation formula is: x=px+x Where x is the final output vector, Maxpool represents the maximum pooling operation, px is the word vector after 1 / 2 pooling, len is the sequence length, and k is the number of loops; Step 6.3: Connect the output of the convolutional layer into a vector matrix, and use the fully connected layer and the SoftMax layer to output the final classification result. First, the final feature representation is obtained by the linear transformation of the fully connected layer: X = Wx + b, where W is the weight matrix and b is the bias; then calculate the probability P of belonging to a certain category i i : Among them, X i represents the final feature representation, L represents the number of categories, and W o is the weight matrix, b o is bias; Step 6.4: Determine the classification category by selecting the category with the highest probability: Y = argmax(P i ); Step 6.5: Use the classification result as the final label extraction result to complete the label extraction of the expert portrait in the power field.

7. A device for extracting labels of expert portraits in the power field based on part-of-speech tagging and sub-character enhancement, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the computer program is loaded into a processor, it implements the method for extracting labels for expert portraits in the power field based on part-of-speech tagging and sub-character enhancement according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Intelligent voice outbound method for deep learning fault text information extraction

    CN115222071A

  • Industrial text entity extraction method based on sememe analysis and span characteristics

    CN116304020A