2

In the original Google's SmartReply paper:

Our search is conducted as follows. First, the elements of R (the set of all possible responses) are organized into a trie. Then, we conduct a left-to-right beam search, but only retain hypotheses that appear in the trie. This search process has complexity O(bl) for beam size b and maximum response length l. Both b and l are typically in the range of 10-30, so this method dramatically reduces the time to find the top responses and is a critical element of making this system deployable.

I want to implement something similar. Some questions:

  1. How to represent the set of all possible responses (R) in a trie data structure in TF?
  2. How to modify the current beam search to retain only hypothesis that are available in R?
AmirHJ
  • 827
  • 1
  • 11
  • 21
  • there's a beam search op in TF runtime -- https://github.com/tensorflow/tensorflow/blob/754048a0453a04a761e112ae5d99c149eb9910dd/tensorflow/core/kernels/ctc_decoder_ops.cc – Yaroslav Bulatov Feb 02 '17 at 02:46
  • Thanks @YaroslavBulatov . Would you please give me some hints on how to using this op in a seq2seq model. Any link or document is very useful. – AmirHJ Feb 02 '17 at 07:39
  • Hi Amir, did you find the answer? – Hadij Nov 26 '20 at 20:30

0 Answers0