Coder Social home page Coder Social logo

bppcode's Introduction

BPPCode

This repository contains the code used to generate letters in Philippe Grand'Maison's master's thesis. Not all parts of the packages are intended to be portable.

Subprojects

GenText

The Natural Language Generation library.

BPPGen

  • Configuration of GenText for recruitment letters.
  • Small Flask server, containing a Web Interface and a small web API.
  • API access to BPP data.

BPPGenBuild

This project contains the code that built the resources for BPPGen. This project is much more flaky: it depends on such things as a comptatible MongoDB. All resources generated by BPPGenBuild can be found in the appropriate language's letter_data folder.

HOWTO

Requirements

  • A Linux system.
  • Python 2.7.11
  • The python-dev package (apt-get install python-dev)
  • pip

Install dependencies

To install in user mode, use pip --user install. To install in global mode, use sudo pip install.

For GenText

You need nodejs and python-dev. On Debian, that's:

apt-get install python-dev nodejs

Then you can get the python dependencies.

pip install nltk mock==1.0.1

For BPPGen

You need python-lxml. On Debian, that's:

apt-get install python-lxml

Then you can get the python dependencies.

pip install sklearn six certifi flask pymongo langid bs4 lxml urllib3

You might experience problems with Flask on some installations. The package had incorrect dependency management in older versions. Simply do the following:

pip install werkzeug click itsdangerous jinja2

Test installation

From within this project's root directory.

For GenText

PYTHONPATH=gentext python -m unittest discover -s gentext/tests/ -p "test_*.py"

For BPPGen

PYTHONPATH=gentext:bppgen python -m unittest discover -s bppgen/tests/ -p "test_*.py"

Test Server

cd bppgen
./runserver.sh

And follow the link. It should work out of the box.

Make the application public

The application is configured to run locally. You may want to make it available to the Web.

  • One option is to use Flask's ability to act as a stand-alone server. You simply have to modify .runserver.sh and add the keyword prod after "application.py". This option requires apache2 to be stopped. This NOT recommended, but really easy.

  • The recommended option is to configure apache2 properly. To configure apache2 to serve a Flask application, follow the instructions at http://flask.pocoo.org/docs/0.12/deploying/mod_wsgi/. Pay special attention to WSGIDaemonProcess/WSGIProcessGroup to avoid problems with the Global Interpreter Lock.

Warning

The French version does not work. It would require linguistic resources to properly assign gender. Lexicon generation would have to be more complex.

bppcode's People

Contributors

bighouse avatar rali-udem avatar

Watchers

James Cloos avatar  avatar  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.