Git Product home page Git Product logo

syntaxnet-api's Introduction

A Dockerfile that helps you get Syntaxnet DRAGNN working, with a json api powered by falcon.

Here's how you get everything running:

  1. Download the pretrained model files

    Download this file from Google Drive: https://drive.google.com/uc?id=0BxpbZGYVZsEeSFdrUnBNMUp1YzQ&export=download

    Unzip it into a directory where you want your model stored.

  2. Start the server

    Save this to a file called rebuild-and-run.sh, changing things to fit your environment (see below):

    #!/bin/bash
    docker build --rm -t syntaxnet-api -f Dockerfile .
    
    # :ro at the end of -v makes volume read-only
    docker run --rm -p 8000:80 -v ~/Projects/conll17-dragnn/:/usr/local/tfmodels:ro -e LANGUAGE="Swedish" syntaxnet-api
    • syntaxnet-api is the name of the container
    • 8000 is the port where the API will be exposed
    • ~/Projects/conll17-dragnn/ is the directory where you unziped the model files
    • /usr/local/tfmodels is the directory inside the container (don't change this)
    • -e LANGUAGE="Swedish" is the name of the directory where the files for your language resides

    Make it runnable: chmod +x rebuild-and-run.sh

    Now run it: ./rebuild-and-run.sh

    This will start a falcon server that runs on port 8000.

  3. Use the API

    The API can be used from any program that can send HTTP requests and parse JSON. Here's how you would send data to it using plain curl from the command line:

    curl -i -XPOST --data-urlencode "data=Detta är en mening." http://localhost:8000 && echo ""

syntaxnet-api's People

Contributors

emilstenstrom avatar

Watchers

 avatar  avatar  avatar

Forkers

lazuraslong

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.