Giter Club home page Giter Club logo

topic-classifier's Introduction

Topic-classifier

Formulation:

We use a count/probability Naive Bayes approach that is similar to spam classification in this implementation

Program Working:

The program runs by running topics.py. It takes input from the user about the mode i.e. training or testing along with a fraction. The fraction given by the user contributes to the probability of supervised or unsupervised learning. Each topics given in the training folder is parsed. Once the file is encountered, a coin is flipped which is biased on the fraction provided by the user. The coin decides whether or not the classification of that file is known or not. If the classification of the file is known, the file text goes into supervised list with which a model is created. In the training part the files for which the classification are unknown, the model of the supervised list is used iteratively to get predictions on the unknown training data. Once our model is trained, we save the model into a file. In the testing mode, the model which we saved is loaded back into the variables and the probabilities are used to predict the classification of the files.

To make the program stop quickly and to avoid unnecessary iterations, we stop the program as soon as the prior probability of the unsupervised list in the training mode starts converging. By default, we have set the program to stop if the difference in the prior probabilities is less than or equal to 10.

topic-classifier's People

Contributors

prateek22sri avatar

Stargazers

 avatar  avatar  avatar

Watchers

 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.