// the find
dennybritz/chatbot-retrieval
Dual LSTM Encoder for Dialog Response Generation
A 2016-era TensorFlow implementation of the Dual LSTM Encoder for retrieval-based dialog, trained on the Ubuntu Dialogue Corpus. It picks the most likely response from candidates rather than generating text. Aimed at researchers or students trying to understand retrieval-based chatbots at a foundational level.
The companion blog post on wildml.com is genuinely good — one of the clearer explanations of retrieval vs generative approaches written during that period. The code is clean and narrow enough to read in a sitting: dual encoder in ~100 lines, input pipeline separate from model logic. Includes a TF-IDF baseline so you can see exactly how much the LSTM actually buys you. The Ubuntu Dialogue Corpus is a real benchmark, not a toy dataset.
Requires TensorFlow 0.9 from 2016 — this will not run without either a time machine or a significant porting effort; the TF API changed dramatically. Last touched in 2022 only to add a .gitattributes file; the model itself hasn't been updated since 2016. No pretrained weights, so you must download and preprocess the full Ubuntu corpus yourself before seeing anything work. LSTM-based retrieval has been thoroughly superseded by transformer encoders (BERT-style bi-encoders), so the approach has limited practical relevance today beyond historical understanding.