Skip to content

DushyantaDhyani/QClass

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

QClass

A python package to predict the Class of a Question i.e. whether Who , What , When , Affirmation or Unknown.

Installation

Required packages (for Python 2.7.6)

joblib==0.9.4
nltk==3.2
numpy==1.10.4
pandas==0.17.0
scikit-learn==0.17
scipy==0.17.0
sklearn==0.0

Usage

From Command Line

python QClass.py "What is your name?"

Output

WHAT

From Inside Python Code

from QClass import getQClass
queslist=[
    'Define metamorphosis',
    'What was the date of the match?',
    'Did John enjoy the match?',
    'Who invented electricity?',
    "Did you hear John's decided to go to business school?",
    'Explain centrifugal force',
    'What is the name of the god of water?',
    'Is it dry outside?',
]
for ques in queslist:
    print ques+"\t"+getQClass(ques)    

Output

Define metamorphosis	UNKNOWN
What was the date of the match ?	WHEN
Did John enjoy the match ?	Affirmation
Who invented electricity ?	WHO
Did you hear John's decided to go to business school ?	Affirmation
Explain centrifugal force	UNKNOWN
What is the name of the god of water ?	WHAT
Is it dry outside ?	Affirmation

Training Your Own Classifier

Place your train.csv in the data folder in the following tab-separated format

Question Label

Note: The Affirmation cases do not require training (they are heuristics based) and so should be included in the training file .

Run python training.py and the model would be saved in the model directory.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages