Skip to content

NitishShandilya/NaiveBayesClassifier

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NaiveBayesClassifier

Language: Python
Description: A Naive Baye's classifier in Python that classifies the hotel reviews as either (deceptive or truthful) and (positive/negative)
Details:-
Data
A set of training data will be made available as a compressed ZIP archive. The uncompressed archive will have the following format
A top-level directory with two sub-directories, one for positive reviews and another for negative reviews (plus license and readme files which we won’t need for the exercise). Each of the subdirectories contains two sub-directories, one with truthful reviews and one with deceptive reviews. Each of these subdirectories contains four subdirectories, called “folds”. Each of the folds contains 80 text files with English text (one review per file).
Programs:
Two programs are written: nblearn.py will learn a naive Bayes model from the training data and nbclassify.py will use the model to classify new data. The learning program will be invoked in the following way:
python nblearn.py /path/to/input
The argument is the directory of the training data; the program will learn a naive Bayes model, and write the model parameters to a file called nbmodel.txt.
The classification program will be invoked in the following way:
python nbclassify.py /path/to/input
The argument is the directory of the test data; the program will read the parameters of a naive Bayes model from the file nbmodel.txt, classify each file in the test data, and write the results to a text file called nboutput.txt in the following format:
label_a label_b path1
label_a label_b path2

In the above format, label_a is either “truthful” or “deceptive”, label_b is either “positive” or “negative”, and pathn is the path of the text file being classified.

About

A Naive Baye's classifier in Python that classifies the hotel reviews as either (deceptive or truthful) and (positive/negative)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages