Giter VIP home page Giter VIP logo

hotel-review-classifier's Introduction

hotel-review-classifier

classify hotel reviews as either True or Fake, and either Positive or Negative

Table of contents

Explanation

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.

Prerequisites

You need to install:

Input File Format

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>

Quick-start

To start using the hotel-review-classifier you need to clone the repo:

git clone https://github.com/dweeptrivedi/hotel-review-classifier.git

Running the code

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

Authors:

  • Dweep Trivedi - Please give me your feedback: [email protected]

    Feel free to contribute

hotel-review-classifier's People

Contributors

dweeptrivedi avatar

Watchers

 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.