Opinion role labeling method, device, computer equipment and medium

The combination of hidden state word order list and Bi-LSTM/CRF generated by the syntax model provides syntax information to replace SRL semantic information, solving the inaccuracy problem of ORL model when lacking semantic analysis, and improving the accuracy of view role labeling performance and performance.

CN113553855BActive Publication Date: 2024-11-12ALIBABA GROUP HOLDING LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202010339904.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-04-26
Publication Date
2024-11-12
Estimated Expiration
2040-04-26

AI Technical Summary

Technical Problem

In the prior art, in the absence of semantic analysis, the annotated view role role is inaccurate and cannot achieve performance in the case of assisted by semantic role annotation (SRL).

Method used

By entering the corpus to be marked into the syntax model, a hidden state word order list of the syntax structure is obtained, and a bidirectional long and short-term memory model (Bi-LSTM) and conditional random field model (CRF) is combined with syntax information to replace SRL semantic information to perform perspective roles Mark.

Benefits of technology

The accuracy and model performance of view role annotation are improved, so that it achieves the same annotation effect as using SRL semantic information without using SRL semantic information.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113553855B_ABST
    Figure CN113553855B_ABST
Patent Text Reader

Abstract

The present disclosure provides a method, apparatus, computer device and medium for labeling opinion roles. The method comprises: inputting a corpus to be labeled into a syntactic model; inputting a hidden state word sequence representation obtained by the syntactic model in the process of obtaining the syntactic structure of the corpus to be labeled, together with the corpus to be labeled, into a bidirectional long short-term memory model and a conditional random field model in series, to obtain the opinion roles of the corpus to be labeled. The present disclosure provides an opinion role labeling method that does not use SRL assistance but can achieve the same performance as that of the method using SRL assistance.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of big data, and more specifically, to a method, apparatus, computer device and medium for labeling opinion roles. Background Art

[0002] In the field of big data, opinion mining and sentiment analysis have a wide range of practical applications, such as social media monitoring and general e-commerce applications. In particular, fine-grained analysis of opinions and sentiment is key to understanding politicians' positions, customer reviews, marketing trends, and other subjective information. Opinion role labeling (ORL) is a form of fine-grained sentiment analysis that is widely used in big data mining.

[0003] ORL automatically marks the opinion holder (who is commenting), the wording of the opinion (how the opinion is commented), and the opinion target (what the opinion is directed at) for the comment sentences, paragraphs, and articles to be annotated. After annotation, the annotated content can be further analyzed by subsequent semantic analysis models to generate various decisions, such as placing network resources to match user opinions.

[0004] In the prior art, in order to improve the performance of ORL, a semantic role labeling (SRL) model is generally used to help implement ORL. That is, the corpus to be labeled is input into ORL on the one hand, and into SRL on the other hand, and some semantic information generated by SRL in the process of generating semantic role labeling can be introduced back into the ORL model to help achieve more accurate labeling. If the semantics between words are not considered, the viewpoint roles purely labeled by ORL will be inaccurate due to the lack of semantic analysis. Therefore, using some semantic information generated in SRL can greatly improve the performance of ORL. Summary of the invention

[0005] In view of this, the present disclosure aims to provide a method for labeling viewpoint roles without using SRL assistance, but capable of achieving the same performance as that of using SRL assistance.

[0006] To achieve this objective, according to one aspect of the present disclosure, a method for labeling viewpoint roles is provided, comprising:

[0007] Input the corpus to be annotated into the syntactic model;

[0008] The hidden state word sequence representation obtained by the syntactic model in the process of obtaining the syntactic structure of the corpus to be annotated is input into a bidirectional long short-term memory model (Bi-LSTM) and a conditional random field model (CRF) in series together with the corpus to be annotated to obtain the opinion role of the corpus to be annotated.

[0009] Optionally, the syntactic model includes a Bi-LSTM encoding layer, a scoring layer, and a decoding layer connected in series, the Bi-LSTM encoding layer generates a word sequence representation for the corpus to be annotated that takes into account the semantic connection between the words before and after the corpus, the scoring layer generates a probability matrix of the dependency probability of each word in the corpus to be annotated based on the word sequence representation, and the decoding layer generates a syntactic tree based on the probability matrix; the hidden state word sequence representation obtained by the syntactic model in the process of obtaining the syntactic structure of the corpus to be annotated is output by the Bi-LSTM encoding layer.

[0010] Optionally, the step of inputting the hidden state word sequence representation obtained by the syntactic model in the process of obtaining the syntactic structure of the corpus to be annotated, together with the corpus to be annotated, into the series-connected Bi-LSTM and CRF comprises:

[0011] Inputting the hidden state word sequence representation and the corpus to be annotated into the Bi-LSTM;

[0012] Input the probability matrix and the feature sequence output by the Bi-LSTM into a graph encoder;

[0013] The encoding result output by the graph encoder is output to the CRF to obtain the viewpoint role of the corpus to be annotated.

[0014] Optionally, the step of inputting the hidden state word sequence representation obtained by the syntactic model in the process of obtaining the syntactic structure of the corpus to be annotated, together with the corpus to be annotated, into the series-connected Bi-LSTM and CRF comprises:

[0015] Inputting the hidden state word sequence representation and the corpus to be annotated into the Bi-LSTM;

[0016] Input the syntactic tree and the feature sequence output by the Bi-LSTM into a graph encoder;

[0017] The encoding result output by the graph encoder is output to the CRF to obtain the viewpoint role of the corpus to be annotated.

[0018] Optionally, the graph encoder is a graph convolutional network.

[0019] Optionally, the Bi-LSTM encoding layer has multiple LSTM sub-layers, and the hidden state word sequence obtained by the syntactic model in the process of obtaining the syntactic structure of the corpus to be annotated is represented by at least one of the following:

[0020] A hidden state word sequence representation output by a specified LSTM sublayer among the multiple LSTM sublayers;

[0021] A weighted sum of hidden state word sequence representations output by a specified portion of the LSTM sublayers in the plurality of LSTM sublayers;

[0022] The weighted sum of the hidden state word sequence representations output by the multiple LSTM sub-layers.

[0023] Optionally, the syntactic model further includes a first embedding layer before the Bi-LSTM encoding layer, and the hidden state word sequence representation obtained by the syntactic model in the process of obtaining the syntactic structure of the corpus to be annotated is represented as the word sequence representation output by the first embedding layer.

[0024] Optionally, the step of inputting the hidden state word sequence representation obtained by the syntactic model in the process of obtaining the syntactic structure of the corpus to be annotated, together with the corpus to be annotated, into the Bi-LSTM and CRF connected in series, includes: inputting the hidden state word sequence representation obtained by the syntactic model in the process of obtaining the syntactic structure of the corpus to be annotated, together with the word sequence representation obtained by the corpus to be annotated through the second embedding layer, into the Bi-LSTM and CRF connected in series.

[0025] Optionally, the step of inputting the syntax tree together with the feature sequence output by the Bi-LSTM into a graph encoder comprises: converting the syntax tree into a 0-1 connection matrix, and inputting the matrix together with the feature sequence output by the Bi-LSTM into the graph encoder.

[0026] Optionally, the probability matrix is ​​generated by the scoring layer in the following manner:

[0027] According to the word sequence representation, for a word in the corpus to be annotated, generating a dependency probability score between the word and other words in the corpus to be annotated;

[0028] Normalizing the dependency probability scores;

[0029] The probability matrix is ​​generated using the normalized dependency probability scores of each word with other words in the corpus to be annotated.

[0030] According to one aspect of the present disclosure, a viewpoint role labeling device is provided, comprising:

[0031] A syntactic model input unit, used to input the corpus to be annotated into the syntactic model;

[0032] The annotation obtaining unit is used to input the hidden state word sequence representation obtained by the syntactic model in the process of obtaining the syntactic structure of the corpus to be annotated, together with the corpus to be annotated, into the series-connected Bi-LSTM and CRF to obtain the viewpoint role of the corpus to be annotated.

[0033] Optionally, the syntactic model includes a Bi-LSTM encoding layer, a scoring layer, and a decoding layer connected in series, the Bi-LSTM encoding layer generates a word sequence representation for the corpus to be annotated that takes into account the semantic connection between the words before and after the corpus, the scoring layer generates a probability matrix of the dependency probability of each word in the corpus to be annotated based on the word sequence representation, and the decoding layer generates a syntactic tree based on the probability matrix; the hidden state word sequence representation obtained by the syntactic model in the process of obtaining the syntactic structure of the corpus to be annotated is output by the Bi-LSTM encoding layer.

[0034] Optionally, the annotation obtaining unit is further used for:

[0035] Inputting the hidden state word sequence representation and the corpus to be annotated into the Bi-LSTM;

[0036] Input the probability matrix and the feature sequence output by the Bi-LSTM into a graph encoder;

[0037] The encoding result output by the graph encoder is output to the CRF to obtain the viewpoint role of the corpus to be annotated.

[0038] Optionally, the annotation obtaining unit is further used for:

[0039] Inputting the hidden state word sequence representation and the corpus to be annotated into the Bi-LSTM;

[0040] Input the syntactic tree and the feature sequence output by the Bi-LSTM into a graph encoder;

[0041] The encoding result output by the graph encoder is output to the CRF to obtain the viewpoint role of the corpus to be annotated.

[0042] Optionally, the graph encoder is a graph convolutional network.

[0043] Optionally, the Bi-LSTM encoding layer has multiple LSTM sub-layers, and the hidden state word sequence obtained by the syntactic model in the process of obtaining the syntactic structure of the corpus to be annotated is represented by at least one of the following:

[0044] A hidden state word sequence representation output by a specified LSTM sublayer among the multiple LSTM sublayers;

[0045] A weighted sum of hidden state word sequence representations output by a specified portion of the LSTM sublayers in the plurality of LSTM sublayers;

[0046] The weighted sum of the hidden state word sequence representations output by the multiple LSTM sub-layers.

[0047] Optionally, the syntactic model further includes a first embedding layer before the Bi-LSTM encoding layer, and the hidden state word sequence representation obtained by the syntactic model in the process of obtaining the syntactic structure of the corpus to be annotated is represented as the word sequence representation output by the first embedding layer.

[0048] Optionally, the annotation obtaining unit is further used to: input the hidden state word sequence representation obtained by the syntactic model in the process of obtaining the syntactic structure of the corpus to be annotated, and the word sequence representation obtained by the corpus to be annotated through the second embedding layer into the series-connected Bi-LSTM and CRF.

[0049] Optionally, the step of inputting the syntax tree together with the feature sequence output by the Bi-LSTM into a graph encoder comprises: converting the syntax tree into a 0-1 connection matrix, and inputting the matrix together with the feature sequence output by the Bi-LSTM into the graph encoder.

[0050] Optionally, the probability matrix is ​​generated by the scoring layer in the following manner:

[0051] According to the word sequence representation, for a word in the corpus to be annotated, generating a dependency probability score between the word and other words in the corpus to be annotated;

[0052] Normalizing the dependency probability scores;

[0053] The probability matrix is ​​generated using the normalized dependency probability scores of each word with other words in the corpus to be annotated.

[0054] According to one aspect of the present disclosure, a computer device is provided, including: a memory for storing computer executable codes; and a processor for executing the computer executable codes to implement the method described above.

[0055] According to one aspect of the present disclosure, a computer-readable medium is provided, comprising a computer-executable code, wherein the computer-executable code implements the method described above when executed by a processor.

[0056] The disclosed embodiment introduces syntactic information rather than SRL semantic information into opinion role labeling for the first time, and finds that compared with using SRL semantic information to help ORL, syntactic information is also very useful for ORL tasks, and the introduction of syntactic information greatly improves model performance. The disclosed embodiment inputs the corpus to be labeled into the syntactic model. In the process of obtaining the syntactic structure of the corpus to be labeled, the syntactic model will generate a hidden state word sequence representation. The disclosed embodiment inputs the generated hidden state word sequence representation together with the corpus to be labeled into the ORL model to obtain the opinion role of the corpus to be labeled. In this way, when labeling, not only the words in the corpus are labeled in isolation, but also the syntactic relationship between words is considered. Like SRL semantic information, it can improve the accuracy of labeling and improve model performance. BRIEF DESCRIPTION OF THE DRAWINGS

[0057] The above and other objects, features and advantages of the present disclosure will become more apparent through the description of the embodiments of the present disclosure with reference to the following drawings, in which:

[0058] Figure 1A -B shows an interface state diagram when the viewpoint role labeling method of the embodiment of the present disclosure is applied;

[0059] Figure 2 A flowchart of a method for labeling viewpoint roles according to an embodiment of the present disclosure is shown;

[0060] Figure 3 An interactive model diagram used in opinion role labeling according to an embodiment of the present disclosure is shown, which focuses on the situation of introducing the hidden state word sequence representation generated in the syntactic model into opinion role labeling;

[0061] Figure 4 An interactive model diagram used in opinion role labeling according to an embodiment of the present disclosure is shown, which focuses on the situation of introducing the probability matrix generated in the syntactic model into opinion role labeling;

[0062] Figure 5 An interactive model diagram used in opinion role annotation according to an embodiment of the present disclosure is shown, which focuses on the situation of introducing the syntax tree generated in the syntax model into opinion role annotation;

[0063] Figure 6 An example of a probability matrix according to an embodiment of the present disclosure is shown;

[0064] Figure 7 A block diagram of a viewpoint role labeling device according to an embodiment of the present disclosure is shown;

[0065] Figure 8 A structural diagram of a computer device according to an embodiment of the present disclosure is shown. DETAILED DESCRIPTION

[0066] The present disclosure is described below based on embodiments, but the present disclosure is not limited to these embodiments. In the detailed description of the present disclosure below, some specific details are described in detail. It is possible for a person skilled in the art to fully understand the present disclosure without the description of these details. In order to avoid confusing the essence of the present disclosure, well-known methods, processes, and procedures are not described in detail. In addition, the drawings are not necessarily drawn to scale.

[0067] Opinion role labeling can be used in many scenarios. For example, it can be used to perform fine-grained analysis on customer comments on a website to help understand the customer's position, thereby helping to evaluate related products and recommend appropriate products to the corresponding users. In the scenario of analyzing customer comments on a website, Figure 1A As shown in the figure, a page prompting for the input of the sentence to be annotated is displayed. The backend maintenance personnel will copy the customer comments to be analyzed to the page, such as Figure 1A "Wang X: This shoe is well made, reasonably priced, and delivered quickly." Figure 1B In the example, the result of annotating customer comments with opinions is shown to the user.

[0068] Opinion role annotation means automatically annotating the opinion holder (who is commenting), opinion wording (how the comment is made), and opinion target (what the comment is about) for the comment sentences, paragraphs, and articles to be annotated. Figure 1B In the labeling results shown, "Wang X" is the opinion holder, "this shoe" is the opinion target, and "good workmanship, reasonable price, and fast delivery" is the opinion wording. After labeling, the labeling results can be further analyzed by subsequent decision models to generate various decisions, such as delivering the reviewed product to matching users.

[0069] According to an embodiment of the present disclosure, a method for labeling opinion roles is provided. When opinion role labeling is used by a website to analyze comments of users on the website, etc., the method is executed by a website server. When opinion role labeling is used by a user to understand some difficult questions, the method is executed by a user's terminal, which may be installed with an application for executing the opinion role labeling method of the embodiment of the present disclosure.

[0070] like Figure 2 As shown, the method includes:

[0071] Step 110, input the corpus to be annotated into the syntactic model;

[0072] Step 120: input the hidden state word sequence representation obtained by the syntactic model in the process of obtaining the syntactic structure of the corpus to be annotated, together with the corpus to be annotated, into a bidirectional long short-term memory model (Bi-LSTM) and a conditional random field model (CRF) connected in series to obtain the viewpoint role of the corpus to be annotated.

[0073] The above steps are described in detail below.

[0074] Step 110: Input the corpus to be annotated into the syntactic model.

[0075] The corpus to be annotated refers to sentences, paragraphs, articles, etc. that need to be annotated with viewpoint roles. Figure 1A "Wang X: These shoes are well made, reasonably priced, and delivered quickly."

[0076] The syntactic model is a model used to determine the sentence components of the corpus (such as subject, predicate, object, etc.). Currently, the more commonly used syntactic models with better performance are: Figure 3-5 As shown on the left side, it includes a Bi-LSTM encoding layer 201, a scoring layer 202, and a decoding layer 203.

[0077] A first embedding layer (not shown) may be provided before the Bi-LSTM encoding layer 201. When the Bi-LSTM layer 201 processes data, it is usually processed in the form of a matrix to improve efficiency and realize the forward propagation of the neural network. Therefore, the input corpus is mapped to a dense vector of a fixed dimension, that is, a dimensionality increase operation, and then it is convenient to apply to subsequent neural network processing. Specifically, each word of the corpus can be made to correspond to an m-dimensional vector. Since the corpus has multiple words, it is set to n, and the corpus is mapped into an m×n-dimensional matrix, that is, the embedded sequence representation 204 of the corpus to be annotated. For example, a word corresponds to a 10-dimensional vector, and there are 8 words in the corpus. After the corpus is processed by the embedding layer, it becomes a 10×8-dimensional matrix.

[0078] In the embedded sequence representation 204 of the corpus to be annotated, each word is represented only as a code related to itself, without considering the semantic relationship with the surrounding words. Therefore, after passing through the Bi-LSTM layer 201, the representation of each word is not only based on the word itself, but also based on the semantic relationship with the surrounding words. Therefore, the sequence representation generated after passing through the Bi-LSTM layer 201 is called the hidden state word sequence representation 205, which contains some semantic information and can provide some help for the opinion role labeling of the embodiment of the present disclosure.

[0079] The long short-term memory model (LSTM) is a special form of recurrent neural network (RNN). RNN is a neural network that simulates the way the human brain processes information. The signals received by the human brain can be divided into external (i.e. our perception, vision, hearing, etc.) and internal (the ideas that already exist in the mind). At different times, the brain will make people produce new actions (external output) and new ideas (internal output). The RNN network is actually a combination of a group of forward networks. Each unit represents a time point. Each RNN unit (some people call it a cell) has two inputs and outputs, representing the input and output of the RNN network itself, and the input and output of external stimuli (which can be regarded as the state that we hope to pass to the next moment). In theory, this structure can perfectly simulate the human brain, but it is not so simple to train in practice. RNN training is usually accompanied by slow gradient decay and explosive gradient growth. LSTM was proposed to solve this problem.

[0080] The original intention of LSTM design is to ensure the integrity of information in the real world. A memory unit is introduced to record historical information, and this record is controlled and selective. This introduces the concept of three control gates. These three control gates control what the LSTM unit should write, read, and output. In this way, the current input, previous state, and current output determine the control method of the gate, and then the three control gates are used to control the output and update the current state.

[0081] The forward LSTM and the backward LSTM are combined into Bi-LSTM. For example, to encode the sentence "I love China", the forward LSTM inputs "I", "love", and "China" in sequence to obtain three vectors, and the backward LSTM inputs "China", "love", and "I" in sequence to obtain three vectors, and the results are concatenated to obtain the final output. Bi-LSTM has more stable performance than LSTM.

[0082] In addition, the Bi-LSTM encoding layer 201 may be a single Bi-LSTM encoding layer or may include multiple LSTM sub-layers. Each LSTM sub-layer outputs a process hidden state word sequence representation, and the top LSTM sub-layer outputs a final hidden state word sequence representation.

[0083] After the Bi-LSTM encoding layer 201 outputs the hidden state word sequence representation 205, the hidden state word sequence representation 205 enters the scoring layer 202 for scoring. The scoring layer 202 generates a dependency probability score between each word in the corpus to be annotated based on the input hidden state word sequence representation 205 and the other words in the corpus to be annotated. For example, for "I am Chinese", the dependency probability score between "I" and each of the other three words "I", "China", and "People" is determined; the dependency probability score between "I" and each of the other three words "I", "China", and "People" is determined... Then, these dependency probability scores are normalized, that is, for a word, the sum of its dependency probability scores with each of the other words is made 1. The probability matrix is ​​generated using the normalized dependency probability scores of each word and other words in the corpus to be annotated, such as Figure 6 The left side of is an example of a probability matrix, Figure 6 On the right side of is a dependency graph, in which dots represent words, bidirectional arrows between words represent the dependency relationships between words, and the values ​​marked at the arrows are the normalized dependency probability scores.

[0084] Then, the probability matrix is ​​input into the decoding layer 203, such as a Viterbi decoder. The Viterbi decoder uses the Viterbi decoding algorithm to obtain an optimal syntax tree. In the syntax tree, multiple annotated syntactic branches are formed, each branch is accompanied by a probability, and finally the optimal branch is selected to obtain the syntax annotation. For example, "I eat apples at work", one branch in the syntax tree may be "noun-preposition-noun-verb-noun", and the other branch is "noun-verb-noun-verb-noun", the former has a greater probability than the latter, and the former should be selected as the syntax annotation result.

[0085] In step 120, the hidden state word sequence representation obtained by the syntactic model in the process of obtaining the syntactic structure of the corpus to be annotated is input into a bidirectional long short-term memory model (Bi-LSTM) and a conditional random field model (CRF) in series together with the corpus to be annotated to obtain the opinion role of the corpus to be annotated.

[0086] Traditional opinion role labeling models include Figure 3 Bi-LSTM model 209 and CRF 210 on the right.

[0087] Through the processing of Bi-LSTM model 209, it is equivalent to obtaining a better representation method for the input corpus to be annotated. Bi-LSTM model 209 can well extract the features of the corpus to be annotated, and output the feature representation form of the corpus to be annotated. Finally, in the labeling stage, softmax is generally used for processing. However, this method is still limited in effect when processing data with strong relationships between output labels. Especially in actual sequence labeling tasks (such as labeling opinion roles), since the neural network structure is highly dependent on data, the size and quality of the data will also seriously affect the effect of model training. Therefore, a method of combining the existing linear statistical model with the neural network structure has emerged. The combination of LSTM and CRF has a better effect. In short, the Bi-LSTM model 209 is followed by CRF 210. The former is used to solve the problem of extracting sequence features, and the latter is used to effectively utilize the tag information at the sentence level to solve the sequence labeling problem. Under the LSTM+CRF model, the output will no longer be independent annotations, but the best annotation sequence.

[0088] In the traditional viewpoint role labeling model, the Bi-LSTM model 209 can be connected to the second embedding layer (not shown). Similar to the first embedding layer, the second embedding layer also maps the input corpus to a dense vector of fixed dimension, that is, a dimensionality increase operation, which is then conveniently applied to the subsequent neural network processing problem. In the traditional model, only the word sequence representation obtained by the second embedding layer of the corpus to be labeled is input into the Bi-LSTM model 209 and CRF 210 in series. However, in the embodiment of the present disclosure, the hidden state word sequence representation obtained by the syntactic model in the process of obtaining the syntactic structure of the corpus to be labeled is input into the Bi-LSTM model 209 and CRF 210 in series together with the word sequence representation obtained by the second embedding layer of the corpus to be labeled. Since the hidden state word sequence representation reflects the hidden state relationship between words, it can improve the accuracy of labeling like SRL semantic information, so it is introduced and input into the Bi-LSTM model 209 and CRF 210 in series together with the word sequence representation obtained by the second embedding layer of the corpus to be labeled, thereby improving the labeling performance.

[0089] As described above, the Bi-LSTM encoding layer may include multiple LSTM sublayers. In this way, the hidden state word sequence representation obtained by the syntactic model in the process of obtaining the syntactic structure of the corpus to be annotated can be the hidden state word sequence representation output by the top LSTM sublayer among the multiple LSTM sublayers, which is also the hidden state word sequence representation output by the entire Bi-LSTM encoding layer. The hidden state word sequence representation obtained by the syntactic model in the process of obtaining the syntactic structure of the corpus to be annotated can also be other LSTM sublayers (such as the bottom layer, the second LSTM sublayer from the bottom) that are not the top LSTM sublayer. It can also be the weighted sum of the hidden state word sequence representations output by a specified part of the LSTM sublayers in the multiple LSTM sublayers. For example, the Bi-LSTM encoding layer has a total of 3 LSTM sublayers, and the weights of the first and second LSTM sublayers from the bottom are set to 0.6 and 0.4 respectively, which is the weighted sum of the hidden state word sequence representations output by these two LSTM sublayers using these two weights. The hidden state word sequence representation obtained by the syntactic model in the process of obtaining the syntactic structure of the corpus to be annotated can also be the weighted sum of the hidden state word sequence representations output by the multiple LSTM sublayers. For example, the Bi-LSTM encoding layer has a total of 3 LSTM sublayers, and the weights of the 1st, 2nd, and 3rd LSTM sublayers from the base are set to 0.5, 0.3, and 0.2 respectively. The hidden state word sequence representation obtained by the syntactic model in the process of obtaining the syntactic structure of the corpus to be annotated is the weighted sum of the hidden state word sequence representations output by the 3 LSTM sublayers using these 3 weights. The weighted sum method can more scientifically reflect the contribution of each LSTM sublayer and improve the annotation quality.

[0090] like Figure 3 As shown, in the syntactic model, there are three types of syntactic information that can be used for the annotation of opinion roles: hidden state word sequence representation 205, probability matrix 206, and syntax tree 207. The hidden state word sequence representation 205 is a word sequence representation that reflects the dependency relationship between the words in the input corpus, so it carries the semantic relationship between words and can be used to help opinion role annotation. The probability matrix 206 reflects the dependency probability score of each word in the normalized input corpus with other words in the input corpus, so it also carries the semantic relationship between words, which can be used to help opinion role annotation. The syntax tree 207 reflects the syntax of the input corpus finally recognized by the syntactic model, so it also carries the semantic relationship between words, which can be used to help opinion role annotation. The situation of using the hidden state word sequence representation 205 to help opinion role annotation has been described in detail before.

[0091] like Figure 4As shown, in the case where the probability matrix 206 is used to assist in the annotation of opinion roles, a graph encoder 212 is introduced. The probability matrix 206 and the feature sequence output by the Bi-LSTM model 209 are input into the graph encoder 212 together. The encoding result output by the graph encoder 212 is output to the CRF 210 to obtain the opinion roles of the corpus to be annotated.

[0092] Convolutional neural networks are widely used in computer vision and natural language processing, but the objects they study are still limited to data with regular spatial structures, such as pictures that are regular square grids, and speech that is a regular one-dimensional sequence. These data structures can be represented by one-dimensional or two-dimensional matrices, and convolutional neural networks are very efficient in processing them. However, for data that do not have regular spatial structures, such as graphs abstracted from recommendation systems, electronic transactions, computational geometry, brain signals, molecular structures, etc., the connections between each node in these graph structures are different. Some nodes have three connections, and some nodes have two connections. They are irregular data structures and cannot be processed by convolutional neural networks. Therefore, a graph encoder 212 was created, one of the more influential graph encoders being the graph convolutional network.

[0093] Graphs have two basic characteristics: First, each node has its own characteristic information. For example, to establish a risk control rule, it is necessary to see whether the user's registration address, IP address, and transaction delivery address are the same. If these characteristic information do not match, the system will determine that the user has a certain risk of fraud. This is the application of the characteristic information of graph nodes. Second, each node in the graph also has structural information. If a certain IP node is connected to a large number of transaction nodes over a period of time, that is, there are a large number of edges extending from a certain IP node, then the risk control system will determine that this IP address is risky. This is the application of the structural information of graph nodes. In graph data, both the characteristic information and the structural information of the node must be considered at the same time. If it is extracted by manual rules, many hidden and complex patterns will be lost. The graph convolutional neural network can automatically learn the characteristic information and structural information of the graph at the same time.

[0094] In addition to the graph convolutional network, the graph encoder 212 can also be a general tree gate recurrent unit (TreeGRU), a tree long short-term memory model (TreeLSTM), etc., and a shortest dependency path (SDP) that only uses part of the tree, etc., but the performance of the graph convolutional neural network is better.

[0095] The probability matrix 206 and the syntax tree 207 are graph structure data. If they are introduced to help point of view role labeling, they must be input into a graph encoder 212, such as a graph convolutional network. At the same time, the feature sequence output by the Bi-LSTM model 209 is also input into the graph encoder 212. The output of the graph encoder 212 reflects both the role of the probability matrix 206 and the role of the original corpus to be labeled. The encoding result output by the graph encoder 212 is output to the CRF 210 to obtain the point of view role 211 of the corpus to be labeled.

[0096] like Figure 5 As shown, in the case where the probability matrix 206 is used to assist in the annotation of the opinion roles, a graph encoder 212 is also used. Instead of inputting the probability matrix 206 and the feature sequence output by the Bi-LSTM model 209 into the graph encoder 212, this embodiment inputs the syntax tree 207 and the feature sequence output by the Bi-LSTM model 209 into the graph encoder 212. The encoding result output by the graph encoder 212 is output to the CRF 210 to obtain the opinion role 211 of the corpus to be annotated.

[0097] Since the graph structure of the syntax tree is not direct, in one embodiment, it can be converted into a more direct graph structure, that is, a 0-1 connection matrix, and input into the graph encoder 212. That is, the syntax tree 207 is converted into a 0-1 connection matrix and input into the graph encoder 212 together with the feature sequence output by the Bi-LSTM model 209.

[0098] In addition, in one embodiment, the hidden state word sequence representation obtained by the syntactic model in the process of obtaining the syntactic structure of the corpus to be annotated may not be any sub-layer hidden state word sequence representation or its weighted sum generated during the encoding process of the Bi-LSTM encoding layer 201, but the word sequence representation output by the first embedding layer, that is, the word sequence representation input to the Bi-LSTM encoding layer 201. Although the word sequence representation has not passed through the Bi-LSTM encoding layer 201, the scoring layer 202, and the decoding layer 203, since the training of the Bi-LSTM encoding layer 201, the scoring layer 202, the decoding layer 203, and the embedding layer before the Bi-LSTM encoding layer 201 is carried out as a whole, it can also reflect certain syntactic information or semantic association information between words, and therefore, it can also help with opinion role labeling.

[0099] In summary, the disclosed embodiment introduces syntactic information rather than SRL semantic information into opinion role labeling for the first time, and finds that compared with using SRL semantic information to help ORL, syntactic information is also very useful for ORL tasks, and the introduction of syntactic information greatly improves model performance. The disclosed embodiment inputs the corpus to be labeled into the syntactic model. In the process of obtaining the syntactic structure of the corpus to be labeled, the syntactic model will generate a hidden state word sequence representation. The disclosed embodiment inputs the generated hidden state word sequence representation together with the corpus to be labeled into the ORL model to obtain the opinion role of the corpus to be labeled. In this way, when labeling, not only the words in the corpus are labeled in isolation, but also the syntactic relationship between words is considered. Like SRL semantic information, it can improve the accuracy of labeling and improve model performance.

[0100] like Figure 7 As shown, according to an embodiment of the present disclosure, a viewpoint role labeling device 300 is provided, including:

[0101] The syntactic model input unit 310 is used to input the corpus to be annotated into the syntactic model;

[0102] The annotation obtaining unit 320 is used to input the hidden state word sequence representation obtained by the syntactic model in the process of obtaining the syntactic structure of the corpus to be annotated, together with the corpus to be annotated, into a bidirectional long short-term memory model (Bi-LSTM) and a conditional random field model (CRF) connected in series to obtain the opinion role of the corpus to be annotated.

[0103] Optionally, the syntactic model includes a Bi-LSTM encoding layer, a scoring layer, and a decoding layer connected in series, the Bi-LSTM encoding layer generates a word sequence representation for the corpus to be annotated that takes into account the semantic connection between the words before and after the corpus, the scoring layer generates a probability matrix of the dependency probability of each word in the corpus to be annotated based on the word sequence representation, and the decoding layer generates a syntactic tree based on the probability matrix; the hidden state word sequence representation obtained by the syntactic model in the process of obtaining the syntactic structure of the corpus to be annotated is output by the Bi-LSTM encoding layer.

[0104] Optionally, the annotation obtaining unit 320 is further configured to:

[0105] Inputting the hidden state word sequence representation and the corpus to be annotated into the Bi-LSTM;

[0106] Input the probability matrix and the feature sequence output by the Bi-LSTM into a graph encoder;

[0107] The encoding result output by the graph encoder is output to the CRF to obtain the viewpoint role of the corpus to be annotated.

[0108] Optionally, the annotation obtaining unit 320 is further configured to:

[0109] Inputting the hidden state word sequence representation and the corpus to be annotated into the Bi-LSTM;

[0110] Input the syntactic tree and the feature sequence output by the Bi-LSTM into a graph encoder;

[0111] The encoding result output by the graph encoder is output to the CRF to obtain the viewpoint role of the corpus to be annotated.

[0112] Optionally, the graph encoder is a graph convolutional network.

[0113] Optionally, the Bi-LSTM encoding layer has multiple LSTM sub-layers, and the hidden state word sequence obtained by the syntactic model in the process of obtaining the syntactic structure of the corpus to be annotated is represented by at least one of the following:

[0114] A hidden state word sequence representation output by a specified LSTM sublayer among the multiple LSTM sublayers;

[0115] A weighted sum of hidden state word sequence representations output by a specified portion of the LSTM sublayers in the plurality of LSTM sublayers;

[0116] The weighted sum of the hidden state word sequence representations output by the multiple LSTM sub-layers.

[0117] Optionally, the syntactic model further includes a first embedding layer before the Bi-LSTM encoding layer, and the hidden state word sequence representation obtained by the syntactic model in the process of obtaining the syntactic structure of the corpus to be annotated is represented as the word sequence representation output by the first embedding layer.

[0118] Optionally, the annotation obtaining unit is further used to: input the hidden state word sequence representation obtained by the syntactic model in the process of obtaining the syntactic structure of the corpus to be annotated, and the word sequence representation obtained by the corpus to be annotated through the second embedding layer into the series-connected Bi-LSTM and CRF.

[0119] Optionally, the step of inputting the syntax tree together with the feature sequence output by the Bi-LSTM into a graph encoder comprises: converting the syntax tree into a 0-1 connection matrix, and inputting the matrix together with the feature sequence output by the Bi-LSTM into the graph encoder.

[0120] Optionally, the probability matrix is ​​generated by the scoring layer in the following manner:

[0121] According to the word sequence representation, for a word in the corpus to be annotated, generating a dependency probability score between the word and other words in the corpus to be annotated;

[0122] Normalizing the dependency probability scores;

[0123] The probability matrix is ​​generated using the normalized dependency probability scores of each word with other words in the corpus to be annotated.

[0124] The implementation details of the above-mentioned viewpoint role labeling device 300 have been described in detail in the above method embodiment, so they are not repeated here.

[0125] According to an embodiment of the present disclosure, the viewpoint role labeling can be performed by Figure 8 The computer device 800 is implemented. Figure 8 800 according to an embodiment of the present disclosure is described below. Figure 8 The computer device 800 shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.

[0126] like Figure 8 As shown, the computer device 800 is in the form of a general computing device. The components of the computer device 800 may include but are not limited to: at least one processing unit 810, at least one storage unit 820, and a bus 830 connecting different system components (including the storage unit 820 and the processing unit 810).

[0127] The storage unit stores program codes, which can be executed by the processing unit 810, so that the processing unit 810 executes the steps of various exemplary embodiments of the present disclosure described in the description of the exemplary method above. For example, the processing unit 810 can execute the following steps: Figure 2 The steps shown in .

[0128] The storage unit 820 may include a readable medium in the form of a volatile storage unit, such as a random access memory unit (RAM) 8201 and / or a cache memory unit 8202 , and may further include a read-only memory unit (ROM) 8203 .

[0129] The storage unit 820 may also include a program / utility 8204 having a set (at least one) of program modules 8205, such program modules 8205 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment.

[0130] Bus 830 may represent one or more of several types of bus structures, including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.

[0131] The computer device 800 may also communicate with one or more external devices 700 (e.g., keyboards, pointing devices, Bluetooth devices, etc.), may also communicate with one or more devices that enable a user to interact with the computer device 800, and / or communicate with any device that enables the computer device 800 to communicate with one or more other computing devices (e.g., routers, modems, etc.). Such communication may be performed via an input / output (I / O) interface 850. Furthermore, the computer device 800 may also communicate with one or more networks (e.g., local area networks (LANs), wide area networks (WANs), and / or public networks, such as the Internet) via a network adapter 860. As shown, the network adapter 860 communicates with other modules of the computer device 800 via a bus 830. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the computer device 800, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.

[0132] It should be understood that the above is only a preferred embodiment of the present disclosure and is not intended to limit the present disclosure. For those skilled in the art, there are many variations of the embodiments of this specification. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present disclosure shall be included in the protection scope of the present disclosure.

[0133] It should be understood that the various embodiments in this specification are described in a progressive manner, and the same or similar parts between the various embodiments can be referenced to each other, and each embodiment focuses on the differences from other embodiments.

[0134] It should be understood that the above is a description of a specific embodiment of the present specification. Other embodiments are within the scope of the claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the accompanying drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0135] It should be understood that an element described in singular form herein or shown in the drawings as only one does not limit the number of the element to one. In addition, modules or elements described or shown as separate herein may be combined into a single module or element, and modules or elements described or shown as single herein may be split into multiple modules or elements.

[0136] It should also be understood that the terms and expressions used herein are for description only, and one or more embodiments of this specification should not be limited to these terms and expressions. The use of these terms and expressions does not mean to exclude any equivalent features of the illustrations and descriptions (or parts thereof), and it should be recognized that various modifications that may exist should also be included in the scope of the claims. Other modifications, changes and substitutions may also exist. Accordingly, the claims should be deemed to cover all such equivalents.

Claims

1. A method for labeling opinion roles. include: Input the corpus to be annotated into the syntactic model, wherein the syntactic model includes a bidirectional long short-term memory encoding layer, a scoring layer, and a decoding layer connected in series, the bidirectional long short-term memory encoding layer generates a word sequence representation for the corpus to be annotated that takes into account the semantic connection between the words before and after the corpus, the scoring layer generates a probability matrix of the dependency probability of each word in the corpus to be annotated according to the word sequence representation, the decoding layer generates a syntactic tree according to the probability matrix, and the hidden state word sequence representation obtained by the syntactic model in the process of obtaining the syntactic structure of the corpus to be annotated is output by the bidirectional long short-term memory encoding layer; The hidden state word sequence representation obtained by the syntactic model in the process of obtaining the syntactic structure of the corpus to be annotated is input into a bidirectional long short-term memory model and a conditional random field model in series together with the corpus to be annotated to obtain the viewpoint role of the corpus to be annotated.

2. The method according to claim 1, in, The hidden state word sequence representation obtained by the syntactic model in the process of obtaining the syntactic structure of the corpus to be annotated is input into the bidirectional long short-term memory model and the conditional random field model connected in series together with the corpus to be annotated, including: Inputting the hidden state word sequence representation and the corpus to be annotated into the bidirectional long short-term memory model; Input the probability matrix and the feature sequence output by the bidirectional long short-term memory model into a graph encoder; The encoding result output by the graph encoder is output to the conditional random field model to obtain the viewpoint role of the corpus to be annotated.

3. The method according to claim 1, in, The hidden state word sequence representation obtained by the syntactic model in the process of obtaining the syntactic structure of the corpus to be annotated is input into the bidirectional long short-term memory model and the conditional random field model connected in series together with the corpus to be annotated, including: Inputting the hidden state word sequence representation and the corpus to be annotated into the bidirectional long short-term memory model; Inputting the syntactic tree and the feature sequence output by the bidirectional long short-term memory model into a graph encoder; The encoding result output by the graph encoder is output to the conditional random field model to obtain the viewpoint role of the corpus to be annotated.

4. The method according to claim 2 or 3, in, The graph encoder is a graph convolutional network.

5. The method according to claim 1, in, The bidirectional long short-term memory encoding layer includes a plurality of long short-term memory sub-layers, and the hidden state word sequence obtained by the syntactic model in the process of obtaining the syntactic structure of the corpus to be annotated is represented as at least one of the following: A hidden state word sequence representation output by a designated long short-term memory sublayer among the plurality of long short-term memory sublayers; A weighted sum of hidden state word sequence representations output by a specified portion of the long short-term memory sub-layers among the plurality of long short-term memory sub-layers; The weighted sum of the hidden state word sequence representations output by the multiple long short-term memory sub-layers.

6. The method according to claim 1, in, The syntactic model also includes a first embedding layer before the bidirectional long short-term memory encoding layer, and the hidden state word sequence representation obtained by the syntactic model in the process of obtaining the syntactic structure of the corpus to be annotated is represented as the word sequence representation output by the first embedding layer.

7. The method according to claim 1, in, The hidden state word sequence representation obtained by the syntactic model in the process of obtaining the syntactic structure of the corpus to be annotated is input into the bidirectional long short-term memory model and the conditional random field model connected in series together with the corpus to be annotated, including: The hidden state word sequence representation obtained by the syntactic model in the process of obtaining the syntactic structure of the corpus to be annotated is input into the bidirectional long short-term memory model and the conditional random field model in series together with the word sequence representation obtained by the corpus to be annotated through the second embedding layer.

8. The method according to claim 3, in, The step of inputting the syntax tree and the feature sequence output by the bidirectional long short-term memory model into a graph encoder comprises: converting the syntax tree into a 0-1 connection matrix, and inputting the matrix into the graph encoder together with the feature sequence output by the bidirectional long short-term memory model.

9. The method according to claim 1, in, The probability matrix is ​​generated from the scoring layer in the following way: According to the word sequence representation, for a word in the corpus to be annotated, generating a dependency probability score between the word and other words in the corpus to be annotated; Normalizing the dependency probability scores; The probability matrix is ​​generated using the normalized dependency probability scores of each word with other words in the corpus to be annotated.

10. A point of view role labeling device, include: A syntactic model input unit, used for inputting the corpus to be annotated into the syntactic model, wherein the syntactic model comprises a bidirectional long short-term memory encoding layer, a scoring layer, and a decoding layer connected in series, wherein the bidirectional long short-term memory encoding layer generates a word sequence representation for the corpus to be annotated that takes into account the semantic connection between the words before and after the corpus, the scoring layer generates a probability matrix of the dependency probability of each word in the corpus to be annotated according to the word sequence representation, the decoding layer generates a syntactic tree according to the probability matrix, and the hidden state word sequence representation obtained by the syntactic model in the process of obtaining the syntactic structure of the corpus to be annotated is output by the bidirectional long short-term memory encoding layer; The annotation obtaining unit is used to input the hidden state word sequence representation obtained by the syntactic model in the process of obtaining the syntactic structure of the corpus to be annotated, together with the corpus to be annotated, into a bidirectional long short-term memory model and a conditional random field model connected in series to obtain the viewpoint role of the corpus to be annotated.

11. The device according to claim 10, in, The annotation obtaining unit is further used for: Inputting the hidden state word sequence representation and the corpus to be annotated into the bidirectional long short-term memory model; Input the probability matrix and the feature sequence output by the bidirectional long short-term memory model into a graph encoder; The encoding result output by the graph encoder is output to the conditional random field model to obtain the viewpoint role of the corpus to be annotated.

12. The device according to claim 10, in, The annotation obtaining unit is further used for: Inputting the hidden state word sequence representation and the corpus to be annotated into the bidirectional long short-term memory model; Inputting the syntactic tree and the feature sequence output by the bidirectional long short-term memory model into a graph encoder; The encoding result output by the graph encoder is output to the conditional random field model to obtain the viewpoint role of the corpus to be annotated.

13. The device according to claim 11 or 12, in, The graph encoder is a graph convolutional network.

14. The device according to claim 10, in, The bidirectional long short-term memory encoding layer has multiple long short-term memory sub-layers, and the hidden state word sequence obtained by the syntactic model in the process of obtaining the syntactic structure of the corpus to be annotated is represented by at least one of the following: A hidden state word sequence representation output by a designated long short-term memory sublayer among the plurality of long short-term memory sublayers; A weighted sum of hidden state word sequence representations output by a specified portion of the long short-term memory sub-layers among the plurality of long short-term memory sub-layers; The weighted sum of the hidden state word sequence representations output by the multiple long short-term memory sub-layers.

15. The device according to claim 10, in, The syntactic model also includes a first embedding layer before the bidirectional long short-term memory encoding layer, and the hidden state word sequence representation obtained by the syntactic model in the process of obtaining the syntactic structure of the corpus to be annotated is represented as the word sequence representation output by the first embedding layer.

16. The device according to claim 10, in, The annotation obtaining unit is further used for: The hidden state word sequence representation obtained by the syntactic model in the process of obtaining the syntactic structure of the corpus to be annotated is input into the bidirectional long short-term memory model and the conditional random field model in series together with the word sequence representation obtained by the corpus to be annotated through the second embedding layer.

17. The device according to claim 12, in, The step of inputting the syntax tree and the feature sequence output by the bidirectional long short-term memory model into a graph encoder comprises: converting the syntax tree into a 0-1 connection matrix, and inputting the matrix into the graph encoder together with the feature sequence output by the bidirectional long short-term memory model.

18. The device according to claim 10, in, The probability matrix is ​​generated from the scoring layer in the following way: According to the word sequence representation, for a word in the corpus to be annotated, generating a dependency probability score between the word and other words in the corpus to be annotated; Normalizing the dependency probability scores; The probability matrix is ​​generated using the normalized dependency probability scores of each word with other words in the corpus to be annotated.

19. A computer device, include: A memory for storing computer executable code; A processor, configured to execute the computer executable code to implement the method according to any one of claims 1 to 9.

20. A computer readable medium, It is characterized in that The invention comprises computer executable codes, which implement the method according to any one of claims 1 to 9 when being executed by a processor.