Research Article
A Sentence-Level Joint Relation Classification Model Based on Reinforcement Learning
Algorithm 1
Joint training of the RL model and joint network model.
| | Input: Number of Episode N. Training data X, Initialize the RL model parameters and joint network model Parameters | | | Output: RL model parameters ψ and joint network model Parameters θ | | (1) | for episode n = 1 to N do | | (2) | foreachdo | | (3) | Calculate the predicted score for each state | | (4) | According to the predicted score, the action taken on the state is obtained | | (5) | Calculate temporary and average Awards | | (6) | Update the parameters of RL model | | (7) | Calculate total award | | (8) | end foreach | | (9) | Train and update the parameters θ of joint network model | | (10) | Update the parameters of RL model | | (11) | Find the best parameters for RL model according to the reward | | (12) | Update the weights of the RL networks | | (13) | end for |
|