Predict the type Question type This is a classification problem, where we have a labeled set of data of Questions and their type. Here I used Multinomial Naive Bayes theorem with Laplace smoothing.
-
row_data.txt which is the master corpus of all questions.
-
qprocess.py , is a python script to separate out the different classes of question.
-
affirmation_questions.txt, who_questions.txt, what_questions.txt, when_questions.txt, unknown_questions.txt all are generated by the script qprocess.py
-
qpredictor.py , is the main script which classifies the questions.
-
input.txt is test input file
-
download the repository and go the repository (Use cd command)
-
There are 2 ways you can run the program
a) Commandline : In terminal run "qpredictor.py" which is an interactive program which will ask questions and you can use the keyboard to type the question. After entering the question press enter, it will predict the question type and print on the same terminal.
b) Read from file: Enter all questions in a file (refer "input.txt") , then in terminal run"python qpredictor.py input.txt > output.txt". Press enter. Now in the same directory a file named "output.txt" will be generated with the predictions.