/text-classification

Text classification using Bernoulli Naive Bayes

Primary LanguagePython

Text-classification, full implementation from scratch (no libraries):

Text classification using Bernoulli Naive Bayes from scratch:

  • Data cleaning and vectorizing
  • BernoullliNB implementation from scratch
  • The data train.csv and test.csv should be in the same folder as the bernoulliNB.py

To run the code:

$ python3 bernoulliNB.py

The output is a csv file containing the prediction for the test set.

Text-classification, with libraries

Comparison of different models:

$ python3 with_libraries.py

info.csv is the output containing the accuracy score of BernoulliNB, MultinomialNB, SVM and GuassianNB models implemented for comparison.