Skip to content

nithin-kumar/question_type_predictor

Repository files navigation

question_type_predictor

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.

Repository contains

  1. row_data.txt which is the master corpus of all questions.

  2. qprocess.py , is a python script to separate out the different classes of question.

  3. affirmation_questions.txt, who_questions.txt, what_questions.txt, when_questions.txt, unknown_questions.txt all are generated by the script qprocess.py

  4. qpredictor.py , is the main script which classifies the questions.

  5. input.txt is test input file

How to run

  1. download the repository and go the repository (Use cd command)

  2. 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.

About

Predict the type Question type

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages