Back to All

Artificial Intelligence or Bot in Python

This is more of a vague/general question, so for that I do apologize in advance. As part of my AI training projects, I'm building a simple Pthon app with Twilio integration that will allow users to send messages such as "how are you" and receive a quasi-intelligent response back from the app such as, "Good, how about yourself, Michel?".

I have everything wired up and it works but I was wondering if anyone could point me in the right direction of writing an algorithm in Python that would make this "bot" smarter. Right now I'm using a pretty straight forward if/elsif/else chain to parse the payload and deliver the proper response but this does not seem maintainable once I get past 5-10 keywords.

Would I be better off with a case statement (at least for readability) or is there a better OOP design pattern that would help me match my keywords and deliver a certain response?