Predicting functional tags for semantic role labeling
By coordinating neural networks and reinforcement learning technology, the problem of low prediction efficiency of functional markers in semantic role labeling is solved, and more efficient functional marker recognition and analysis are achieved, improving prediction accuracy and model performance.
Patent Information
- Application Number
- CN202010528591.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Priority Date
- 2019-06-13
- Filing Date
- 2020-06-11
- Publication Date
- 2024-11-01
- Estimated Expiration
- 2040-06-11
AI Technical Summary
The existing semantic role annotation methods are not efficient, especially when identifying functional markers, it is difficult to effectively process flexibility and position-related features, resulting in the impact of feature validity in classifier training, and the low frequency of functional markers appearing and Position variability makes predictions inefficient.
Coordinated neural network (CoNN) is used to combine recurrent neural networks and reinforcement learning, and through the coordinated work of schedulers, encoders and predictors, input sequences are generated and mapped to feature vectors to predict functional markers, and optimized using customized Q learning technology. The scheduler's input sequence generation strategy improves prediction efficiency.
It improves the prediction accuracy of functional markers, reduces model complexity and computing resource requirements, is more efficient than the global feature scanning method, and is suitable for the identification and analysis of functional markers.
Smart Images

Figure CN112084784B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to text analysis, and more particularly to semantic role labeling in natural language processing. Background Art
[0002] Semantic role labeling (SRL), also known as shallow semantic analysis, is an important task in natural language processing (NLP) related to understanding the meaning of sentences. Semantic role labeling aims to answer questions such as "who does what with whom, when and where, how and why" by identifying this information as functional tags. SRL provides useful features that benefit a wide range of applications such as information extraction, question answering (QA), and machine translation. However, current annotation implementations are inefficient in identifying functional tags because they focus on identifying core parameters in the input text data. Summary of the invention
[0003] A computer-implemented method according to one embodiment includes receiving training data instances and target instances at a scheduler; generating an input sequence from the training data instances and the target instances by the scheduler; sending the input sequence from the scheduler to an encoder; mapping the input sequence to a feature vector by the encoder; sending the feature vector from the encoder to the scheduler; sending the feature vector from the scheduler to a predictor; and mapping the feature vector to a class vector by the predictor to create a label for the target instance.
[0004] According to another embodiment, a computer program product for predicting functional tags for semantic role labeling includes a computer-readable storage medium embodying program instructions, wherein the program instructions can be executed by a processor to cause the processor to: receive training data instances and target instances at a scheduler using the processor; generate an input sequence from the training data instances and the target instances using the processor by the scheduler; send the input sequence from the scheduler to an encoder using the processor; map the input sequence to a feature vector using the processor by the encoder; send the feature vector from the encoder to the scheduler using the processor; send the feature vector from the scheduler to a predictor using the processor; and map the feature vector to a class vector to create a label for the target instance using the processor by the predictor.
[0005] According to one embodiment, a system includes a processor and logic integrated with the processor, executable by the processor, or integrated with the processor and executable by the processor, the logic being configured to receive training data instances and target instances at a scheduler; generate an input sequence from the training data instances and the target instances by the scheduler; send the input sequence from the scheduler to an encoder; map the input sequence to a feature vector by the encoder; send the feature vector from the encoder to the scheduler; send the feature vector from the scheduler to a predictor; and map the feature vector to a class vector by the predictor to create a label for the target instance.
[0006] Other aspects and embodiments of the present invention will become apparent from the following detailed description, which, taken in conjunction with the accompanying drawings, illustrates by way of example the principles of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0007] Figure 1 A network architecture according to an embodiment of the present invention is shown.
[0008] Figure 2 It shows that the Figure 1 A representative hardware environment associated with the server and / or client.
[0009] Figure 3 A method for predicting functional tags for semantic role labeling according to an embodiment of the present invention is shown.
[0010] Figure 4 An exemplary semantic role labeling environment according to an embodiment of the present invention is shown.
[0011] Figure 5 Semantic labels of exemplary sentences according to one embodiment of the present invention are shown.
[0012] Figure 6 A pipeline of prediction processing according to one embodiment of the present invention is shown.
[0013] Figure 7 The present invention shows an embodiment of the present invention, by picking out the scheduler and encapsulating other components in a black box environment. Figure 6 Redraw the pipeline.
[0014] Figure 8 A method for predicting functional tags of semantic role labels (SRLs) in sentences according to an embodiment of the present invention is shown. DETAILED DESCRIPTION
[0015] The following description is to illustrate the general principles of the present invention and is not meant to limit the inventive concept claimed herein. In addition, the specific features described herein can be used in combination with other features in every possible combination and arrangement.
[0016] Unless expressly defined otherwise herein, all terms should be given their broadest possible interpretation, including the meaning implicit in the specification and the meaning understood by those skilled in the art and / or defined in dictionaries, papers, etc.
[0017] It must also be noted that, as used in the specification and the appended claims, the singular forms "a", "an", and "the" include plural referents unless otherwise specified. It should be further understood that the terms "comprises" and / or "includes", when used in this specification, specify the presence of stated features, integers, steps, operations, elements, and / or components, but do not preclude the presence of one or more other features, integers, steps, operations, elements, components, and / or combinations thereof.
[0018] The following description discloses several preferred embodiments of systems, methods, and computer program products for predicting functional tags for semantic role labeling.
[0019] In one general embodiment, a computer-implemented method includes receiving training data instances and target instances at a scheduler; generating, by the scheduler, an input sequence from the training data instances and the target instances; sending, by the scheduler, the input sequence to an encoder; mapping, by the encoder, the input sequence to a feature vector; sending the feature vector from the encoder to the scheduler; sending the feature vector from the scheduler to a predictor; and mapping, by the predictor, the feature vector to a class vector to create a label for the target instance.
[0020] In another general embodiment, a computer program product for predicting functional tags for semantic role labeling includes a computer-readable storage medium embodying program instructions, wherein the program instructions can be executed by a processor to cause the processor to: receive training data instances and target instances at a scheduler using the processor; generate input sequences from the training data instances and the target instances using the processor at the scheduler; send the input sequence from the scheduler to an encoder using the processor; map the input sequence to a feature vector using the processor by the encoder; send the feature vector from the encoder to the scheduler using the processor; send the feature vector from the scheduler to a predictor using the processor; and map the feature vector to a class vector to create a label for the target instance using the processor by the predictor.
[0021] In another general embodiment, a system includes a processor and logic integrated with the processor, executable by the processor, or integrated with the processor and executable by the processor, the logic being configured to receive training data instances and target instances at a scheduler; generate an input sequence from the training data instances and the target instances by the scheduler; send the input sequence from the scheduler to an encoder; map the input sequence to a feature vector by the encoder; send the feature vector from the encoder to the scheduler; send the feature vector from the scheduler to a predictor; and map the feature vector to a class vector by the predictor to create a label for the target instance.
[0022] Figure 1 1 shows an architecture 100 according to one embodiment. Figure 1As shown, multiple remote networks 102 are provided, including a first remote network 104 and a second remote network 106. A gateway 101 may be coupled between the remote network 102 and the neighboring network 108. In the context of the present architecture 100, the networks 104, 106 may each take any form, including but not limited to a local area network (LAN), a wide area network (WAN) such as the Internet, a public switched telephone network (PSTN), an internal telephone network, etc.
[0023] In use, gateway 101 serves as an entry point from remote network 102 to neighboring network 108. Gateway 101 may thus function as a router capable of directing a given data packet arriving at gateway 101, and as a switch providing the actual path in and out of gateway 101 for a given packet.
[0024] Also included is at least one data server 114 coupled to the proximate network 108, which data server 114 is accessible from the remote network 102 via the gateway 101. It should be noted that the data server 114 may include any type of computing device / groupware. A plurality of user devices 116 are coupled to each data server 114. The user devices 116 may also be directly connected via one of the networks 104, 106, 108. Such user devices 116 may include a desktop computer, a laptop computer, a handheld computer, a printer, or any other type of logic. It should be noted that in one embodiment, the user device 111 may also be directly coupled to any network.
[0025] A peripheral device 120 or a series of peripheral devices 120, such as a fax machine, a printer, a network and / or local storage unit or system, etc., may be coupled to one or more of the networks 104, 106, 108. It should be noted that the database and / or additional components may be used with or integrated into any type of network element coupled to the networks 104, 106, 108. In the context of this specification, a network element may refer to any component of a network.
[0026] According to some methods, the methods and systems described herein may be implemented using and / or on a virtual system and / or a system that simulates one or more other systems, such as a UNIX system that simulates an IBM z / OS environment; a UNIX system that virtually hosts a MICROSOFT WINDOWS environment; a MICROSOFT WINDOWS system that simulates an IBM z / OS environment, etc. In some embodiments, such virtualization and / or simulation may be enhanced by using VMWARE software.
[0027] In further approaches, one or more networks 104, 106, 108 may represent a cluster of systems commonly referred to as a "cloud." In cloud computing, shared resources, such as processing power, peripherals, software, data, servers, etc., are provided to any system in the cloud on an on-demand basis, thereby allowing services to be accessed and distributed across multiple computing systems. Cloud computing typically involves Internet connections between systems operating in the cloud, but other technologies for connecting systems may also be used.
[0028] Figure 2 According to one embodiment, Figure 1 1 and 12. The diagram shows a typical hardware configuration of a workstation having a central processing unit 210 (eg, a microprocessor) and a number of other units interconnected via a system bus 212.
[0029] Figure 2 The workstation shown in the figure includes a random access memory (RAM) 214; a read-only memory (ROM) 216; an input / output (I / O) adapter 218 for connecting peripheral devices such as a disk storage unit 220 to the bus 212; a user interface adapter 222 for connecting a keyboard 224, a mouse 226, a speaker 228, a microphone 232 and / or other user interface devices such as a touch screen and a digital camera (not shown) to the bus 212; a communication adapter 234 for connecting the workstation to a communication network 235 (e.g., a data processing network); and a display adapter 236 for connecting the bus 212 to a display device 238.
[0030] A workstation may have an operating system resident on it, such as Microsoft Operating system (OS), MAC OS, UNIX OS, etc. It should be understood that the preferred embodiment can also be implemented on platforms and operating systems other than the above platforms and operating systems. The preferred embodiment can be written using extensible markup language (XML), C and / or C++ language or other programming languages and object-oriented programming methods. Object-oriented programming (OOP) has been increasingly used to develop complex applications.
[0031] Reference now Figure 3 , a flow chart of a method 300 according to one embodiment is shown. In various embodiments, the method 300 may be implemented in a system such as Figure 1 , 2 , 5, 6 and 7. Of course, method 300 may include Figure 3 The operations specifically described in the specification may be more or less than the operations specifically described in the specification, which can be understood by those skilled in the art when reading this specification.
[0032] Each step of method 300 may be performed by any appropriate component of an operating environment. For example, in various embodiments, method 300 may be performed in part or in whole by one or more servers, computers, or some other device having one or more processors therein. In any device, one or more steps of method 300 may be performed using, for example, a processing circuit, a chip, and / or a module implemented in hardware and / or software, and preferably a processor having at least one hardware component. Illustrative processors include, but are not limited to, a central processing unit (CPU), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA), and the like, and combinations thereof, or any other suitable computing device known in the art.
[0033] like Figure 3 As shown, method 300 may be initiated with operation 302, where a training data instance and a target instance are received at a scheduler. In one embodiment, the training data instance may include a text sentence represented as a dependency tree. In another embodiment, the training data instance may include a plurality of identified and labeled dependencies.
[0034] Additionally, in one embodiment, the target instance may include a portion of a dependency tree (eg, a subtree within a dependency tree, a portion of a sentence, etc.) In another embodiment, the scheduler may strategically call an encoder and a predictor to perform one or more operations.
[0035] In addition, method 300 can continue to operation 304, where the scheduler generates an input sequence from the training data instance and the target instance. In one embodiment, generating the input sequence can include parsing the training data instance and the target instance by the scheduler. For example, the input sequence can be generated by the scheduler based on the parsing. In another example, the input sequence can include a restructured training data instance and the target instance that can be understood by the encoder.
[0036] Furthermore, in one embodiment, the scheduler may include one or more of logistic regression, support vector machine (SVM), fully connected neural network, etc. In another embodiment, the input sequence may be generated based on a predetermined strategy.
[0037] For example, the strategy may include a cold start strategy. For example, the scheduler may use a uniform distribution to generate the input sequence. In another example, the strategy may include a warmup strategy. For example, the scheduler may use an epsilon greedy method to generate the input sequence. In another example, the strategy may include a heat convergence strategy. For example, the scheduler may use a maximum likelihood action to generate the input sequence.
[0038] In addition, method 300 may continue to operation 306, wherein the input sequence is sent from the scheduler to the encoder. In one embodiment, the scheduler may call the encoder by sending the input sequence to the encoder. In another embodiment, the encoder may include one or more of a recursive neural network (RNN), a hidden Markov model, a long short-term memory, and the like.
[0039] Additionally, method 300 may continue to operation 308 where the input sequence is mapped to a feature vector by the encoder. In one embodiment, the feature vector may include one or more features of the target instance within the training data instance.
[0040] Additionally, method 300 may continue to operation 310, wherein the feature vector is sent from the encoder to the scheduler. Additionally, method 300 may continue to operation 312, wherein the feature vector is sent from the scheduler to the predictor. In one embodiment, the scheduler may call the predictor by sending the feature vector to the predictor. In another embodiment, the feature vector may be conditionally sent to the predictor based on one or more criteria.
[0041] In addition, in one embodiment, the scheduler can determine whether the feature vector is sufficient to invoke the predictor. For example, the feature vector can be sent to the predictor in response to determining that the feature vector is sufficient to invoke the predictor. In another embodiment, the feature vector is not sent to the predictor in response to determining that the feature vector is insufficient to invoke the predictor.
[0042] Furthermore, in one embodiment, the scheduler may map the feature vector to an action ranking vector. In another embodiment, the predictor may include one or more of logistic regression, SVM, fully connected neural network, etc.
[0043] Additionally, method 300 may continue to operation 314, where the feature vector is mapped to a class vector by the predictor to create a label for the target instance. For example, the class vector may include a correlation between predetermined features and predetermined classes or labels. In one embodiment, the label may include a predicted nonfunctional label. For example, the predicted nonfunctional label may include a prediction of whether the target instance is a functional tag. In another example, the functional tag may include a portion of a sentence that includes details about an action performed in the sentence (e.g., location, time, details, etc.).
[0044] This way, the predictor can create a label for the target instance that indicates whether the target instance is a functional token or not.
[0045] In addition, in one embodiment, the label can be compared to a predetermined training label to determine the difference between the label and the predetermined training label. For example, the predetermined training label can be provided to the scheduler together with the training data instance and the target instance. In another example, the predetermined training label can include a ground truth label of the training data instance. In yet another example, the predetermined training label can include a predetermined label indicating whether the target instance is a functional tag.
[0046] Furthermore, in one embodiment, the predictor can be adjusted based on the difference. For example, the mapping performed by the predictor can be adjusted to reduce or eliminate the difference. In this way, the predictor can be trained using the difference.
[0047] Furthermore, in one embodiment, the difference can be sent from the predictor to the scheduler. In another embodiment, the scheduler can be adjusted based on the difference. For example, the scheduler's calls to the encoder and predictor can be adjusted to reduce or eliminate the difference. In this way, during the training of the scheduler, predictor, and encoder, reinforcement learning can be used to optimize the scheduler.
[0048] In addition, in one embodiment, a model can be applied to the adjusted scheduler. For example, the model can include a sentence represented as a dependency tree, and an identified subtree in the dependency tree. In another example, the adjusted scheduler can generate an input sequence from the model. The adjusted scheduler can then send the input sequence to an encoder. The encoder can then map the input sequence to a feature vector and then return the feature vector to the adjusted scheduler. The adjusted scheduler can send the feature vector to the adjusted predictor. The adjusted predictor can then map the feature vector to a class vector to create a label for the identified subtree (e.g., whether the subtree is functional or non-functional, etc.).
[0049] In this way, an analysis specifically focused on the identification of functional tags can be trained and applied to sentences represented as dependency trees. This can improve the prediction of functional tags in these sentences, which can reduce the amount of processing required to perform such predictions. This in turn can improve the performance of one or more computing devices performing such predictions.
[0050] Figure 4 An exemplary semantic role labeling environment 400 is shown, according to one embodiment. As shown, training data 402 including dependency trees 404 and goals 406 are input into a scheduler 408. The scheduler 408 creates an input sequence 410 that is sent to an encoder 412.
[0051] In addition, encoder 412 maps input sequence 410 to feature vector 414, which is then returned to scheduler 408. Scheduler 408 analyzes feature vector 414, and upon determining that feature vector 414 is sufficient to invoke predictor 416, scheduler 408 sends feature vector 414 to predictor 416.
[0052] In addition, in response to receiving the feature vector 414, the predictor 416 maps the feature vector 414 to a class vector to create a label 418 for the target 406. This created label 418 is compared to the ground truth label 420 of the target 406, and any error is sent to the predictor 416 and the scheduler 408 so that they can be adjusted to minimize future errors.
[0053] Coordinated Neural Networks: Combining Recurrent Neural Networks and Reinforcement Learning to Predict Functional Tags for Semantic Role Labeling
[0054] PropBank is a tagging scheme for English. It annotates sentences with three types of tags: predicates, numbered arguments, and functional markers. Each predicate (usually a verb) represents a main action in the sentence, and each numbered argument is a related argument to the central predicate. In particular, there is a frame file that lists all possible numbered arguments for each predicate. Finally, functional markers are labels for modifiers of the predicate, providing auxiliary information such as time, place, manner, and reason. Figure 5 The semantic tags 502A-E of the sentence "He bought a hammer from a local store on Monday morning." are shown. As can be seen in the figure, "He" 504 and "a hammer" 506 are parameters of the predicate (i.e., "bought" 508 in this example), while "from..." 510 and "on..." 512 are functional tags, indicating location (AM-LOC) 502D and time (AM-TMP) 502E, respectively.
[0055] All semantic roles can be predicted using a general approach. However, not all semantic roles are equal. Functional tags are much more flexible than predicates and numbered arguments. First, there is no predefined framework for functional tags. Therefore, one cannot rely on framework files as a knowledge base to help with prediction. Furthermore, functional tags may be missing in a sentence because they only provide relevant information. The resulting low frequency of occurrence makes it difficult for instance-based methods to find similar cases. Finally, the position of functional tags in a sentence is highly variable. For example, the sentence “On Monday morning he bought a hammer” is not different from the sentence “He bought a hammer on Monday morning”. Similarly, both the sentences “She picks a coin out of the pocket” and “She picks out of the pocket a coin” make sense. This flexibility affects the effectiveness of position-dependent features in classifier training. Furthermore, it also affects end-to-end models that generate global sequential features for prediction.
[0056] We believe that functional tags deserve a special approach. In this work, we develop a model, called Coordinate Neural Network (CoNN), to predict functional tags. CoNN treats the prediction task as playing a puzzle game where the player needs to collect fragmented clues and make a final guess. In particular, given a parsed dependency tree, the model starts from the root token of the target item and moves randomly along the children or parents according to the learned "meaning". Once it feels confident about the information it has collected, it stops and makes a prediction. Path navigation, information collection, and decision making are performed by different components of CoNN. Although different components have different local objective functions and local control over the whole process, they coordinate with each other to complete the prediction task together.
[0057] To illustrate how the model works, we use Figure 5 . To predict the functional tag for “on Monday morning”, the CoNN starts with the token “on” 512. The CoNN feels that the information so far is not sufficient and therefore decides to move on to its children. In reality, the word “on” 512 can represent either a location (AM-LOC) 502D or a time (AM-TMP) 502E, depending on the words that follow it. After reaching the token “morning”, the CoNN updates the information and decides to stop and predict the tag because “morning” is a strong signal for AM-TMP 502E. Similarly, to predict the functional tag for “from a local store”, the CoNN starts with the root token “from” 510. With this information, it decides to move on because in the training data, this token can represent either a direction (AM-DIR) or a location (AM-LOC) 502D, depending on the context. The model CoNN decides not to visit its children but instead to visit its parent, the token “buy” 508. The model CoNN then feels confident and predicts the role label, since the probability of the predicate "buy" being associated with the direction tag is low. It is worth noting that in implementation, the model cannot have such human-readable rules. Instead, it encodes all visited tokens into a latent feature vector and makes decisions based on this feature vector.
[0058] The contributions disclosed in this paper are threefold. First, we separate the prediction of functional tags from a general SRL task and propose a model to solve it. Our experimental results show that our method predicts functional tags with higher accuracy than those that focus on all semantic roles. In addition, we develop reinforcement learning and tailor Q-learning techniques to judiciously refine local information to help predict functional tags. Compared with methods that scan the entire sentence to obtain global features, our method is more efficient and requires a smaller model complexity. Finally, we conduct a large number of experiments to study the impact of different model structures and configurations on performance.
[0059] CoNN structure
[0060] The controller consists of three main components, namely the scheduler, encoder, and predictor. The scheduler is responsible for generating the input sequence from the parsed dependency tree. The encoder converts the input sequence into a hidden feature vector and finally, the predictor predicts its semantic role label. The pipeline of the prediction process 600 is as follows Figure 6 shown.
[0061] like Figure 6 As shown, the prediction pipeline starts from the target subtree 602, and the scheduler 604 determines the token x 606 to be passed to the encoder 608 from the target subtree 602. The encoder 608 receives the token x 606, combines it with the current hidden state, and maps it to a new token h 610. Then, based on the updated hidden state, the scheduler 604 makes a decision on how to continue, that is, select more tokens to feed to the encoder 608 (until there are no more available tokens) or stop. When the token feeding stops, the predictor 612 predicts the semantic role label y 614. During training, the predicted error 616 is back-propagated to the predictor 612 and the encoder 608 to adjust their parameters. At the same time, the error is converted into a reward score 618 that measures the quality of the generated token sequence. The score 618 is passed back to the scheduler 604 to optimize its token generation strategy. In addition, the solid arrows represent the data feed during prediction, while the dashed arrows represent the feedback during training.
[0062] Scheduler Model
[0063] The role of the scheduler is to schedule the input sequence judiciously so that the final predictor can give the correct prediction of the semantic role label. The operation mechanism of the encoder and predictor is completely transparent to the scheduler. Figure 7 Shows the benefits of abstracting away the scheduler and encapsulating other components in a black box environment. Figure 6 Redrawn pipeline. The results represent a classic case of reinforcement learning.
[0064] For each target instance, we set the initial hidden state to the state encoded using the root token of the corresponding target dependency tree. The action space includes i) get parent ii) get child and iii) stop. The first two actions are to obtain the parent token / child token of the current token in the dependency tree 702, and the last action is to activate the predictor 704 to give a prediction based on the latest hidden state. In particular, when a node has multiple children, the order of access to the children is restricted to the order in which they appear in the original statement. Finally, for the reward rule, generating a new token (actions i and ii) has an immediate reward of 0, while stopping (action iii) has an immediate reward of 1 / -1, where the value depends on whether the prediction is correct.
[0065] Formally, let w ha Represents the action ranking parameter. Given the hidden state h, from the action space The probability of selecting a specific action a in is defined as the softmax of all actions, as shown in Equation (1):
[0066]
[0067] Among them, h T represents the transpose of a vector, w ha (:; a) represents the a-th column of the matrix. The goal of the scheduler is to adjust the parameter w ha The value of maximizing the expected reward over time. In general, the objective function is defined as the sum of the immediate reward and the discounted future reward, as shown in the following equation (2):
[0068]
[0069] Where γ∈[0, 1] is the discount value for future rewards, usually set to 0.99. To optimize the scheduler efficiently, we can apply a regular Q-learning technique to minimize the difference between the estimated cumulative reward from time t and the actual reward return at time t+1 plus the expected future cumulative rewards:
[0070]
[0071] Among them, r t Represents the hidden state h t Take action t The immediate reward obtained after the Q evaluation function can be simply defined as the action value estimate without softmax:
[0072] Q(a|w ha, h)=h T ·w ha(:,a) (4)
[0073] However, due to the special setting of semantic role prediction, shortcuts can be taken to speed up the learning process.
[0074] Models of encoder and predictor
[0075] In this section, we will describe the structure of the encoder and predictor as they work as a whole. Specifically, the encoder is an Elman recurrent neural network and the predictor is a feedforward neural network. For each new token x fed by the scheduler t , the encoder uses the input-to-hidden matrix w ih and the hidden-to-hidden matrix w hh To update the hidden state, as follows:
[0076]
[0077] Among them, b h is the bias scalar, and tanh() is the hyperbolic tangent function. The predictor is only T is activated and based on the latest hidden state h T Specifically, the output y T is a vector with the same dimension as the total number of candidate labels. Similar to Eq. (1), a softmax normalization function is applied to obtain the likelihood of each possible choice. Note that for the intermediate hidden state {h t |1≤t<T}, the predictor can also generate a “virtual output” y t These outputs do not affect the final prediction and are only used to optimize the scheduler.
[0078] The encoder and predictor work as a whole and share the same goal, which is to maximize the number of correct predictions. Mathematically, this is done by maximizing the expected log-likelihood of the true label given the input sequence distribution. Formally, given a dataset of labeled dependency trees Let θ e ,θ p denote the parameters of the encoder and predictor respectively, then the objective function can be written as formula (6):
[0079]
[0080] d,l represents the target instance and its semantic role label. Distr(d,w ha ,θ e) represents the distribution of input sequences generated by the scheduler. Given an instance, the order of generated input tokens may be different due to the stochastic policy of action selection defined in equation (1). Finally, the probability of the actual label P(l|·) is the output vector y T The lth element value of .
[0081] CoNN Learning
[0082] In this section, we introduce model inference. Specifically, we first describe the modified Q-learning technique for optimizing the scheduler. Then we discuss the training of the entire model. For both the encoder and the predictor, the training uses standard back-propagation.
[0083] Customized Q-Learning
[0084] As shown earlier in equation (2), the key idea of Q-learning is to use the immediate reward at time t and the estimated future cumulative reward (with discount) starting from time t+1 to adjust the estimate at time t. More generally, one can track the τ time steps and hidden states of the action and make a series of adjustments. In this case, the estimated error gradient is expressed in equation (7):
[0085]
[0086] For simplicity, we omit w in the Q evaluation function. ha parameter.
[0087] It can be seen that for the hidden state h t The accurate estimation of h is highly dependent on all possible t+1 A complete traversal of . This is a general reinforcement learning technique for games with infinite rewards. However, in our case, assuming that the discount parameter γ is non-negative and not greater than 1, the immediate reward is either 0, 1, or -1, so the Q-function is strictly bounded in [-1; 1]. In addition, the goal of the scheduler is to generate a good input sequence where the encoder and predictor have high prediction accuracy. Therefore, the scheduler needs to avoid hidden states with negative rewards. This tendency provides an opportunity to customize the general Q-learning technique. Finally, for each hidden state, the scheduler can activate the predictor to obtain a virtual output of the actual immediate reward. This mechanism also helps to increase the learning speed.
[0088] In summary, we designed two rules during scheduler training as follows:
[0089] Reward limit. This rule is used to limit the estimated reward when propagating to the last hidden state to the range of -1 and 1.
[0090] All bad news. This rule applies no discount to negative immediate rewards, to increase the probability of avoiding the "failure-hidden state" of the scheduler.
[0091] Table 1 illustrates the learning algorithm.
[0092] Table 1
[0093]
[0094] As shown in Table 1, given a sampled hidden state sequence of a data instance and its true label, the algorithm first inversely scans each hidden state h t and the action performed t For each state, it activates the predictor to get the immediate reward if it stops in the hidden state. This value is deterministic and is therefore directly used to update the Q function (line 6). Then, for the actual action a t , it uses r t To update the Q function, it records the estimated best reward for the next timestamp (defined in line 13). Next, the algorithm estimates the discounted best reward at the current timestamp and backpropagates it. In particular, the discount is only applied if the current propagated reward is not -1 (lines 10 to 11). This is because rt = -1 indicates a future prediction failure and should be avoided. Finally, the estimated reward is clamped between -1 and 1 (line 14) to match the setting.
[0095] Training of the entire model
[0096] Although the scheduler, encoder, and predictor have different objective functions defined in equations (2) and (6), they influence each other through hidden states and prediction performance. Training is performed alternately. The encoder and predictor optimize themselves according to the distribution of the input token sequence generated by the scheduler to improve prediction accuracy. Then, with a fixed encoder and predictor, the scheduler learns which sequence the predictor "prefers" and adjusts its parameters in the direction of generating biased sequences. When the distribution of the input sequence changes, the encoder and predictor adjust again and adapt to the new sequence.
[0097] For the scheduler to generate sequences, we adopt three strategies in sequence, namely uniform random, biased random, and maximum strategy. The first strategy (uniform random) randomly selects actions to generate sequences without considering the action evaluation function or hidden state. It is used in the early training stage (cold start) when all model parameters are randomly initialized. After the early stage, the uniform random is gradually switched to the biased random strategy, that is, actions are selected according to the action evaluation function defined in Equation (1). Finally, in the last stage, the scheduler program uses the maximum strategy (i.e., takes the action with the highest evaluation score). This strategy fixes the resulting sequence, and the performance of the entire model fluctuates less and converges faster.
[0098] Table 2 illustrates the pseudocode of the learning algorithm.
[0099] Table 2
[0100]
[0101] Given a data set The learning takes I iterations. For each iteration, a data subset of size is randomly sampled Then an input sequence is generated, denoted as the function Gen(). The second parameter here is a selection strategy with values of uniform, random, or maximum corresponding to the above three strategies.
[0102] Specifically, when the iteration exceeds a certain predetermined threshold 1 < I* < I, the learning enters the warm convergence stage and uses the maximum strategy. Otherwise, a random number (0; 1) from 0 to 1 is selected to choose the uniform strategy or the biased strategy. It can be noted that the decision boundary is where α is a non-negative variable that affects the warm-up speed and i is the iteration number. Generally speaking, as the iteration increases, it is more likely to select a biased strategy. Also note that for the maximum strategy, only one input sequence is generated for each data instance, while for the other two strategies, m input sequences are generated. For a certain data instance, the generated input sequence is always the same as the maximum strategy, so one input sequence is sufficient. Finally, the generated sequence is fed back for alternately training the encoder, predictor, and scheduler.
[0103] In one embodiment, the encoder, predictor, and scheduler are iteratively trained. According to the scheduler state, the entire training is divided into three stages:
[0104] Cold start: The scheduler randomly "schedules" sequences
[0105] Warm-up: The scheduler reduces the randomness so that the distribution of the generated sequences is more consistent
[0106] Thermal convergence: The scheduler allows zero randomness, making the distribution fixed
[0107] We propose CoNNs for predicting functional markers in SRL. This implementation employs an RNN as encoder to encode the input sequence and a feed-forward neural network as the predictor. In addition, a scheduler is designed and trained using a custom reinforcement learning technique to efficiently generate the input sequence. Evaluation results show that CoNNs outperform state-of-the-art methods that focus on all SRL markers, confirming our contention that functional markers need to be modeled separately to achieve better overall accuracy.
[0108] In one embodiment, a method for predicting functional tags for semantic role labels (SRLs) in sentences may include: receiving training data, each training data including a dependency tree having zero or more subtrees labeled with ground-truth functional tags; training a model including a scheduler, an encoder, and a predictor, wherein (i) the scheduler is any function that maps a feature vector to an action ranking vector (including but not limited to logistic regression, SVM, fully connected neural network, etc.); determining a token to pass to the encoder and deciding when to call the predictor, (ii) the encoder is any function that maps an input data sequence to a feature vector (including but not limited to recurrent neural network, hidden Markov model, long short-term memory, etc.), (iii) the predictor is any function that maps a feature vector to a functional tag vector (including but not limited to logistic regression, SVM, fully connected neural network, etc.), and (iv) wherein, during training, the prediction error is used to adjust the parameters of the predictor, encoder, and scheduler, and the trained model is applied to predict the functional tags in the sentence.
[0109] In addition, the training strategy may include: a cold start strategy used by the scheduler to generate an action ranking vector by adopting a uniform distribution of actions; a warm-up strategy used by the scheduler to modify the action ranking vector by adopting an epsilon greedy method, that is, partly based on the estimated action probability and partly based on a uniform distribution; and a hot convergence strategy used by the scheduler to modify the action ranking vector by adopting the maximum likelihood action.
[0110] Reference now Figure 8 , shows a flow chart of a method 800 for predicting a functional tag of a semantic role label (SRL) in a sentence according to an embodiment. In various embodiments, the method 800 may be implemented in the present invention. Figure 1 , 2 , 5, 6 and 7. Of course, those skilled in the art will understand when reading this specification that method 800 may include more Figure 8 More or fewer operations may be performed as specifically described in .
[0111] Each step of method 800 may be performed by any appropriate component of an operating environment. For example, in various embodiments, method 800 may be performed in part or in whole by one or more servers, computers, or some other device having one or more processors therein. One or more steps of method 800 may be performed using a processor in any device, such as a processing circuit, a chip, and / or a module implemented in hardware and / or software and preferably having at least one hardware component. Illustrative processors include, but are not limited to, a central processing unit (CPU), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA), and the like, and combinations thereof, or any other suitable computing device known in the art.
[0112] like Figure 8 As shown, method 800 may begin at operation 802, where training data is received, wherein each training data includes a dependency tree, the dependency tree having zero or more subtrees labeled with basic fact functional labels. In addition, method 800 may proceed to operation 804, where a model is trained, wherein the model includes a scheduler, an encoder, and a predictor.
[0113] Furthermore, in one embodiment, the scheduler may include any function that maps a feature vector to an action ranking vector (including but not limited to logistic regression, SVM, fully connected neural network, etc.), determines the tokens to pass to the encoder, and decides when to call the predictor.
[0114] In another embodiment, the encoder may include any function that maps an input data sequence to a feature vector (including but not limited to recursive neural networks, hidden Markov models, long-short term memory, etc.). In yet another embodiment, the predictor may include any function that maps a feature vector to a functional label vector (including but not limited to logistic regression, SVM, fully connected neural networks, etc.).
[0115] In another embodiment, during training, the predicted error is used to adjust the parameters of the predictor, encoder, and scheduler.In addition, the method 800 can continue with operation 806, where the trained model is applied to predict functional tags in the sentence.
[0116] In addition, in one embodiment, the training strategy may include one or more of the following: a cold start strategy used by the scheduler to generate an action ranking vector by adopting a uniform distribution of actions; a warm-up strategy used by the scheduler to modify the action ranking vector by adopting an epsilon greedy method (i.e., partly based on estimated action probabilities and partly based on a uniform distribution); and a hot convergence strategy used by the scheduler to modify the action ranking vector by adopting the maximum likelihood action.
[0117] At any possible technical detail combination level, the present invention may be a system, method and / or computer program product. The computer program product may include a computer-readable storage medium carrying computer-readable program instructions for causing a processor to implement various aspects of the present invention.
[0118] A computer-readable storage medium may be a tangible device that can hold and store instructions used by an instruction execution device. A computer-readable storage medium may be, for example, but not limited to, an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the foregoing. More specific examples of computer-readable storage media (a non-exhaustive list) include: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a static random access memory (SRAM), a portable compact disk read-only memory (CD-ROM), a digital versatile disk (DVD), a memory stick, a floppy disk, a mechanical encoding device, such as a punch card or a raised structure in a groove on which instructions are stored, and any suitable combination of the foregoing. As used herein, a computer-readable storage medium is not to be interpreted as a transient signal per se, such as a radio wave or other freely propagating electromagnetic wave, an electromagnetic wave propagating through a waveguide or other transmission medium (e.g., a light pulse through a fiber optic cable), or an electrical signal transmitted through a wire.
[0119] The computer-readable program instructions described herein can be downloaded from a computer-readable storage medium to each computing / processing device, or downloaded to an external computer or external storage device via a network, such as the Internet, a local area network, a wide area network, and / or a wireless network. The network can include copper transmission cables, optical fiber transmissions, wireless transmissions, routers, firewalls, switches, gateway computers, and / or edge servers. The network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards the computer-readable program instructions for storage in the computer-readable storage medium in each computing / processing device.
[0120] The computer program instructions for performing the operation of the present invention may be assembler instructions, instruction set architecture (ISA) instructions, machine instructions, machine-dependent instructions, microcode, firmware instructions, state setting data, integrated circuit configuration data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages, such as Smalltalk, C++, etc., and procedural programming languages, such as "C" language or similar programming languages. Computer-readable program instructions may be executed entirely on a user's computer, partially on a user's computer, as an independent software package, partially on a user's computer, partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., using an Internet service provider to connect via the Internet). In some embodiments, an electronic circuit, such as a programmable logic circuit, a field programmable gate array (FPGA), or a programmable logic array (PLA), may be personalized by utilizing the state information of the computer-readable program instructions, and the electronic circuit may execute the computer-readable program instructions, thereby realizing various aspects of the present invention.
[0121] Various aspects of the present invention are described herein with reference to the flow charts and / or block diagrams of the methods, devices (systems) and computer program products according to embodiments of the present invention. It should be understood that each box of the flow chart and / or block diagram and the combination of each box in the flow chart and / or block diagram can be implemented by computer-readable program instructions.
[0122] These computer-readable program instructions can be provided to a processor of a computer or other programmable data processing device, thereby producing a machine, so that when these instructions are executed by the processor of the computer or other programmable data processing device, a device that implements the functions / actions specified in one or more boxes in the flowchart and / or block diagram is generated. These computer-readable program instructions can also be stored in a computer-readable storage medium, and these instructions cause the computer, programmable data processing device and / or other equipment to work in a specific manner, so that the computer-readable medium storing the instructions includes a manufactured product, which includes instructions for implementing various aspects of the functions / actions specified in one or more boxes in the flowchart and / or block diagram.
[0123] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device so that a series of operating steps are performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the instructions executed on the computer, other programmable data processing apparatus, or other device to implement the functions / actions specified in one or more boxes in the flowchart and / or block diagram.
[0124] The flow chart and block diagram in the accompanying drawings show the possible architecture, function and operation of the system, method and computer program product according to multiple embodiments of the present invention. In this regard, each box in the flow chart or block diagram can represent a part of a module, program segment or instruction, and the part of the module, program segment or instruction contains one or more executable instructions for realizing the specified logical function. In some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two continuous boxes can actually be completed as a step, executed in parallel, and executed substantially in parallel in a partially or completely overlapping manner in time, and they can sometimes also be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flow chart, and the combination of the boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or action, or can be implemented with a combination of dedicated hardware and computer instructions.
[0125] In addition, the system according to various embodiments may include a processor and logic integrated with the processor and / or executable by the processor, the logic being configured to perform one or more processing steps described herein. The processor may be any configuration as described herein, such as a discrete processor or a processing circuit including many components (e.g., processing hardware, memory, I / O interface, etc.). By integrated with a processor, it is meant that the processor has logic embedded therein as hardware logic, such as an application-specific integrated circuit (ASIC), FPGA, etc. executed by a processor. By executable by a processor, it is meant that the logic is hardware logic, software logic such as firmware, a part of an operating system, a part of an application, etc., or a combination of hardware and software logic, which is accessible to the processor and configured to cause the processor to perform certain functions when executed by the processor. The software logic may be stored in local and / or remote memory of any memory type known in the art. Any processor known in the art, such as a software processor module and / or a hardware processor, such as an ASIC, FPGA, a central processing unit (CPU), an integrated circuit (IC), a graphics processing unit (GPU), etc., may be used.
[0126] Obviously, the various features of the above-described systems and / or methods may be combined in any manner, thereby creating multiple combinations according to the above description.
[0127] It will be further appreciated that embodiments of the present invention may be provided in the form of a service that is deployed on behalf of a client to provide services on demand.
[0128] The embodiments of the present invention have been described above, and the above description is exemplary, not exhaustive, and is not limited to the disclosed embodiments. Many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The terms used herein are selected to best explain the principles of the embodiments, practical applications, or technical improvements to the technology in the market, or to enable other persons of ordinary skill in the art to understand the embodiments disclosed herein.
Claims
1. A computer-implemented method comprising: Receiving training data instances and target instances; as well as Train the model including scheduler, encoder and predictor, The scheduler is a function that maps feature vectors to action ranking vectors, determines the tokens to pass to the encoder, and decides when to call the predictor; The encoder is a function that maps an input sequence to a feature vector; where the predictor is a function that maps a feature vector to a functional label vector; as well as During training, the predicted error is used to adjust the parameters of the predictor and scheduler, wherein the training includes three stages, which include: (a) The cold start strategy used by the scheduler generates the action ranking vector by taking a uniform distribution of actions, (b) The warm-up strategy used by the scheduler, by adopting an epsilon greedy approach to modify the action ranking vector, and (c) The thermal convergence strategy used by the scheduler to modify the action ranking vector by taking the maximum likelihood action.
2. The computer-implemented method of claim 1 , wherein: The training data instances consist of sentences represented as dependency trees, A target instance includes part of the dependency tree. Input sequences are generated from training data instances and target instances, The input sequence includes reorganized training data instances and target instances that can be understood by the encoder, and the feature vector includes one or more features of the target instance in the training data instance.
3. The computer-implemented method of claim 1 , wherein: A training data instance consists of a sentence represented as a dependency tree.
4. The computer-implemented method of claim 1 , wherein: The training data instances include multiple identified and labeled dependencies.
5. The computer-implemented method of claim 1 , wherein: A target instance includes a portion of the dependency tree.
6. The computer-implemented method of claim 1 , wherein: A target instance includes a subtree of the dependency tree.
7. The computer-implemented method of claim 1 , wherein: The feature vector includes one or more features of the target instance within the training data instance.
8. The computer-implemented method of claim 1 , wherein: The scheduler is selected from the group consisting of a logistic regression module, a support vector machine (SVM), and a fully connected neural network.
9. The computer-implemented method of claim 1 , wherein: The encoder is selected from the group consisting of a recurrent neural network (RNN), a hidden Markov model, and a long short-term memory.
10. The computer-implemented method of claim 1, wherein: The predictor was selected from the group consisting of a logistic regression module, a support vector machine (SVM), and a fully connected neural network.
11. The computer-implemented method of claim 1 , wherein: The feature vector is sent to the predictor in response to determining that the feature vector is sufficient to invoke the predictor.
12. The computer-implemented method of claim 1, further comprising applying a model to the adjusted scheduler.
13. The computer-implemented method of claim 1, wherein: In response to the scheduler determining that the feature vector is sufficient to invoke the predictor, the feature vector is sent to the predictor, wherein in response to the scheduler determining that the feature vector is insufficient to invoke the predictor, the feature vector is not sent to the predictor.
14. The computer-implemented method of claim 1, wherein: Input sequences are generated from training data instances and target instances based on predetermined strategies, including a cold start strategy, where a scheduler adopts a uniform distribution to generate input sequences.
15. The computer-implemented method of claim 1, wherein: The input sequence is generated based on a predetermined strategy, which includes a warm-up strategy, where the scheduler uses an epsilon greedy method to generate the input sequence.
16. The computer-implemented method of claim 1, wherein: The input sequence is generated based on a predetermined strategy, which includes a thermal convergence strategy, where the scheduler adopts a maximum likelihood action to generate the input sequence.
17. A computer program product for predicting functional tags for semantic role labeling, the computer program product comprising a computer-readable storage medium embodying program instructions, the program instructions being executable by a processor to cause the processor to perform the steps of the method according to any one of claims 1 to 16.
18. An apparatus comprising one or more modules, wherein the one or more modules are configured to implement the steps of the method according to any one of claims 1 to 16.
19. A system comprising: processor; and Logic integrated with a processor, executable by a processor, or integrated with a processor and executable by a processor, the logic being configured to implement the steps of the method according to any one of claims 1 to 16.
20. A computer-implemented method comprising: Receiving training data, wherein each training data includes a dependency tree having one or more subtrees, and the subtrees are annotated with basic fact functional labels; Train a model consisting of a scheduler, encoder, and predictor, where: (i) The scheduler is a function that maps feature vectors to action ranking vectors, determines the tokens to pass to the encoder, and decides when to call the predictor; (ii) The encoder is a function that maps an input data sequence to a feature vector; (iii) the predictor is a function that maps a feature vector to a functional label vector; and (iv) wherein during training, the predicted error is used to adjust parameters of the predictor, encoder and scheduler; and (v) wherein the training comprises three stages, the three stages comprising: (a) The cold start strategy used by the scheduler generates the action ranking vector by taking a uniform distribution of actions, (b) The warm-up strategy used by the scheduler, by adopting an epsilon greedy approach to modify the action ranking vector, and (c) a thermal convergence strategy used by the scheduler to modify the action ranking vector by taking the most likely action; and Apply the trained model to predict functional tags in sentences.
21. A computer program product, the computer program product comprising a computer-readable storage medium embodying program instructions, the program instructions being executable by a processor to cause the processor to perform the steps of the method according to claim 20.
22. An apparatus comprising one or more modules, wherein the one or more modules are configured to implement the steps of the method according to claim 20.
23. A system comprising: processor; and Logic integrated with a processor, executable by a processor, or integrated with a processor and executable by a processor, the logic being configured to implement the steps of the method according to claim 20.
