classify hotel reviews as either True or Fake, and either Positive or Negative
This code implements Naive Bayes and Perceptron classifier to identify hotel reviews as either True or Fake, and either Positive or Negative. The classifiers have been implemented by using the word tokens as features for classification.
You need to install:
training data:
reviews should be present in following format in one file:
<review_id> <class1> <class2> <review text>
Where class1 = Fake
or True
and class2 = Pos
or Neg
prediction data:
reviews should be present in following format in one file:
<review_id> <review text>
To start using the hotel-review-classifier you need to clone the repo:
git clone https://github.com/dweeptrivedi/hotel-review-classifier.git
Naive Bayes classifier:
Training:
python3 nblearn3.py --data <train.txt>
Prediction:
python3 nbclassify3.py --data <test.txt>
output:
nboutput.txt
Perceptron classifier:
Training:
python3 perceplearn3.py --data <train.txt>
Prediction:
python3 percepclassify3.py --model <model.txt> --data <test.txt>
output:
percepoutput.txt
-
Dweep Trivedi - Please give me your feedback: [email protected]
Feel free to contribute