Top AI Repos — open-source AI, indexed and scored
Top AI Repos tracks AI repositories on GitHub and answers two different questions about each one: is it moving right now, and would you bet a product on it.
Top AI Repos tracks AI repositories on GitHub and answers two different questions about each one: is it moving right now, and would you bet a product on it.
Seq2seq chatbot with attention and anti-language model to suppress generic response, option for further improve by deep reinforcement learning.
| Date | Stars |
|---|---|
| 2026-07-31 | 361 |
| 2026-08-01 | 361 |
| 2026-08-02 | 361 |
| 2026-08-06 | 361 |
Today
— stars today
This week
— stars this week
This month
— stars this month
Momentum
0.0
growth rate 0.00%/day
# Tensorflow chatbot
### (with seq2seq + attention + dict-compress + beam search + anti-LM + facebook messenger server)
> ####[Update 2017-03-14]
> 1. Upgrade to tensorflow v1.0.0, no backward compatible since tensorflow have changed so much.
> 2. A pre-trained model with twitter corpus is added, just `./go_example` to chat! (or preview my [chat example](https://github.com/Marsan-Ma/tf_chatbot_seq2seq_antilm/blob/master/example_chat.md))
> 3. You could start from tracing this `go_example` script to know how things work!
## Briefing
This is a [seq2seq model][a1] modified from [tensorflow example][a2].
1. The original tensorflow seq2seq has [attention mechanism][a3] implemented out-of-box.
2. And speedup training by [dictionary space compressing][a4], then decompressed by projection the embedding while decoding.
3. This work add option to do [beam search][a5] in decoding procedure, which usually find better, more interesting response.
4. Added [anti-language model][a6] to suppress the generic response problem of intrinsic seq2seq model.
5. Imeplemented [this deep reinforcement learning architecture][a7] as an option to enhence semantic coherence and perplexity of response.
6. A light weight [Flask][a8] server `app.py` is included to be the Facebook Messenger App backend.
[a1]: http://arxiv.org/abs/1406.1078
[a2]: https://www.tensorflow.org/versions/r0.10/tutorials/seq2seq/index.html
[a3]: http://arxiv.org/abs/1412.7449
[a4]: https://arxiv.org/pdf/1412.2007v2.pdf
[a5]: https://en.wikipedia.org/wiki/Beam_search
[a6]: https://arxiv.org/abs/1510.03055
[a7]: https://arxiv.org/abs/1606.01541
[a8]: http://flask.pocoo.org/
[a9]: https://github.com/Marsan-Ma/tf_chatbot_seq2seq_antilm/blob/master/README2.md
## In Layman's terms
I explained some detail about the features and some implementation tricks [here][a9].
## Just tell me how it works
#### Clone the repository
git clone github.com/Marsan-Ma/tf_chatbot_seq2seq_antilm.git
#### Prepare for Corpus
You may find corpus such as twitter chat, open movie subtitle, or ptt forums from [my chat corpus repository][b1]. You need to put it under path like:
tf_chatbot_seq2seq_antilm/works/<YOUR_MODEL_NAME>/data/train/chat.txt
And hand craft some testing sentences (each sentence per line) in:
tf_chatbot_seq2seq_antilm/works/<YOUR_MODEL_NAME>/data/test/test_set.txt
#### Train the model
python3 main.py --mode train --model_name <MODEL_NAME>
#### Run some test example and see the bot response
after you trained your model until perplexity under 50 or so, you could do:
python3 main.py --mode test --model_name <MODEL_NAME>
**[Note!!!] if you put any parameter overwrite in this main.py commmand, be sure to apply both to train and test, or just modify in lib/config.py for failsafe.**
## Start your Facebook Messenger backend server
python3 app.py --model_name <MODEL_NAME>
You may see this [minimum fb_messenger example][b2] for more details like setting up SSL, webhook, and work-arounds for known bug.
Here's an interesting comparison: The left conversation enabled beam search with beam = 10, the response is barely better than always "i don't know". The right conversation also used beam search and additionally, enabled anti-language model. This supposed to suppress generic response, and the response do seems better.
![messenger.png][h1]
[h1]: https://raw.githubusercontent.com/Marsan-Ma/tf_chatbot_seq2seq_antilm/master/doc/messenger.png
## Deep reinforcement learning
> [Update 2017-03-09] Reinforcement learning does not work now, wait for fix.
If you want some chance to further improve your model, here I implemented a reinforcement learning architecture inspired by [Li et al., 2016][b3]. Just enable the reinforce_learn option in `config.py`, you might want to add your own rule in `step_rf()` function in `lib/seq2seq_mode.py`.
Note that you should **train in normal mode to get a decent model first!**, since the reinforcement learningExcerpt of 10,462 characters
Read on GitHubWould you bet a product on this? Bounded 0–100 and slow moving.
matched fp:27e70dafd8c9a433, llm:Repository description: 'Seq2seq chatbot with attention and anti-language model to suppress generic response, option for further improve by deep reinforcement learning.' Topics: seq2seq-chatbot, seq2seq-model, language-model, deep-reinforcement-learning, beam-search.
matched fp:27e70dafd8c9a433, llm:Repository description: 'Seq2seq chatbot with attention and anti-language model to suppress generic response, option for further improve by deep reinforcement learning.' Topics: seq2seq-chatbot, seq2seq-model, language-model, deep-reinforcement-learning, beam-search.
matched fp:27e70dafd8c9a433, llm:Repository description: 'Seq2seq chatbot with attention and anti-language model to suppress generic response, option for further improve by deep reinforcement learning.' Topics: seq2seq-chatbot, seq2seq-model, language-model, deep-reinforcement-learning, beam-search.
matched fp:27e70dafd8c9a433, llm:Repository description: 'Seq2seq chatbot with attention and anti-language model to suppress generic response, option for further improve by deep reinforcement learning.' Topics: seq2seq-chatbot, seq2seq-model, language-model, deep-reinforcement-learning, beam-search.