Here we will predict the next word using our data set ,we will use numpy library for fetching the data set and then we will go line by line in data if something matches with the user input then it will predict next word and if there is not any similar sentence then it will say unable to predict.
All library required before running the script->numpy
pip install numpy
Here the most important thing is that we need to create a proper dataset from which we are going to predict,so our data set should be large. Next thing is importing the numpy library and then going line by line for predicting the word.