Evaluation object extraction method and device based on convolutional neural network

Through the method based on convolutional neural network, the problem of inefficiency of the existing RNN model is solved, efficient and accurate evaluation object extraction is achieved, and GPU parallel computing and contextual features can be fully utilized.

CN112883713BActive Publication Date: 2025-02-14INDUSTRIAL AND COMMERCIAL BANK OF CHINA
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202110205277.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-02-24
Publication Date
2025-02-14
Estimated Expiration
2041-02-24

AI Technical Summary

Technical Problem

The existing RNN-based evaluation object extraction method has the aforementioned dependence, and cannot fully utilize the parallel computing power of the GPU, resulting in inefficient and inability to integrate the context characteristics of the evaluation object.

Method used

Using a method based on convolutional neural network (CNN), the word label score matrix is ​​generated by obtaining the statement text and inputting it into the CNN model based on the above and below word vector matrices. The word label score matrix is ​​generated to determine the word labels of each word , and finally extract the words corresponding to the word label of the evaluation object.

Benefits of technology

The efficiency and accuracy of the extraction of evaluation objects is improved, the parallel computing power of the GPU is fully utilized, and the context characteristics of the evaluation objects can be integrated.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112883713B_ABST
    Figure CN112883713B_ABST
Patent Text Reader

Abstract

The present invention provides an evaluation object extraction method and device based on a convolutional neural network, belonging to the field of artificial intelligence technology. The evaluation object extraction method based on a convolutional neural network includes: obtaining a sentence text and generating a word vector matrix according to each word in the sentence text; inputting the word vector matrix into a word label model created based on a previous word vector matrix, a following word vector matrix and a preset convolutional neural network model to obtain a word label score matrix; determining the word label of each word according to the word label score matrix; wherein the word label includes an evaluation object word label; extracting the word corresponding to the evaluation object word label as the evaluation object. The present invention can improve the efficiency and accuracy of extracting evaluation objects.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of artificial intelligence technology, and in particular to a method and device for extracting evaluation objects based on a convolutional neural network. Background Art

[0002] The emergence and popularization of the Internet has brought a large amount of information. Like other data, text reviews are also constantly generated from the Internet. For example, many e-commerce platforms such as Taobao, Tmall and JD.com allow users to evaluate purchased products; music platforms such as NetEase Cloud Music and QQ Music allow singers to evaluate songs released; popular social platforms such as Twitter and Weibo allow users to evaluate each other's posts. Among them, text comments contain users' emotional tendencies towards the evaluation object, that is, users express their preference for the evaluation object through comments. Therefore, sentiment analysis of comment information is an effective method and way to assist decision-making and optimize evaluation objects. Evaluation object extraction is a basic and key task in the field of text sentiment analysis. It refers to correctly extracting words or phrases that constitute the target evaluation object from the comment text. It can also be regarded as a sequence labeling task and a fine-grained extraction task. A comment text may contain multiple evaluation objects. It is difficult to complete the correct extraction. Therefore, the extraction of evaluation objects has received widespread attention and there are many solutions. In recent years, with the development of word vector technology, deep learning-based methods can automatically extract the semantic features of text, avoiding the tedious process and uncertainty of manual feature extraction, so it can be widely used to solve problems in this field. Methods based on deep learning mainly include two categories: Convolutional Neural Network (CNN) and Recurrent Neural Network (RNN). Among them, the RNN model has the ability to remember sequence information and has certain advantages in sequence modeling, but the general RNN model has more parameters, and each step of calculation requires the result of the previous step. Therefore, the RNN model fails to give full play to the parallel capability of the GPU and the training time is relatively long, which reduces the efficiency of extracting evaluation objects; in addition, the RNN model cannot integrate the contextual features of the evaluation object and perform accurate recognition. Summary of the invention

[0003] The main purpose of the embodiments of the present invention is to provide a method and device for extracting evaluation objects based on convolutional neural networks to improve the efficiency and accuracy of extracting evaluation objects.

[0004] In order to achieve the above object, an embodiment of the present invention provides an evaluation object extraction method based on a convolutional neural network, comprising:

[0005] Obtain a sentence text and generate a word vector matrix according to each word in the sentence text;

[0006] Input the word vector matrix into the word label model created based on the previous word vector matrix, the following word vector matrix and the preset convolutional neural network model to obtain the word label score matrix;

[0007] Determine the word label of each word according to the word label score matrix; wherein the word label includes the evaluation object word label;

[0008] The word corresponding to the evaluation object word label is extracted as the evaluation object.

[0009] The embodiment of the present invention further provides an evaluation object extraction device based on a convolutional neural network, comprising:

[0010] A word vector matrix acquisition module is used to acquire a sentence text and generate a word vector matrix according to each word in the sentence text;

[0011] A word label score matrix module is used to input the word vector matrix into a word label model created based on the previous word vector matrix, the following word vector matrix and a preset convolutional neural network model to obtain a word label score matrix;

[0012] A word label module, used to determine the word label of each word according to the word label score matrix; wherein the word label includes the evaluation object word label;

[0013] The evaluation object extraction module is used to extract the words corresponding to the evaluation object word labels as evaluation objects.

[0014] An embodiment of the present invention also provides a computer device, including a memory, a processor, and a computer program stored in the memory and running on the processor. When the processor executes the computer program, the steps of the evaluation object extraction method based on convolutional neural network are implemented.

[0015] An embodiment of the present invention also provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps of the evaluation object extraction method based on a convolutional neural network are implemented.

[0016] The evaluation object extraction method and device based on convolutional neural network in the embodiment of the present invention first generates a word vector matrix according to each word in the sentence text, and then inputs the word vector matrix into the word label model to obtain a word label score matrix to determine the word label of each word, and finally extracts the word corresponding to the evaluation object word label as the evaluation object, which can improve the efficiency and accuracy of extracting the evaluation object. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0018] Figure 1 is a flow chart of an evaluation object extraction method based on a convolutional neural network in one embodiment of the present invention;

[0019] Figure 2 is a functional schematic diagram of extracting evaluation objects in a specific embodiment of the present invention;

[0020] Figure 3 is a flow chart of creating a word tag model in an embodiment of the present invention;

[0021] Figure 4 is a flowchart of creating a word tag model in another embodiment of the present invention;

[0022] Figure 5 is a flow chart of S201 in an embodiment of the present invention;

[0023] Figure 6 is a flow chart of S301 in an embodiment of the present invention;

[0024] Figure 7 is a flow chart of S302 in an embodiment of the present invention;

[0025] Figure 8 is a schematic diagram of BIO labeling in an embodiment of the present invention;

[0026] Fig. 9 is a schematic diagram of dividing the preceding text and following text corresponding to the evaluation object in an embodiment of the present invention;

[0027] Fig.10 Schematic diagram of generating the above word vector matrix in an embodiment of the present invention;

[0028] Fig.11 is a structural diagram of a word tag model in an embodiment of the present invention;

[0029] Fig.12 It is a structural block diagram of an evaluation object extraction device based on a convolutional neural network in an embodiment of the present invention;

[0030] Fig.13 is a structural block diagram of a word tag model creation module in another embodiment of the present invention;

[0031] Fig.14 It is a structural block diagram of a computer device in an embodiment of the present invention. DETAILED DESCRIPTION

[0032] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0033] Those skilled in the art will appreciate that the embodiments of the present invention may be implemented as a system, device, apparatus, method or computer program product. Therefore, the present disclosure may be specifically implemented in the following forms, namely: complete hardware, complete software (including firmware, resident software, microcode, etc.), or a combination of hardware and software.

[0034] In view of the fact that the prior art mainly uses recurrent neural networks to solve the problem of evaluation object extraction, which has a preceding dependency, that is, the next step of calculation needs to rely on the calculation result of the previous step, and cannot fully utilize the parallel computing capability of the GPU, an embodiment of the present invention provides an evaluation object extraction method based on a convolutional neural network, which can integrate the contextual features of the evaluation objects into a CNN model with efficient computing capability, give full play to the parallel computing capability of the GPU, speed up the model training speed, and make the model more humanized, thereby improving the efficiency and accuracy of extracting evaluation objects.

[0035] The present invention aims to solve the antecedent dependency problem generated by the traditional RNN-based model. For the CNN model, its model structure is relatively simple and can be parallelized, which can give full play to the parallel computing capability of the GPU; in addition, the context of the sentence in which the evaluation object is located will have a great impact on the judgment. The present invention makes full use of the processing capability of the CNN model for parallel computing, and at the same time incorporates the contextual features of the evaluation object to enrich the feature representation of the model, so that the extraction task can be completed more quickly and efficiently.

[0036] Figure 1 It is a flow chart of an evaluation object extraction method based on a convolutional neural network in one embodiment of the present invention. Figure 2 FIG. 1 is a functional schematic diagram of extracting evaluation objects in a specific embodiment of the present invention. Figure 1 to Figure 2 As shown, the evaluation object extraction message anomaly recognition method based on convolutional neural network includes:

[0037] S101: Obtain a sentence text and generate a word vector matrix according to each word in the sentence text.

[0038] For example, the sentence text S′ consists of m words, then S′={id1,id2,...,id m}, the elements in S′ are the random ids assigned to each word in the sentence text in the corpus dictionary, then the generated word vector matrix X is:

[0039] X={u1,u2,...,u m},u i =e i W E ;

[0040] Among them, W E is the word embedding vector corresponding to all words in the corpus (corpus word embedding matrix), with a dimension of [z,300], representing the word vector set of all words in the corpus. z is the number of words in the corpus. i ={0,0,...,1,...,0} is a one-hot vector with dimension [1,z], where only one position is 1, corresponding to the id of the i-th word i The number in the corpus word dictionary, that is, according to id i Create the number in the corpus word dictionary i .e i W E Equivalent to W E Take out the id of the i-th word i The word vector u at the location i .

[0041] S102: Input the word vector matrix into a word label model created based on the previous word vector matrix, the following word vector matrix and a preset convolutional neural network model to obtain a word label score matrix.

[0042] S103: Determine the word label of each word according to the word label score matrix.

[0043] The word labels include evaluation object word labels. The word labels include a first evaluation object word label BA, a second evaluation object word label IA and a non-evaluation object word label O; the evaluation object word label includes a first evaluation object word label BA and a second evaluation object word label IA.

[0044] In specific implementation, the word label model outputs a word label score matrix, and the word label score of each word can be obtained according to the word label score matrix. Each word corresponds to three word label scores, and the word label corresponding to the maximum value of the word label scores is determined as the word label of the corresponding word.

[0045] S104: Extract the word corresponding to the evaluation object word label as the evaluation object.

[0046] During specific implementation, words corresponding to BA and IA may be extracted as evaluation objects.

[0047] like Figure 2As shown in the figure, the sentence (Sentence), that is, the sentence text, is transformed and handed over to the convolutional neural network model (CNN Based Sys) to extract the evaluation object (Result) in the sentence.

[0048] Figure 1 The execution subject of the evaluation object extraction method based on convolutional neural network shown in the figure can be a computer. Figure 1 As can be seen from the process shown, the evaluation object extraction method based on convolutional neural network in the embodiment of the present invention first generates a word vector matrix according to each word in the sentence text, and then inputs the word vector matrix into the word label model to obtain a word label score matrix to determine the word label of each word, and finally extracts the word corresponding to the evaluation object word label as the evaluation object, which can improve the efficiency and accuracy of extracting the evaluation object.

[0049] Figure 3 A flowchart of creating a word tag model in an embodiment of the present invention. Figure 4 FIG. 1 is a flowchart of creating a word tag model in another embodiment of the present invention. Figure 4 As shown in the figure, in the specific implementation, a segmented convolutional neural network model can be designed for the extraction task, and the word vector matrix of the training set is used as the input of the model to extract the sentence context features divided by the evaluation object. The word vector matrix containing the sentence context information is input into a conditional random field (CRF) algorithm to predict the label and train the model; the trained model is tested with the test set to verify the effect. Figure 3 As shown, creating a word label model includes:

[0050] Perform the following iterative processing:

[0051] S201: Obtain a model score matrix according to the previous word vector matrix, the following word vector matrix, and the model parameters in the convolutional neural network model.

[0052] The model parameters include: a previous convolution filter, a previous bias item, a next convolution filter, a next bias item, a first linear transformation parameter, a second linear transformation parameter, a third linear transformation parameter, and a score bias item. The previous bias item includes a first previous bias item and a second previous bias item; the next bias item includes a first next bias item and a second next bias item.

[0053] In one embodiment, before executing S201, the method further includes:

[0054] 1. Obtain the historical sentence text, and divide the historical sentence text into the preceding text and the following text corresponding to the evaluation object in the historical sentence text.

[0055] like Figure 4As shown, in specific implementation, for a given sentence (historical sentence text and the sentence text in S101), a word segmentation tool can be used to perform word segmentation processing; in addition, the BIO method can be used to label the words in the historical sentence text. Finally, the word segmentation results are serialized, and the historical sentence text is divided into the previous text and the following text according to the evaluation object, and filled to the same length.

[0056] Figure 8 FIG. 1 is a schematic diagram of a BIO label in an embodiment of the present invention. Figure 8 As shown, the present invention regards the evaluation object extraction task as a problem of sentence sequence annotation. Given the example sentence "The shooting effect of Huawei mate40 camera has improved a lot compared to last year". First, for a given sentence, it is necessary to perform word segmentation processing on it to obtain the sequence composition structure of the sentence. The word segmentation algorithm can be divided into three categories, including string-based matching methods, understanding-based word segmentation methods, and statistical-based word segmentation methods. On the basis of these three methods, word segmentation tools such as jieba, NLPIR, and LTP are derived. Preferably, the present invention uses the jieba word segmentation tool to perform word segmentation processing on the sentence text in the corpus. For example, for a given example sentence, the word segmentation result obtained by using the jieba tool according to the part of speech classification is: {Huawei / n, mate40 / n, camera / n, of / u, shooting effect / n, compared to / v, in / p, last year / n, said / v, improved / v, had / u, not less / a}, where the label n is the noun part of speech, u is the auxiliary word part of speech, p is the preposition part of speech, v is the verb part of speech, and a is the adjective part of speech.

[0057] After obtaining the word segmentation results, the BIO method is used to assign corresponding labels to each word in the sentence according to the task requirements, which includes 3 labels: [BA, IA, O], BA represents the first word that constitutes the evaluation object, IA represents the words that constitute the evaluation object except BA, and O represents the words in the sentence that do not constitute the evaluation object. BA and IA constitute the evaluation object. Finally, the word segmentation results and corresponding label sets of the sentences in the corpus are divided into a training set and a test set with a ratio of 8:2. The previous word vector matrix and the following word vector matrix in S201 are the data corresponding to the historical sentence text in the training set.

[0058] Fig. 9 Schematic diagram of dividing the preceding text and following text corresponding to the evaluation object in an embodiment of the present invention. Fig. 9 As shown, the corpus consists of n independent sentences S = {S1, S2, ..., S n}, select one of the sentences S t , assuming that the sentence consists of m words, then S t ={id1,id2,...,id m},S t The elements in are random ids assigned to the words that make up the sentence in the corpus dictionary. Obviously, a sentence text may contain multiple evaluation objects, so the set consisting of the number of evaluation objects contained in each sentence (sentence text) is A = {A1, A2, ..., A v}. Suppose sentence S t (A t =2) contains two evaluation objects a1 and a2, whose corresponding positions in the sentence are marked as [e1, s1] and [e2, s2] respectively. Then the sentence S t The evaluation object a1 can be divided into two parts up1 and down1, where up1 = {id1, ..., s1} contains the previous information (previous text) of the evaluation object a1, and down1 = {e1, ..., id m} contains the following information (the following text) of the evaluation object. Similarly, sentence S t The evaluation object a2 may also be divided into an upper text up2 and a lower text down2 including the evaluation object a2.

[0059] 2. Generate the previous word vector matrix based on the previous text, and generate the following word vector matrix based on the following text.

[0060] In specific implementation, the word ID can be mapped to a vector representation by loading the pre-trained word embedding vector. A sentence is taken as a whole to form a word vector matrix of the sentence as the model input.

[0061] In order to better represent the semantic features expressed by words, the industry uses neural network algorithms to train language models, embedding words into a space with lower dimensions and fixed, and obtaining a more dense word embedding vector representation that contains word semantics. At present, the methods of training word embedding based on neural networks include the most basic neural language model (NNLM), and its optimization methods include Word2Vec algorithm, GloVe algorithm and FastText algorithm. Preferably, the present invention selects GloVe algorithm to pre-train word vectors, which is a new word matrix generation method proposed by Stanford University, which comprehensively uses the global statistical information and local statistical information of words to generate language models and vectorized representations of words.

[0062] Fig.10 Schematic diagram of generating the above word vector matrix in an embodiment of the present invention. Fig.10 As shown in the figure, taking the generation of the above word vector matrix based on the above text as an example, the above text sequence containing the evaluation object and its above content is up = {id1, id2, ..., id5}, then the corresponding above word vector (above embedding matrix) X is generated.up The process is expressed as:

[0063] X up ={u1,u2,...,u5},u i =e i W E ;

[0064] Among them, W E is the word embedding vector corresponding to all words in the corpus (corpus word embedding matrix), with a dimension of [z,300], representing the word vector set of all words in the corpus. z is the number of words in the corpus. i ={0,0,...,1,...,0} is a one-hot vector with dimension [1,z], where only one position is 1, corresponding to the id of the i-th word i The number in the corpus word dictionary. That is, according to id i Create the number in the corpus word dictionary i .e i W E Equivalent to W E Take out the id of the i-th word i The word vector u at the location i Obviously, the following word vector matrix X down It can also be obtained by this method. This operation can be implemented by the word vector search method provided by the deep learning framework.

[0065] Figure 5 is a flow chart of S201 in an embodiment of the present invention. Figure 5 As shown, S201 includes:

[0066] S301: Obtain a context feature matrix according to the context word vector matrix, the context convolution filter, the context bias item and the first linear transformation parameter.

[0067] Fig.11 is a structural diagram of the word tag model in an embodiment of the present invention. Fig.11 As shown, Fig.11 It includes convolution calculation for context feature extraction, linear transformation for fusing context features, and the process of extracting results by CRF.

[0068] Figure 6 is a flow chart of S301 in an embodiment of the present invention. Figure 6 As shown, S301 includes:

[0069] S401: Obtain a context feature map matrix according to the context word vector matrix, the context convolution filter and the first context bias item.

[0070] like Fig.11As shown in the figure, assuming that a sentence contains two evaluation objects a1 and a2, the word vector matrix corresponding to the first evaluation object a1 is X up 1 , the following word vector matrix corresponding to the first evaluation object a1 is X down 1 , the word vector matrix corresponding to the second evaluation object a2 is X up 2 , the following word vector matrix corresponding to the second evaluation object a2 is X down 2 Assuming that the maximum length of a sentence in a corpus containing n historical sentence texts is L, in order to meet the input format of the model, it is necessary to fill the input matrix with 0 vectors to the same dimension size, and unify its filling dimension to [L, 300]. For any sentence (historical sentence text), the convolution calculation process of obtaining the contextual features of the evaluation object can be expressed as:

[0071]

[0072] in, is the element in the i-th row and j-th column of the feature map matrix of the k-th evaluation object, f is the nonlinear activation function ReLU, * is the convolution calculation, X up k is the context word vector matrix of the kth evaluation object, is the j-th column element in the convolution filter above the k-th evaluation object, b up k (j) is the j-th column element in the first context bias item of the k-th evaluation object. The dimension is [w,300], w is the size of the convolution window (convolution kernel width), and its value is {3, 5}, the purpose is to obtain the semantic features of different context words containing the central word. For example, when w = 3, the semantic features containing the central word and one word above and below the central word are extracted, and when w = 5, the semantic features containing the central word and two words above and below the central word are extracted. up k The convolution step size is 1, and the first and last words with insufficient context are filled with 0 to ensure that every word in the sentence is covered. a ], used to indicate the first evaluation object in the sentence text, n a is the number of evaluation objects in the corresponding sentence text. i∈[1,L] represents the row index of the feature graph matrix, and its maximum value is L, which is the maximum length of the historical sentence text. j∈[1,n conv ], represents the column label of the feature map matrix, n conv is the number of feature maps, and multiple convolutional filters are used to extract different features.

[0073] S402: Obtain a context feature matrix according to the context feature map matrix, the second context bias term, and the first linear conversion parameter.

[0074] Among them, the above feature matrix U can be obtained by concatenating the above feature map matrices and performing linear transformation through the following formula:

[0075]

[0076] U is the above feature matrix, W1 is the first linear transformation parameter, and b1 is the second above bias term.

[0077] S302: Obtain a context feature matrix according to the context word vector matrix, the context convolution filter, the context bias term and the second linear conversion parameter.

[0078] Figure 7 is a flow chart of S302 in an embodiment of the present invention. Figure 7 As shown, S302 includes:

[0079] S501: Obtain a context feature map matrix according to the context word vector matrix, the context convolution filter and the first context bias item.

[0080] In one embodiment, the following feature map matrix can be obtained by the following formula:

[0081]

[0082] in, is the element in the i-th row and j-th column of the feature map matrix of the k-th evaluation object, X down k is the context word vector matrix of the kth evaluation object, is the j-th column element in the convolution filter of the context of the k-th evaluation object, b down k (j) is the j-th column element in the first context bias item of the k-th evaluation object. The dimension of is [w,300], w is the size of the convolution window (convolution kernel width), and its value is {3, 5}. down k The convolution step size is 1, and the first and last words with insufficient context are filled with 0 to ensure that every word in the sentence is covered.

[0083] S502: Obtain a context feature matrix according to the context feature map matrix, the second context bias term and the second linear conversion parameter.

[0084] Among them, the following feature matrix D can be obtained by concatenating the following feature map matrices and performing linear transformation through the following formula:

[0085]

[0086] D is the context feature matrix, W2 is the second linear transformation parameter, and b2 is the second context bias term.

[0087] S303: Obtain a model score matrix according to the previous feature matrix, the following feature matrix, the third linear transformation parameter and the score bias term.

[0088] In order to integrate the contextual features of the evaluation object, the above feature matrix U and the following feature matrix D need to be concatenated and linearly mapped again to obtain the score matrix R predicted by the model for each label in the sentence word. The specific formula is as follows:

[0089]

[0090] Among them, R is the model score matrix with a dimension of [L,3], which means the score of each word in the sentence corresponding to three labels, W is the third linear transformation parameter, and b is the score bias term.

[0091] S202: Determine a loss function according to the model score matrix and the transfer score matrix.

[0092] In one embodiment, the loss function of the model may be determined by calculating the transfer score, and the model parameters may be further optimized according to the loss function. In this case, S202 includes:

[0093] 1. Determine the actual label transfer path score based on the model score matrix and the transfer score matrix.

[0094] Since the score matrix predicted by the model alone will cause unreasonable conversions between labels, resulting in inaccurate label predictions, the CRF algorithm is needed to restrict the transfer between labels and let the CRF algorithm learn these constraints through training. There is no need to manually establish constraints, which will make the iterative process of the matrix more reasonable.

[0095] As above, let the maximum length of a sentence be L. The CRF algorithm uses the model score matrix R and its defined transfer score matrix A as input, where the dimension of A is [L, L] and can be randomly initialized during model training. Obviously, there are 3 possible label combinations for a sentence of length L in the evaluation object extraction task. L Each different combination is called a transfer path. The purpose of CRF training is to highlight the proportion of the actual label transfer path score of the sentence, so as to optimize the parameters of the model.

[0096] by Figure 8 Taking the sentence text in as an example, the actual label value y={y1,y2,...,y 11}={O,O,O,BA,IA,O,...,O}, let x={R 1,O ,R 2,O ,R 3,O ,R 4,B-A ,...,R 11,O} is the model output score of the actual label, and the elements in it represent the score value of the word in the sentence as the actual label, which can be obtained from the model output result. The transfer path of the actual label can be expressed as {y1→y2,y2→y3,...,y 10 →y 11}, that is, {O->O,O->O,O->O,O->BA,BA->IA,...,O->O}. The actual label transfer path score score(x,y) calculated by the CRF algorithm is expressed as the transfer score matrix A plus the model score matrix R:

[0097]

[0098] in, Indicates that from the actual label y l To the actual label y l+1 The transfer score value of the transfer. The actual label value corresponding to the index lth word in the sentence is y l The model score.

[0099] 2. Determine the loss function based on the actual label transfer path score.

[0100] Among them, the loss function is the negative log-likelihood function of the label sequence, which can be determined by the following formula:

[0101]

[0102]

[0103] p(y|x) is the probability of label y given x, where Y x is the set of all label transfer paths in the sentence, the numerator is the score of the actual label, and the denominator is the sum of the scores of other paths except the transfer path of the actual label. loss is the negative logarithmic loss function, with base e.

[0104] When predicting unknown data, i.e., test set data, the dynamic programming algorithm Viterbi algorithm is used to select the path with the highest score as the prediction result of the sentence label.

[0105] S203: Determine whether the current number of iterations reaches a preset number of iterations.

[0106] Table 1

[0107]

[0108] Table 1 is a table of word label model parameters. The present invention selects the deep learning framework tensorflow to build and train the model. The tensorflow deep learning framework is an end-to-end open source deep learning platform that enables developers to easily deploy deep learning models of different structures designed by them. Among them, epoch means that the model needs to be trained 50 times, that is, the preset number of iterations is 50, and batchsize means that in a training process, 64 historical sentence texts are processed each time until the corpus traversal is completed. n conv is the number of feature maps, w is the width of the convolution kernel, which can be obtained by n conv and w are designed to extract different sentence features.

[0109] S204: When the current iteration number reaches a preset iteration number, a word label model is created according to the model parameters in the current iteration.

[0110] The previous word vector matrix and the following word vector matrix in S201 are the data in the training set. When the current number of iterations reaches the preset number of iterations, the word label model can be tested using the data in the test set. Since the labeling method includes three labels, the process of labeling each word can be considered as a three-classification task, so the present invention selects the macro-average F1 value micro-F1 suitable for multi-classification tasks as the evaluation indicator of the model, and the calculation process is expressed as follows:

[0111]

[0112]

[0113]

[0114] in, Represents the average true positive rate, that is, the positive samples are successfully predicted as positive samples; Represents the average false positive rate, that is, negative samples are predicted as positive samples. Represents the average false negative rate, that is, the positive sample is predicted as a negative sample. The word labels corresponding to the positive sample include BA and IA, and the word label corresponding to the negative sample is O. This process is equivalent to first calculating the accuracy and recall rate of each label category, taking the average to obtain the micro-average precision micro-P and micro-average recall rate micro-R, and finally calculating micro-F1. The model is trained until the evaluation indicator micro-F1 converges to achieve the purpose of extracting the evaluation object.

[0115] S205: When the current number of iterations does not reach the preset number of iterations, the model parameters and the transfer score matrix are updated according to the loss function, and the iterative process is continued.

[0116] In specific implementation, the model parameters and transfer score matrix can be updated according to the loss function, the Adam algorithm learning rate and the dropout ratio. The Adam algorithm learning rate is used to optimize the parameters, and the dropout ratio is used to prevent overfitting.

[0117] The specific process of the embodiment of the present invention is as follows:

[0118] 1. Obtain the historical sentence text, and divide the historical sentence text into the preceding text and the following text corresponding to the evaluation object in the historical sentence text.

[0119] 2. Generate the previous word vector matrix based on the previous text, and generate the following word vector matrix based on the following text.

[0120] 3. Obtain the context feature map matrix based on the context word vector matrix, the context convolution filter and the first context bias item.

[0121] 4. Obtain the above feature matrix according to the above feature map matrix, the second above bias term and the first linear conversion parameter.

[0122] 5. Obtain the context feature map matrix based on the context word vector matrix, the context convolution filter and the first context bias item.

[0123] 6. Obtain a context feature matrix according to the context feature map matrix, the second context bias term and the second linear conversion parameter.

[0124] 7. Obtain the model score matrix based on the previous feature matrix, the following feature matrix, the third linear transformation parameter and the score bias term.

[0125] 8. Determine the loss function based on the model score matrix and the transfer score matrix.

[0126] 9. When the current number of iterations reaches the preset number of iterations, create a word label model based on the model parameters in the current iteration, otherwise update the model parameters and transfer score matrix according to the loss function and return to step 2.

[0127] 10. Obtain a sentence text and generate a word vector matrix based on each word in the sentence text.

[0128] 11. Input the word vector matrix into the word tag model to obtain the word tag score matrix.

[0129] 12. Determine the word label of each word according to the word label score matrix, and extract the word corresponding to the evaluation object word label as the evaluation object.

[0130] In summary, the prior art mainly uses recurrent neural networks to solve the problem of evaluating object extraction, but this method has a previous dependency, that is, the next step of calculation needs to rely on the calculation result of the previous step, and cannot fully utilize the parallel computing capability of the GPU. The present invention fully utilizes the segmented convolutional neural network to solve the problem of evaluating object extraction, extracts features containing the contextual information of the evaluation object, enriches the feature expression form of the model, can give full play to the computing power of the GPU, improve the efficiency of model training, and thus improve the efficiency and accuracy of extracting evaluation objects.

[0131] Based on the same inventive concept, an embodiment of the present invention also provides an evaluation object extraction device based on a convolutional neural network. Since the principle of solving the problem by the device is similar to that of the evaluation object extraction method based on a convolutional neural network, the implementation of the device can refer to the implementation of the method, and the repeated parts will not be repeated.

[0132] Fig.12 It is a structural block diagram of an evaluation object extraction device based on a convolutional neural network in an embodiment of the present invention. Fig.13 FIG. 1 is a structural block diagram of a word tag model creation module in another embodiment of the present invention. Figure 12-13 As shown, the evaluation object extraction device based on the convolutional neural network includes:

[0133] A word vector matrix acquisition module is used to acquire a sentence text and generate a word vector matrix according to each word in the sentence text;

[0134] A word label score matrix module is used to input the word vector matrix into a word label model created based on the previous word vector matrix, the following word vector matrix and a preset convolutional neural network model to obtain a word label score matrix;

[0135] A word label module, used to determine the word label of each word according to the word label score matrix; wherein the word label includes the evaluation object word label;

[0136] The evaluation object extraction module is used to extract the words corresponding to the evaluation object word labels as evaluation objects.

[0137] In one embodiment, the invention further comprises: a word tag model creation module, which is used to perform the following iterative processing:

[0138] Obtain a model score matrix based on the previous word vector matrix, the following word vector matrix, and the model parameters in the convolutional neural network model;

[0139] Determine a loss function based on the model score matrix and the transfer score matrix;

[0140] When the current number of iterations reaches the preset number of iterations, a word label model is created according to the model parameters in the current iteration, otherwise the model parameters and the transfer score matrix are updated according to the loss function, and the iterative processing continues.

[0141] In one embodiment, the model parameters include: a previous convolution filter, a previous bias term, a following convolution filter, a following bias term, a first linear transformation parameter, a second linear transformation parameter, a third linear transformation parameter, and a score bias term;

[0142] The word tag model creation module is specifically used for:

[0143] Obtaining the above feature matrix according to the above word vector matrix, the above convolution filter, the above bias item and the first linear transformation parameter;

[0144] Obtaining a context feature matrix according to the context word vector matrix, the context convolution filter, the context bias term, and the second linear transformation parameter;

[0145] The model score matrix is ​​obtained according to the above feature matrix, the below feature matrix, the third linear transformation parameter and the score bias term.

[0146] like Fig.13 As shown, in actual applications, the word label model creation module includes a data preprocessing module, a sentence vectorization module, and a model design and training module.

[0147] In summary, the evaluation object extraction device based on convolutional neural network in the embodiment of the present invention first generates a word vector matrix according to each word in the sentence text, and then inputs the word vector matrix into the word label model to obtain the word label score matrix to determine the word label of each word, and finally extracts the word corresponding to the evaluation object word label as the evaluation object, which can improve the efficiency and accuracy of extracting the evaluation object.

[0148] The embodiment of the present invention also provides a specific implementation of a computer device that can implement all the steps in the evaluation object extraction method based on a convolutional neural network in the above embodiment. Fig.14 is a block diagram of a computer device in an embodiment of the present invention, see Fig.14 , the computer equipment specifically includes the following contents:

[0149] Processor (processor) 1401 and memory (memory) 1402.

[0150] The processor 1401 is used to call the computer program in the memory 1402. When the processor executes the computer program, all steps in the evaluation object extraction method based on the convolutional neural network in the above embodiment are implemented. For example, when the processor executes the computer program, the following steps are implemented:

[0151] Obtain a sentence text and generate a word vector matrix according to each word in the sentence text;

[0152] Input the word vector matrix into the word label model created based on the previous word vector matrix, the following word vector matrix and the preset convolutional neural network model to obtain the word label score matrix;

[0153] Determine the word label of each word according to the word label score matrix; wherein the word label includes the evaluation object word label;

[0154] The word corresponding to the evaluation object word label is extracted as the evaluation object.

[0155] In summary, the computer device of the embodiment of the present invention first generates a word vector matrix according to each word in the sentence text, and then inputs the word vector matrix into the word label model to obtain a word label score matrix to determine the word label of each word, and finally extracts the word corresponding to the evaluation object word label as the evaluation object, which can improve the efficiency and accuracy of extracting the evaluation object.

[0156] The embodiment of the present invention also provides a computer-readable storage medium capable of implementing all the steps in the evaluation object extraction method based on a convolutional neural network in the above embodiment. The computer-readable storage medium stores a computer program. When the computer program is executed by a processor, all the steps of the evaluation object extraction method based on a convolutional neural network in the above embodiment are implemented. For example, when the processor executes the computer program, the following steps are implemented:

[0157] Obtain a sentence text and generate a word vector matrix according to each word in the sentence text;

[0158] Input the word vector matrix into the word label model created based on the previous word vector matrix, the following word vector matrix and the preset convolutional neural network model to obtain the word label score matrix;

[0159] Determine the word label of each word according to the word label score matrix; wherein the word label includes the evaluation object word label;

[0160] The word corresponding to the evaluation object word label is extracted as the evaluation object.

[0161] In summary, the computer-readable storage medium of an embodiment of the present invention first generates a word vector matrix according to each word in the sentence text, and then inputs the word vector matrix into a word label model to obtain a word label score matrix to determine the word label of each word, and finally extracts the word corresponding to the evaluation object word label as the evaluation object, which can improve the efficiency and accuracy of extracting the evaluation object.

[0162] The specific embodiments described above further illustrate the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above description is only a specific embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.

[0163] Those skilled in the art may also understand that the various illustrative logical blocks, units, and steps listed in the embodiments of the present invention may be implemented by electronic hardware, computer software, or a combination of the two. In order to clearly demonstrate the interchangeability of hardware and software, the various illustrative components, units, and steps described above have generally described their functions. Whether such functions are implemented by hardware or software depends on the specific application and the design requirements of the entire system. Those skilled in the art may use various methods to implement the described functions for each specific application, but such implementation should not be understood as exceeding the scope of protection of the embodiments of the present invention.

[0164] The various illustrative logic blocks, or units, or devices described in the embodiments of the present invention can be implemented or operated by a general-purpose processor, a digital signal processor, an application-specific integrated circuit (ASIC), a field programmable gate array or other programmable logic device, a discrete gate or transistor logic, a discrete hardware component, or any combination of the above. The general-purpose processor can be a microprocessor, and optionally, the general-purpose processor can also be any conventional processor, controller, microcontroller or state machine. The processor can also be implemented by a combination of computing devices, such as a digital signal processor and a microprocessor, a plurality of microprocessors, one or more microprocessors combined with a digital signal processor core, or any other similar configuration.

[0165] The steps of the method or algorithm described in the embodiments of the present invention can be directly embedded in hardware, a software module executed by a processor, or a combination of the two. The software module can be stored in a RAM memory, a flash memory, a ROM memory, an EPROM memory, an EEPROM memory, a register, a hard disk, a removable disk, a CD-ROM, or other storage media of any form in the art. Exemplarily, the storage medium can be connected to the processor so that the processor can read information from the storage medium and can write information to the storage medium. Optionally, the storage medium can also be integrated into the processor. The processor and the storage medium can be arranged in an ASIC, and the ASIC can be arranged in a user terminal. Optionally, the processor and the storage medium can also be arranged in different components in the user terminal.

[0166] In one or more exemplary designs, the above functions described in the embodiments of the present invention can be implemented in hardware, software, firmware or any combination of the three. If implemented in software, these functions can be stored on a computer-readable medium, or transmitted in the form of one or more instructions or codes on a computer-readable medium. Computer-readable media include computer storage media and communication media that facilitate the transfer of computer programs from one place to another. The storage medium can be any available medium that can be accessed by any general or special computer. For example, such computer-readable media can include but are not limited to RAM, ROM, EEPROM, CD-ROM or other optical disk storage, disk storage or other magnetic storage devices, or any other medium that can be used to carry or store program codes in the form of instructions or data structures and other forms that can be read by general or special computers, or general or special processors. In addition, any connection can be appropriately defined as a computer-readable medium, for example, if the software is transmitted from a website site, server or other remote resource through a coaxial cable, fiber optic cable, twisted pair, digital subscriber line (DSL) or wirelessly, such as infrared, wireless and microwave, it is also included in the defined computer-readable medium. The disk and disc include compact disk, laser disk, optical disk, DVD, floppy disk and Blu-ray disk. Disks usually copy data magnetically, while discs usually copy data optically with lasers. The above combination can also be included in computer readable media.

Claims

1. A method for extracting evaluation objects based on convolutional neural networks, characterized in that: include: Obtain a sentence text and generate a word vector matrix according to each word in the sentence text; Inputting the word vector matrix into a word label model created based on the previous word vector matrix, the following word vector matrix and a preset convolutional neural network model to obtain a word label score matrix; Determining the word label of each word according to the word label score matrix; wherein the word label includes the evaluation object word label; Extracting the word corresponding to the evaluation object word label as the evaluation object; Among them, it also includes: Acquire a historical sentence text, and divide the historical sentence text into a preceding text and a following text corresponding to an evaluation object in the historical sentence text; Generate the preceding word vector matrix according to the preceding text, and generate the following word vector matrix according to the following text; The corpus consists of n independent sentences S = {S1, S2, ..., S n }, sentence S t It consists of m words, S t ={id1,id2,...,id m },S t The elements in the corpus dictionary are the pairs of elements in the sentence S t The random id assigned to the word; when the sentence S t Contains two evaluation objects a1 and a2, wherein the evaluation object a1 and the evaluation object a2 are in the sentence S t When the corresponding start and end positions in are marked as [e1, s1] and [e2, s2] respectively, the sentence S t The evaluation object a1 is divided into two parts up1 and down1, where up1 = {id1, ..., s1} contains the previous text of the evaluation object a1, and down1 = {e1, ..., id m } contains the following text of the evaluation object a1; Among them, creating a word label model includes: Perform the following iterative processing: Obtain a model score matrix according to the previous word vector matrix, the following word vector matrix, and model parameters in the convolutional neural network model; Determining a loss function based on the model score matrix and the transfer score matrix; When the current number of iterations reaches a preset number of iterations, a word label model is created according to the model parameters in the current iteration, otherwise the model parameters and the transfer score matrix are updated according to the loss function, and the iterative process is continued; The model parameters include: a previous convolution filter, a previous bias term, a following convolution filter, a following bias term, a first linear transformation parameter, a second linear transformation parameter, a third linear transformation parameter and a score bias term; The model score matrix is ​​obtained according to the above word vector matrix, the below word vector matrix and the model parameters in the convolutional neural network model, including: Obtaining a context feature matrix according to the context word vector matrix, the context convolution filter, the context bias item and the first linear transformation parameter; Obtaining a context feature matrix according to the context word vector matrix, the context convolution filter, the context bias item and the second linear transformation parameter; A model score matrix is ​​obtained according to the preceding feature matrix, the following feature matrix, the third linear conversion parameter and the score bias term.

2. The evaluation object extraction method based on convolutional neural network according to claim 1 is characterized in that: The above bias item includes a first above bias item and a second above bias item; the below bias item includes a first below bias item and a second below bias item; The above feature matrix is ​​obtained according to the above word vector matrix, the above convolution filter, the above bias item and the first linear conversion parameter, including: Obtaining a context feature map matrix according to the context word vector matrix, the context convolution filter and the first context bias item; Obtaining a context feature matrix according to the context feature map matrix, the second context bias term, and the first linear conversion parameter; Obtaining a context feature matrix according to the context word vector matrix, the context convolution filter, the context bias item and the second linear conversion parameter includes: Obtaining a context feature map matrix according to the context word vector matrix, the context convolution filter and the first context bias item; A context feature matrix is ​​obtained according to the context feature map matrix, the second context bias term and the second linear conversion parameter.

3. An evaluation object extraction device based on a convolutional neural network, characterized in that: include: A word vector matrix acquisition module is used to acquire a sentence text and generate a word vector matrix according to each word in the sentence text; A word label score matrix module is used to input the word vector matrix into a word label model created based on the previous word vector matrix, the following word vector matrix and a preset convolutional neural network model to obtain a word label score matrix; A word label module, used to determine the word label of each word according to the word label score matrix; wherein the word label includes the evaluation object word label; An evaluation object extraction module, used to extract the word corresponding to the evaluation object word label as the evaluation object; Wherein, the evaluation object extraction device based on convolutional neural network is further configured as follows: Acquire a historical sentence text, and divide the historical sentence text into a preceding text and a following text corresponding to an evaluation object in the historical sentence text; Generate the preceding word vector matrix according to the preceding text, and generate the following word vector matrix according to the following text; The corpus consists of n independent sentences S = {S1, S2, ..., S n }, sentence S t It consists of m words, S t ={id1,id2,...,id m },S t The elements in the corpus dictionary are the pairs of elements in the sentence S t The random id assigned to the word; when the sentence S t Contains two evaluation objects a1 and a2, wherein the evaluation object a1 and the evaluation object a2 are in the sentence S t When the corresponding start and end positions in are marked as [e1, s1] and [e2, s2] respectively, the sentence S t The evaluation object a1 is divided into two parts up1 and down1, where up1 = {id1, ..., s1} contains the previous text of the evaluation object a1, and down1 = {e1, ..., id m } contains the following text of the evaluation object a1; It also includes: a word label model creation module, which is used to perform the following iterative processing: Obtain a model score matrix according to the previous word vector matrix, the following word vector matrix, and model parameters in the convolutional neural network model; Determining a loss function based on the model score matrix and the transfer score matrix; When the current number of iterations reaches a preset number of iterations, a word label model is created according to the model parameters in the current iteration, otherwise the model parameters and the transfer score matrix are updated according to the loss function, and the iterative process is continued; The model parameters include: a previous convolution filter, a previous bias term, a following convolution filter, a following bias term, a first linear transformation parameter, a second linear transformation parameter, a third linear transformation parameter and a score bias term; The word tag model creation module is specifically used for: Obtaining a context feature matrix according to the context word vector matrix, the context convolution filter, the context bias item and the first linear transformation parameter; Obtaining a context feature matrix according to the context word vector matrix, the context convolution filter, the context bias item and the second linear transformation parameter; A model score matrix is ​​obtained according to the preceding feature matrix, the following feature matrix, the third linear conversion parameter and the score bias term.

4. A computer device comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that: When the processor executes the computer program, the steps of the evaluation object extraction method based on convolutional neural network described in any one of claims 1 to 2 are implemented.

5. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the evaluation object extraction method based on a convolutional neural network described in any one of claims 1 to 2 are implemented.

Citation Information

Patent Citations

  • Evaluation information extraction method and device, storage medium and computer equipment

    CN110472040A