I am implementing a Seq2Seq model in Keras. However, they have not provided the beam search option in the decoder. Hence, I considered pynlpl's BeamSearch but their documentation on search found here doesn't have any information about how to implement it. Could you please give an example of how beam search can be implemented?
There is a similar answer here: How to implement a custom beam search in TensorFlow? but, its not clear.
TensorFlow addons
providesbeam-search
facility. Quoting from the official documentation:Following is the class-signature:
And here is an example: