Coder Social home page Coder Social logo

opus-api's Introduction

OPUS-API

How to deploy

Clone this git:

git clone https://github.com/miau1/OPUS-API.git

Create a virtual environment and install required packages:

python3 -m venv opusapienv
source opusapienv/bin/activate
pip3 install flask sqlalchemy
deactivate

Move opusdata.db database to /var/www/ and update permissions, so that user www-data can read it:

sudo mv OPUS-API/opusdata.db /var/www/
sudo chmod 774 /var/www/opusdata.db

Update your apache configuration file (located at /etc/apache2/sites-available/000-default.conf by default, remember to update server name and paths):

## /etc/apache2/sites-available/000-default.conf

<VirtualHost *:80>
  ServerName vm0024.kaj.pouta.csc.fi
  WSGIDaemonProcess opusapi python-path=/home/cloud-user/OPUS-API python-home=/home/cloud-user/opusapienv
  WSGIScriptalias / /home/cloud-user/OPUS-API/opusapi.wsgi

  <Directory /home/cloud-user/OPUS-API/>
    WSGIProcessGroup opusapi
    WSGIApplicationGroup %{GLOBAL}
    WSGIScriptReloading On

    Require all granted
  </Directory>

  ErrorLog ${APACHE_LOG_DIR}/error.log
  CustomLog ${APACHE_LOG_DIR}/access.log combined

</VirtualHost>

# vim: syntax=apache ts=4 sw=4 sts=4 sr noet

If you don't have mod_wsgi installed:

sudo apt-get install libapache2-mod-wsgi-py3

Restart apache2 server:

sudo systemctl restart apache2

And now you are able use the API, for example:

http://vm0024.kaj.pouta.csc.fi/opusapi/?corpus=OpenSubtitles&source=en&target=fi&preprocessing=xml&version=latest

opus-api's People

Contributors

miau1 avatar

Watchers

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