Chatbot using Machine Learning vs Programming I am currently building a chatbot. What I have done so far is, collected possible questions/training data/files and created a model out of it using Apache OpenNLP; the model is able to predict all the questions that are in the training data and fails to predict for new questions. 

Instead of doing all the above, I can write a program that matches the question/words against training data and predict the answer &mdash; what is the advantage of using Machine Learning algorithms?

I have searched extensively about this and all I got was, in Machine Learning there is no need to change the algorithm and the only change would be in the training data, but that is the case with programming too: the change will be in training data.
In my view ML does not work very well for conversational AI systems. It is generally alright for intent recognition, so getting what the user wants if they ask a question ("I want to book a flight?", "What is the weather in London?"), but anything after that quickly becomes difficult to handle, especially multi-step conversations that go beyond simple question/answer pairs.

My suggestion would be to plan possible dialogues out as flow charts (more like trees/graphs, as there can be multiple branches at any point), and then write a program that interprets the graph based on user input and gives appropriate replies. You will also want to have some conversational memory to keep track of any information the user has mentioned. That is also tricky to do in a ML system.

For a very simple framework to start off with, have a look at ELIZA. It's half a century old, but you can still use it as a starting point.

(Disclaimer: I work for a company that makes conversational AI systems)