GithubHelp home page GithubHelp logo

ubclaunchpad / sift-nlp Goto Github PK

View Code? Open in Web Editor NEW
3.0 9.0 0.0 2.45 MB

Natural language processing and analysis service of the Sift app

License: MIT License

Makefile 6.77% Shell 2.97% Python 90.26%

sift-nlp's Introduction

Sift NLP

Build Status ZenHub

Natural language processing service of the Sift app.

The other components to the Sift app are in these repositories: The following repositories contain Sift services:

Setup

Install pip and virtualenv

Ubuntu sudo apt-get install virtualenv

OS X brew install virtualenv

Initiate virtual environment, activate it, and code.

virtualenv -p python2.7 venv
source ./venv/bin/activate
make init

Alternatively all these instructions are automated (for *nix systems) in setup.sh. After installing virtualenv as instructed above, run in your root sift-nlp directory as such:

chmod +x setup.sh
./setup.sh

Set up Docker environment

See instructions in Sift Base for setting up a Docker environment to run Sift. If you can't use Docker for some reason, follow the instructions below for installing and running RabbitMQ and Redis manually.

Install RabbitMQ

Ubuntu

sudo apt-get update
sudo apt-get install rabbitmq-server

OS X

brew update
brew install rabbitmq

Add /usr/local/sbin to the path. That's where the RabbitMQ executables are.

export PATH=$PATH:/usr/local/sbin

Start a RabbitMQ server.

rabbitmq-server

Set up a user and vhost.

rabbitmqctl add_user sift sift
rabbitmqctl add_vhost sift
sudo rabbitmqctl set_permissions -p sift sift ".*" ".*" ".*"

Install Redis

Ubuntu

sudo apt-get update
sudo apt-get install redis

OS X

brew update
brew install redis

Start a Redis server.

redis-server

Testing

For test data, go to the Amazon product review dataset and download any of the datasets (I recommend only one as these are large files) to test your code against.

We will be using the pytest testing framework which should be installed when you run make init. If this does not work, run pip install pytest after activating venv.

All tests must be kept in the tests/ dir. To run your tests, type make test in the Makefile dir. See test_{nlp, parse}.py for examples of tests.

Running Without Docker

If you can't use Docker for some reason, you can manually run Sift services.

Sift NLP requires running Celery, Redis, and RabbitMQ. You can run each of these by running make run-celery, make run-rabbitmq, and make run-redis,

Jobs

Sift NLP is composed of jobs, which are simply functions registered with Celery so they can be run asynchronously and in parallel. You can find a simple example job in jobrunner/jobs/sample.py. Jobs accept 0 or more inputs of any JSON-serializable type, and return a JSON-serializable object.

sift-nlp's People

Contributors

jordanschalm avatar estroz avatar siunami avatar

Stargazers

Raman avatar  avatar  avatar

Watchers

James Cloos avatar Chris Li avatar  avatar Arnold Lam avatar Arabelle Hou avatar  avatar Andrew Bui avatar tristancalderbank avatar  avatar

sift-nlp's Issues

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.