All Projects → kevalmorabia97 → Naive-Bayes-Text-Classifier-in-Java

kevalmorabia97 / Naive-Bayes-Text-Classifier-in-Java

Licence: MIT license
Naive Bayes Classification used to classify movie reviews as positive or negative

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Naive-Bayes-Text-Classifier-in-Java

Nepali-News-Classifier
Text Classification of Nepali Language Document. This Mini Project was done for the partial fulfillment of NLP Course : COMP 473.
Stars: ✭ 13 (-27.78%)
Mutual labels:  text-classification, naive-bayes-classifier
20-newsgroups text-classification
"20 newsgroups" dataset - Text Classification using Multinomial Naive Bayes in Python.
Stars: ✭ 41 (+127.78%)
Mutual labels:  text-classification, naive-bayes-classifier
ml-with-text
[Tutorial] Demystifying Natural Language Processing with Python
Stars: ✭ 18 (+0%)
Mutual labels:  text-classification
yunyi
2018“云移杯- 景区口碑评价分值预测
Stars: ✭ 29 (+61.11%)
Mutual labels:  text-classification
Pytorch-NLU
Pytorch-NLU,一个中文文本分类、序列标注工具包,支持中文长文本、短文本的多类、多标签分类任务,支持中文命名实体识别、词性标注、分词等序列标注任务。 Ptorch NLU, a Chinese text classification and sequence annotation toolkit, supports multi class and multi label classification tasks of Chinese long text and short text, and supports sequence annotation tasks such as Chinese named entity recognition, part of speech ta…
Stars: ✭ 151 (+738.89%)
Mutual labels:  text-classification
twitter mining
Twitter Mining in Java
Stars: ✭ 25 (+38.89%)
Mutual labels:  naive-bayes-classifier
Machine-Learning-Projects-2
No description or website provided.
Stars: ✭ 23 (+27.78%)
Mutual labels:  naive-bayes-classifier
Deep-NLP-Resources
Curated list of all NLP Resources
Stars: ✭ 65 (+261.11%)
Mutual labels:  text-classification
nsmc-zeppelin-notebook
Movie review dataset Word2Vec & sentiment classification Zeppelin notebook
Stars: ✭ 26 (+44.44%)
Mutual labels:  text-classification
nlp-lt
Natural Language Processing for Lithuanian language
Stars: ✭ 17 (-5.56%)
Mutual labels:  text-classification
NLP Toolkit
Library of state-of-the-art models (PyTorch) for NLP tasks
Stars: ✭ 92 (+411.11%)
Mutual labels:  text-classification
FNet-pytorch
Unofficial implementation of Google's FNet: Mixing Tokens with Fourier Transforms
Stars: ✭ 204 (+1033.33%)
Mutual labels:  text-classification
nlpbuddy
A text analysis application for performing common NLP tasks through a web dashboard interface and an API
Stars: ✭ 115 (+538.89%)
Mutual labels:  text-classification
Machine Learning From Scratch
Machine Learning models from scratch with a better visualisation
Stars: ✭ 15 (-16.67%)
Mutual labels:  naive-bayes-classifier
ML4K-AI-Extension
Use machine learning in AppInventor, with easy training using text, images, or numbers through the Machine Learning for Kids website.
Stars: ✭ 18 (+0%)
Mutual labels:  text-classification
naive-bayes-classifier
Implementing Naive Bayes Classification algorithm into PHP to classify given text as ham or spam. This application uses MySql as database.
Stars: ✭ 21 (+16.67%)
Mutual labels:  naive-bayes-classifier
COVID-19-Tweet-Classification-using-Roberta-and-Bert-Simple-Transformers
Rank 1 / 216
Stars: ✭ 24 (+33.33%)
Mutual labels:  text-classification
AAAI 2019 EXAM
Official implementation of "Explicit Interaction Model towards Text Classification"
Stars: ✭ 68 (+277.78%)
Mutual labels:  text-classification
feedIO
A Feed Aggregator that Knows What You Want to Read.
Stars: ✭ 26 (+44.44%)
Mutual labels:  text-classification
automatic-personality-prediction
[AAAI 2020] Modeling Personality with Attentive Networks and Contextual Embeddings
Stars: ✭ 43 (+138.89%)
Mutual labels:  text-classification

Naive Bayes Classifier in Java

Naive Bayes methods are a set of supervised learning algorithms based on applying Bayes’ theorem with the “naive” assumption of independence between every pair of features. Naive Bayes learners and classifiers can be extremely fast compared to more sophisticated methods. In spite of their apparently over-simplified assumptions, naive Bayes classifiers have worked quite well in many real-world situations, famously document classification and spam filtering.
Sentiment Analysis is the process of determining whether a piece of writing is positive, negative or neutral. It’s also known as opinion mining, deriving the opinion or attitude of a speaker. A common use case for this technology is to discover how people feel about a particular topic.
Your task is to classify whether a given review has a positive or negative tone using naive Bayes classifier.

Dataset used from - http://ai.stanford.edu/~amaas/data/sentiment/
Dataset has 12,500 positive and 12,500 negative reviews of movies for training and testing separately


Reference: Chapter6 - Machine Learning by Tom M. Mitchell Image


  • Steps to find the sentiment of any text:

The code I wrote only gives the sentiment as positive(1) or negative(0)
You cant know how much pos or neg

To get a sentiment, write each text on a line with first integer as the actual sentiment (for testing the accuracy but you can keep it anything if you want to predict) after that each word is of the form: <Index_in_vocab:freq> seperated by space

For example 10 0:2 1:1 3:1 4:1 Meaning the sentiment is 10 (positive) and contains
The 2 times
And 1 time
Of 1 time
To 1 time
(See Vocab.txt file) Put this content in test.data file Again, the value 10 is for test so if you know a sentiment you can verify that the classification should be 1 (pos)

To get the predicted value, you can add a print statement after line 80 in the code and comment out the code from line 81 to 95 which is just for finding the accuracy of prediction on test data

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].