asyml / texar-pytorch

Integrating the Best of TF into PyTorch, for Machine Learning, Natural Language Processing, and Text Generation. This is part of the CASL project: http://casl-project.ai/
https://asyml.io
Apache License 2.0
744 stars 118 forks source link

Incorporating copy mechanism in decoder #309

Open roemmele opened 4 years ago

roemmele commented 4 years ago

I'm really enjoying this library, thanks for your work. Just curious, are there any plans to implement some sort of copying mechanism for decoding, e.g. CopyNet (https://arxiv.org/abs/1603.06393)?

huzecong commented 4 years ago

Thank you for using Texar! Unfortunately we don't have current plans to add built-in support for copying mechanism.

That said, given what's already in the library, it shouldn't be too difficult to implement the copying mechanism based on AttentionRNNDecoder; you would only need to modify the initialize(), step(), and next_inputs() methods: https://github.com/asyml/texar-pytorch/blob/95f3d644680656f38b7b1779f2ba184ef9e1f81a/texar/torch/modules/decoders/rnn_decoders.py#L556-L600

If you have a working implementation, you're more than welcome to create a pull request and contribute to the library!

roemmele commented 4 years ago

Ok, I may try to do that at some point. Thanks!