Code Monkey home page Code Monkey logo

classification's Introduction

Task

Identify Question Type: Given a question, the aim is to identify the category it belongs to. The four categories to handle: Who, What, When, Affirmation(yes/no).
Label any sentence that does not fall in any of the above four as "Unknown" type.

Example

  1. What is your name? Type: What

  2. When is the show happening? Type: When

  3. Is there a cab available for airport? Type: Affirmation

Sample Data

what 's the second-most-used vowel in english ? ,,, what
who was the inventor of silly putty ? ,,, who
what is the highest waterfall in the united states ? ,,, what
name a golf course in myrtle beach . ,,, unknown
which two states enclose chesapeake bay ? ,,, unknown
what does the abbreviation aids stand for ? ,,, what
what does a spermologer collect ? ,,, what

Algorithms Used:

Naive Bayes Classifier (Reference: http://textblob.readthedocs.io/en/dev/classifiers.html)

Codes:

Data.py - Read the input data file. Do cleaning, transformation etc.
Classifier.py - Train the model on the data and predict class for test observations
Models.py - Takes input arguments from user, calls function 'Data.py' and 'Classifier.py'. Save the results in the files.
Sklearn.py - Compare various classifiers based on the accuracy and select the best one among them.[Need some modification for input data type]

How to use

Just execute the code "Models.py"

Parameters to play with models

data_type [default = 0 > To take into effect word's position(Explaination in sec 1.1 below), any other value otherwise]
training_part [default = 0.8 > How much part of data will be used for training]
use_saved_cl [default = 0 > Will train model on training data, otherwise use saved trained model]
cutoff_prob [default = 0.9 > If all predicted class probabilities falls below this number, it will assign class "unknown"]
prediction_only [default = 0 > Nonzero values if only want to predict class (on new dataset for which we don't know actual class)]
prob_chk [default = 0 > Nonzero value will save predicted class with the probability on which they have been assigned]

classification's People

Contributors

ashish9112 avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.