Skip to content

Commit

Permalink
pyss3.server quiet mode added; live_test improved (documents without …
Browse files Browse the repository at this point in the history
…categories option + loading animation); ReadTheDocs - files added; README.md
  • Loading branch information
sergioburdisso committed Nov 13, 2019
1 parent e9b02b4 commit 00bd71f
Show file tree
Hide file tree
Showing 20 changed files with 520 additions and 35 deletions.
9 changes: 5 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,18 @@ If you want to contribute to our codebase, please send an email to sergio.burdis

3. Inside the top level project directory, install the project for development purpose:

```console
pip install -e .
```

4. Make a new branch for development

5. Hook your Travis CI to your development branch to enable continuous testing
5. Hook your [Travis CI](https://travis-ci.org/) to your development branch to enable continuous testing

6. Write code in the development branch

7. Write unit tests in tests/ and run pytest to test your code locally
7. Write unit tests in `tests/` and run pytest to test your code locally

8. Write documentation in docs/
8. Write documentation in `docs/`

9. Make a Pull Request [here](https://github.com/sergioburdisso/pyss3/pulls)

23 changes: 16 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

---

# A python package implementing a novel text classifier with visualization tools for Explainable AI.
# A python package implementing a novel text classifier with visualization tools for Explainable AI

The SS3 text classifier is a novel supervised machine learning model for text classification. SS3 was originally introduced in Section 3 of the paper _["A text classification framework for simple and effective early depression detection over social media streams"](https://dx.doi.org/10.1016/j.eswa.2019.05.023)_ (preprint available [here](https://arxiv.org/abs/1905.08772)).

Expand All @@ -16,12 +16,14 @@ The SS3 text classifier is a novel supervised machine learning model for text cl
* It has the **ability to visually explain its rationale**.
* Introduces a **domain-independent** classification model that **does not require feature engineering**.
* Naturally supports **incremental (online) learning** and **incremental classification**.
* Well suited to work over **text streams**.
* Well suited for classification over **text streams**.


## What is PySS3?

PySS3 is a Python package that allows you to work with SS3 in a very straightforward, interactive and visual way. In addition to the implementations of the SS3 classifier, PySS3 comes with a set of tools to help you to develop your machine learning models in a clearer and faster way. These tools let you analyze, monitor and understand your models by allowing you see what they have actually learned and why. To achieve this, PySS3 provides you with 3 main components: the ``SS3`` class, the ``Server`` class and the ``PySS3 Command Line`` tool, as pointed out below.


### The `SS3` class

which implements the classifier using a clear API (very similar to that of `sklearn`):
Expand Down Expand Up @@ -49,6 +51,8 @@ As shown in the image below, this will open up, locally, an interactive tool in

![img](https://raw.githubusercontent.com/sergioburdisso/pyss3/master/docs/_static/ss3_live_test.gif)

For example, we have uploaded two of these live tests online for you to try out: ["Movie Review Classification"](http://tworld.io/ss3/live_test_online/#30305) and ["Topic Categorization"](http://tworld.io/ss3/live_test_online/#30303), both were obtained following the [tutorials](https://pyss3.readthedocs.io#tutorials).

### And last but not least, the ``PySS3 Command Line``

This is probably the most useful component of PySS3. When you install the package (for instance by using `pip install pyss3`) a new command ``pyss3`` is automatically added to your environment's command line. This command allows you to access to the _PySS3 Command Line_, an interactive command-line query tool. This tool will let you interact with your SS3 models through special commands while assisting you during the whole machine learning pipeline (model selection, training, testing, etc.). Probably one of its most important features is the ability to automatically (and permanently) record the history of every evaluation result of any type (tests, k-fold cross-validations, grid searches, etc.) that you've performed. This will allow you (with a single command) to interactively visualize and analyze your classifier performance in terms of its different hyper-parameters values (and select the best model according to your needs). For instance, let's perform a grid search with a 4-fold cross-validation on the three hyper-parameters, smoothness(`s`), significance(`l`), and sanction(`p`) as follows:
Expand All @@ -64,19 +68,22 @@ In this illustrative example, `s` will take 6 different values between .2 and .8
```
![img](https://raw.githubusercontent.com/sergioburdisso/pyss3/master/docs/_static/plot_evaluations.gif)

Each dot represents an experiment/evaluation performed using that particular combination of values (s, l, and p). Also, dots are painted proportional to how good the performance was using that configuration of the model. Researchers can interactively change the evaluation metrics to be used (accuracy, precision, recall, f1, etc.) and plots will update "on the fly". Additionally, when the cursor is moved over a data point, useful information is shown (including a "compact" representation of the confusion matrix obtained in that experiment). Finally, it is worth mentioning that, before showing the 3D plots, PySS3 creates and save a single and portable HTML file in your project folder containing the interactive plots. This allows researchers to store, send or upload the plots to another place using this single HTML file (or even provide a link to this file in their own papers, which would be nicer for readers, plus it would increase experimentation transparency). For example, we have uploaded two of these files for you to see: ["Movie Review Classification"](http://tworld.io/ss3/ss3_model_evaluation[movie_review_3grams].html) and ["Topic Categorization"](http://tworld.io/ss3/ss3_model_evaluation[topics_3grams].html), both evaluation plots were obtained following the tutorials given below.
Each dot represents an experiment/evaluation performed using that particular combination of values (s, l, and p). Also, dots are painted proportional to how good the performance was using that configuration of the model. Researchers can interactively change the evaluation metrics to be used (accuracy, precision, recall, f1, etc.) and plots will update "on the fly". Additionally, when the cursor is moved over a data point, useful information is shown (including a "compact" representation of the confusion matrix obtained in that experiment). Finally, it is worth mentioning that, before showing the 3D plots, PySS3 creates and save a single and portable HTML file in your project folder containing the interactive plots. This allows researchers to store, send or upload the plots to another place using this single HTML file (or even provide a link to this file in their own papers, which would be nicer for readers, plus it would increase experimentation transparency). For example, we have uploaded two of these files for you to see: ["Movie Review Classification"](http://tworld.io/ss3/ss3_model_evaluation[movie_review_3grams].html) and ["Topic Categorization"](http://tworld.io/ss3/ss3_model_evaluation[topics_3grams].html), both evaluation plots were also obtained following the [tutorials](https://pyss3.readthedocs.io#tutorials).


## The PySS3 Workflow

### The somewhat standard way

### Classical

(TODO: tutorial WIP)

### The "Command-Line" way

### The "PySS3 Command-Line" way

(TODO: tutorial WIP)


## Installation


Expand All @@ -97,10 +104,12 @@ pip install -r requirements.txt
pip install .
```

## API Documentation
## Further Readings


[PySS3's documentation](https://pyss3.readthedocs.io)

Full API documentation can be found [here](https://pyss3.readthedocs.io)
[PySS3's API documentation](https://pyss3.readthedocs.io/api/)


[license-badge]: https://img.shields.io/github/license/boyney123/performance-budgets.svg
Expand Down
67 changes: 67 additions & 0 deletions docs/about/contributing.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
.. _contributing:


*************
Contributions
*************

PySS3 is open for contributions. New features, documentations, tests or
bug reports are welcome. Following is the guide to contribute to PySS3:


Bug Report
==========

If you have determined that your code doesn’t work and it comes from
PySS3, please follow the following step to report a bug.

1. Make sure your code is up-to-date with our current code on the master
branch.

2. Make sure to check the `issue section`_ before filing an issue on our
github project. The bug might already be reported.

3. Create an issue in `issue section`_. Give detailed description of
your system configuration: What OS you are using? What is the python
version? What is the PySS3 version? In addition, make sure to include
a complete example which we can use to trigger the bug.

4. If you know how to fix the bug, please make a request to contribute!


Pull Request
============

If you want to contribute to our codebase, please send an email to
sergio.burdisso@gmail.com to with subject "PYSS3 DEVELOPMENT" to discuss
your plan which should include the description of the contribution (bug
fix, interface improvement, new feature, new test or documentation) and
potential interface (for code contribution). Once we reach the agreement
on how to proceed, you can

1. Fork `PySS3 on github`_

2. Clone your fork to local machine

3. Inside the top level project directory, install the project for development purpose

.. code:: bash
pip install -e .
4. Make a new branch for development

5. Hook your Travis CI to your development branch to enable continuous
testing

6. Write code in the development branch

7. Write unit tests in :code:`tests/` and run pytest to test your code locally

8. Write documentation in :code:`tests/`

9. Make a Pull Request `here`_

.. _issue section: https://github.com/sergioburdisso/pyss3/issues
.. _PySS3 on github: https://github.com/sergioburdisso/pyss3/
.. _here: https://github.com/sergioburdisso/pyss3/pulls
30 changes: 30 additions & 0 deletions docs/about/license.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
.. _license:

********
License
********

PySS3 is released under the terms of the MIT License

The MIT License (MIT)

Copyright (c) 2019 Sergio Burdisso

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

2 changes: 1 addition & 1 deletion docs/pyss3.rst → docs/api/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ pyss3.server module
:show-inheritance:

pyss3.cmd_line module
----------------
---------------------

.. automodule:: pyss3.cmd_line
:members:
Expand Down
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
extensions = ['sphinx.ext.autodoc',
'sphinx.ext.autosummary',
'sphinx_rtd_theme',
'recommonmark']
'sphinx.ext.mathjax']

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
Expand Down
56 changes: 56 additions & 0 deletions docs/home/changelog.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
.. _changelog:

*************
Change Log
*************

All notable changes to PySS3 will be documented here.

[0.3.5] 2019-11-12
==================

Added
-----
- PySS3 Command Line Python 2 full compatibility support

Fixed
-----
- Matplotlib set_yaxis bug fixed


[0.3.4] 2019-11-12
==================

Fixed
-----
- Dependencies and compatibility with python 2 Improved


[0.3.3] 2019-11-12
==================

Fixed
-----
- Setup and tests fixed


[0.3.2] 2019-11-12
==================

Added
-----
- Summary operators: now it is possible to use user-defined summary operators, the following static methods were added to the ``SS3`` class: `summary_op_ngrams`, `summary_op_sentences`, and `summary_op_paragraphs`.


[0.3.1] 2019-11-11
==================

Added
-----
- update: some docstrings were improved
- update: the README.md / Pypi Description file.

Fixed
-----
- Python 2 and 3 compatibility problem with scikit-learn (using version 0.20.1 from now on)
- PyPi: setup.py: `long_description_content_type` set to `'text/markdown'`
24 changes: 24 additions & 0 deletions docs/home/installation.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
.. _installation:

************
Installation
************

PyPi installation
=================

Simply type::

pip install pyss3



Installation from source
========================

To install latest version from github, clone the source from the project repository and install with setup.py::

git clone https://github.com/sergioburdisso/pyss3
cd pyss3
pip install -r requirements.txt
pip install .
56 changes: 56 additions & 0 deletions docs/home/short-description.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
.. _short-description:

*********
Overview
*********

.. _ss3-classifier:

The SS3 Classifier
==================

[Work in Progress]



PySS3's Features
==================

[Work in Progress]


Documentation Overview
=======================

Home
-----

* :ref:`short-description` gives an overview of *PySS3*

* :ref:`installation` gives instruction on how to install *PySS3* through pip or source.

* :ref:`changelog` documents major changes between versions.

User Guide
-----------

* :ref:`quickstart` gives a brief introduction on how to use *PySS3* interface.

* :ref:`workflow` [Work in Progress].

* :ref:`customization` details how to customize *PySS3*.


Tutorials
----------

* :ref:`topic-categorization` [Work in Progress].

* :ref:`movie-reviews` [Work in Progress].

About
-------

* :ref:`contributing` gives instructions on how to contribute to *PySS3*.

* :ref:`license` details license statement.

0 comments on commit 00bd71f

Please sign in to comment.