How can I program a simple chat bot AI?

后端 未结 11 2028
一整个雨季
一整个雨季 2021-01-29 20:33

I want to build a bot that asks someone a few simple questions and branches based on the answer. I realize parsing meaning from the human responses will be challenging, but how

11条回答
  •  感动是毒
    2021-01-29 20:57

    If you're just dabbling, I believe Pidgin allows you to script chat style behavior. Part of the framework probably tacks the state of who sent the message when, and you'd want to keep a log of your bot's internal state for each of the last N messages. Future state decisions could be hardcoded based on inspection of previous states and the content of the most recent few messages. Or you could do something like the Markov chains discussed and use it both for parsing and generating.

提交回复
热议问题