<commit_before>Introduction
=============

*restsims* is a small pyramid restfull wrapper around simserver itself.

It provides a basic HTML interface to test and play around with the service.

_WARNING!_

restsims does not yet do authentication so you
do NOT want to USE it on a PUBLIC network

INSTALL
========

You may want to install the server in a clean and repeatable way using
virtual environment and buildout.

::

    $ mkdir simserver
    $ virtualenv --python=bin/python2.7 simserver/
    $ mkdir buildout-cache
    $ mkdir buildout-cache/eggs
    $ mkdir buildout-cache/downloads
    $ mkdir src # for  LAPACK, BLAS and restsims
    $ wget http://python-distribute.org/bootstrap.py

restsims comes with an example buildout.cfg file
in the tarball, or you find it on github.

copy buildout.cfg into the simserver directory

::

    $ bin/python bootstrap.py

you can try to easy_install numpy and scipy

::

    $ bin/easy_install numpy
    $ bin/easy_install scipy

but this never worked for me so i installed it from source
http://www.scipy.org/Download
as documented in
http://scipy.org/Installing_SciPy/BuildingGeneral
the buildout assumes that LAPACK and BLAS are installed in the src
directory


test if numpy and scipy are installed correctly:

::

    $ bin/python
    >>> import numpy
    >>> import scipy
    >>>

run buildout

::

$ bin/buildout

The buildout will take a while and install all the dependencies
for the server. Start the server with:

::

    $ bin/pserve src/restsims/development.ini

Now you can access the server at http://localhost:6543/


Configuration
==============

The configuration is done in two ini files one for developement
and another one for production

Things you might want to change:

at the beginning of the file:

::

    port = 6543

is the port restsims listens on.

At the end of the file

::

    [simserver]
    path=/tmp/simmserver/

is the location of the simserver index


API
====

Restsims is meant to be used as a service to be called from other
applications. It returns its results as html or JSON. The HTML view is
meant for experiments and to make yourself aquainted with the
calls and responses.



status
-------

To find out if your restsims server and simservice is running:

::

    Request = {'format': 'json', 'action': 'status'}
<commit_msg>refer to simserver documentation<commit_after>Introduction
=============

*restsims* is a small pyramid restfull wrapper around simserver itself.

It provides a basic HTML interface to test and play around with the service.

_WARNING!_

restsims does not yet do authentication so you
do NOT want to USE it on a PUBLIC network

INSTALL
========

You may want to install the server in a clean and repeatable way using
virtual environment and buildout.

::

    $ mkdir simserver
    $ virtualenv --python=bin/python2.7 simserver/
    $ mkdir buildout-cache
    $ mkdir buildout-cache/eggs
    $ mkdir buildout-cache/downloads
    $ mkdir src # for  LAPACK, BLAS and restsims
    $ wget http://python-distribute.org/bootstrap.py

restsims comes with an example buildout.cfg file
in the tarball, or you find it on github.
https://github.com/cleder/restsims/blob/master/buildout.cfg

copy buildout.cfg into the simserver directory

::

    $ bin/python bootstrap.py

you can try to easy_install numpy and scipy

::

    $ bin/easy_install numpy
    $ bin/easy_install scipy

but this never worked for me so i installed it from source
http://www.scipy.org/Download
as documented in
http://scipy.org/Installing_SciPy/BuildingGeneral
the buildout assumes that LAPACK and BLAS are installed in the src
directory


test if numpy and scipy are installed correctly:

::

    $ bin/python
    >>> import numpy
    >>> import scipy
    >>>

run buildout

::

$ bin/buildout

The buildout will take a while and install all the dependencies
for the server. Start the server with:

::

    $ bin/pserve src/restsims/development.ini

Now you can access the server at http://localhost:6543/


Configuration
==============

The configuration is done in two ini files one for developement
and another one for production

Things you might want to change:

at the beginning of the file:

::

    port = 6543

is the port restsims listens on.

At the end of the file

::

    [simserver]
    path=/tmp/simmserver/

is the location of the simserver index


API
====

Restsims is meant to be used as a service to be called from other
applications. It returns its results as html or JSON. The HTML view is
meant for experiments and to make yourself aquainted with the
calls and responses.

Please refer to http://radimrehurek.com/gensim/simserver.html for a more
in depth documentation for simserver itself.


status
-------

To find out if your restsims server and simservice is running:

::

    Request = {'format': 'json', 'action': 'status'}

{'fraction_non_alphanumeric': 0.07681189345447037, 'fraction_numerical': 0.0041296716911005575, 'mean_word_length': 3.5018587360594795, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 21, 'https://': 1, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2578227', 'n_tokens_mistral': 1463, 'n_tokens_neox': 1396, 'n_words': 623}