Giter Site home page Giter Site logo

tarsbase / mediacloud-wordembeddingsserver Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mediacloud/word-embeddings-server

0.0 1.0 0.0 49 KB

Helpful micro-service to return results from word2vec models

License: MIT License

Python 81.47% Shell 0.17% HTML 18.36%

mediacloud-wordembeddingsserver's Introduction

Media Cloud Word Embeddings Server

A micro-service to support analyzing words based on models of word embeddings (aka. "word2vec").

Dev Installation

  • python 2.7 https://www.python.org/download/releases/2.7/
  • pip install virtualenv (if necessary) [also install/link pip if you don't have it (if on Mac OS, use sudo easy_install pip)]
  • virtualenv venv
  • activate your virtualenv (and not run any global python installations)
    • on OSX: source venv/bin/activate
    • on Windows: call venv\Scripts\activate
  • run pip install -r requirements.txt to install dependencies
  • run python download-google-news-model.py to download the google news model file

Developing

We develop with PyCharm.

Copy the config/app.config.template to config/app.config and fill in the values.

Running

Two options:

  1. Development: run python run.py to test it out
  2. Production-like: run ./run.sh to run it with gunicorn

You can then hit the local homepage to try it out from a simple web-testing harness: http://localhost:8000

Or you can test that with something like this (the first request takes a while to load the giant model into memory):

import requests
response = requests.post("http://localhost:8000/api/v2/google-news2d.json",
                         data = {'words[]':['apples', 'bananas', 'three']})
print response.json()

Deploying

This is configured to deploy as a Heroku buildpack to dokku.

You'll need to do something like this to set the required environment variables:

dokku config:set word-embeddings SECRET_KEY=oiwajj243josadjoi SENTRY_DSN=https://THING1:[email protected]/THING3 MEDIA_CLOUD_API_KEY=MY_AWESOME_KEY

Releasing

  1. Update the semantic version number in server/__init.py__
  2. Tag the repository with that number, like v4.5.2
  3. Push it to the server, like git push dokku v4.5.2:master

mediacloud-wordembeddingsserver's People

Contributors

rahulbot avatar colcarroll 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.