Closed lihuiliullh closed 1 year ago
May I know the purpose of the following code in model.forward()?
s_history_tag[s_history_tag != 0] = self.args.lambdax o_history_tag[o_history_tag != 0] = self.args.lambdax
s_non_history_tag[s_history_tag == 1] = -self.args.lambdax s_non_history_tag[s_history_tag == 0] = self.args.lambdax
o_non_history_tag[o_history_tag == 1] = -self.args.lambdax o_non_history_tag[o_history_tag == 0] = self.args.lambdax
s_history_tag[s_history_tag == 0] = -self.args.lambdax o_history_tag[o_history_tag == 0] = -self.args.lambdax
Thank you for your interest in our work, the codes aims to generate historical and non-historical dependency for copy-mechanism. You can find it Section3.2. The illustration is shown as follows:
May I know the purpose of the following code in model.forward()?
s_history_tag[s_history_tag != 0] = self.args.lambdax o_history_tag[o_history_tag != 0] = self.args.lambdax
s_non_history_tag[s_history_tag == 1] = -self.args.lambdax s_non_history_tag[s_history_tag == 0] = self.args.lambdax
o_non_history_tag[o_history_tag == 1] = -self.args.lambdax o_non_history_tag[o_history_tag == 0] = self.args.lambdax
s_history_tag[s_history_tag == 0] = -self.args.lambdax o_history_tag[o_history_tag == 0] = -self.args.lambdax