This Machine Learning module classifies categories of text input. It can also handle speech input using an Amazon Alexa together. The diagram of the architecture is as follows. You can deploy this module in a server or a local PC. It takes JSON requests first, which includes text message, and then process the data to classify categories of the input text. After predicting the category of the input text, it responds with JSON, which contains the predicted category.
- Test
tfidf.py
.
$ python tfidf.py
- Create pickle files for data and dictionaries.
$ python make_pkl_for_data_and_dic.py
Executing the above command, you will create two pickle files data.pkl
and dic.pkl
in data/pkl
directory.
- Train a ML model by using Multilayer Perceptron(MLP) algorithms.
$ python train_mlp.py
You will save the weights(parameters) of the model genre-model.hdf5
in data/weights
directory after training.
- Test the trained model.
$ python prdict_using_mlp.py
- Deploy the model as a WebAPI.
$ python webapi.py