Constrain the search of the decoder in seq2seq architechture
I am trying to train aseq2seqmodel with constraints on the form of the output sequence.My input sequence is unconstrained (any sentence), and my output sequence is formal language that resembles assembly.The output sequence is a series of triplets of(operator, operand_1, operand_2)An example triplet is(move, living_room, kitchen), note that given that theoperatoris"move"the type of the 2 operands is determined and it must be a room.I know all operators, operands and constraints in advanced.I’ve been looking into overriding thegreedy_searchmethod, butadjust_logits_during_generationalso looks like an interesting direction.How would you tackle this problem ?