Coder Social home page Coder Social logo

autocomplete's Introduction

Review Auto Completion

The complete documentation of our code is at the wiki page: https://github.com/liuxinglian/autocomplete/wiki.

Introduction

Inspired by Smart Compose, a new feature recently launched by Google for its email service that provides automatic sentence completion using machine learning and artificial intelligence techniques, we aim to build a system that could do auto sentence completion on yelp user reviews.

Dataset

  • The dataset we use is the Yelp Open Dataset. The Yelp Open Dataset consists of a few JSON data files (business.json, review.json, user.json, etc). We only use one of the JSON data files in the dataset, namely review.json.

  • In review.json, there is one JSON object per line. One sample json object in review.json is provided as follows.

{
    // string, 22 character unique review id
    "review_id": "zdSx_SD6obEhz9VrW9uAWA",

    // string, 22 character unique user id, maps to the user in user.json
    "user_id": "Ha3iJu77CxlrFm-vQRs_8g",

    // string, 22 character business id, maps to business in business.json
    "business_id": "tnhfDv5Il8EaGSXZGiuQGg",

    // integer, star rating
    "stars": 4,

    // string, date formatted YYYY-MM-DD
    "date": "2016-03-09",

    // string, the review itself
    "text": "Great place to hang out after work: the prices are decent, and the ambience is fun. It's a bit loud, but very lively. The staff is friendly, and the food is good. They have a good selection of drinks.",

    // integer, number of useful votes received
    "useful": 0,

    // integer, number of funny votes received
    "funny": 0,

    // integer, number of cool votes received
    "cool": 0
}
  • The small_dataset_1200.json consists of randomly selected 1200 reviews from Yelp dataset, mainly used for hyperparameter tuning. The large_dataset_12000.json consists of randomly selected 12000 reviews from Yelp dataset, which is used for training our model with 10000 reviews and test on 2000 reviews to get the performance of our models.

Requirements

  • python (3.5.x, 3.6.x)

    • tensorflow==1.12.0

    • gensim==3.6.0

    • nltk==3.4

    • pygtrie==2.3

Usage

  • Usage of the models that we built is as follows:

    • Model 1

      python model1/model1.py

      To change the hyperparameter of model 1, please change the variables in model1/model1_config.py

    • Model 2

      python model2/model2.py

      To change the hyperparameter of model 2, please change the variables in model2/model2_config.py

    • Model 3

      python model3/model3.py

      To change the hyperparameter of model 3, please see the documentation at https://github.com/liuxinglian/autocomplete/wiki/model3.py

autocomplete's People

Contributors

yuzhoumao avatar liuxinglian avatar sparkroy avatar haiyangh 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.