Skip to content

Commit

Permalink
Merge branch 'master' into remove-bert
Browse files Browse the repository at this point in the history
  • Loading branch information
akelad committed Apr 22, 2020
2 parents 599a7ee + cd30622 commit 8e2cfe8
Show file tree
Hide file tree
Showing 33 changed files with 1,006 additions and 531 deletions.
13 changes: 13 additions & 0 deletions CHANGELOG.rst
Expand Up @@ -17,6 +17,19 @@ This project adheres to `Semantic Versioning`_ starting with version 1.0.

.. towncrier release notes start
[1.9.6] - 2020-04-15
^^^^^^^^^^^^^^^^^^^^

Bugfixes
--------
- `#5426 <https://github.com/rasahq/rasa/issues/5426>`_: Fix `rasa test nlu` plotting when using multiple runs.
- `#5489 <https://github.com/rasahq/rasa/issues/5489>`_: Fixed issue where ``max_number_of_predictions`` was not considered when running end-to-end testing.

Miscellaneous internal changes
------------------------------
- #5626


[1.9.5] - 2020-04-01
^^^^^^^^^^^^^^^^^^^^

Expand Down
2 changes: 1 addition & 1 deletion Makefile
Expand Up @@ -40,7 +40,7 @@ clean:
rm -rf docs/_build

install:
poetry run python -m pip install -U 'pip<20'
poetry run python -m pip install -U pip
poetry install

install-mitie:
Expand Down
64 changes: 58 additions & 6 deletions README.md
Expand Up @@ -95,33 +95,64 @@ also be asked to sign a

## Development Internals

### Building from source
### Installing Poetry

Rasa uses Poetry for packaging and dependency management. If you want to build it from source,
you have to install Poetry first. This is how it can be done:

```
curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python3
```bash
curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python
```

There are several other ways to install Poetry. Please, follow
[the official guide](https://python-poetry.org/docs/#installation) to see all possible options.

To install dependencies and `rasa` itself in editable mode execute
### Managing environments

The official [Poetry guide](https://python-poetry.org/docs/managing-environments/) suggests to use
[pyenv](https://github.com/pyenv/pyenv) or any other similar tool to easily switch between Python versions.
This is how it can be done:

```bash
pyenv install 3.7.6
pyenv local 3.7.6 # Activate Python 3.7.6 for the current project
```

By default, Poetry will try to use the currently activated Python version to create the virtual environment
for the current project automatically. You can also create and activate a virtual environment manually — in this
case, Poetry should pick it up and use it to install the dependencies. For example:

```bash
python -m venv .venv
source .venv/bin/activate
```

You can make sure that the environment is picked up by executing

```bash
poetry env info
```

### Building from source

To install dependencies and `rasa` itself in editable mode execute

```bash
make install
```

### Running and changing the documentation

First of all, install all the required dependencies:
```

```bash
make install
```

After the installation has finished, you can run and view the documentation
locally using:
```

```bash
make livedocs
```

Expand All @@ -130,25 +161,46 @@ You can now change the docs locally and the web page will automatically reload
and apply your changes.

### Running the Tests

In order to run the tests, make sure that you have the development requirements installed:

```bash
export PIP_USE_PEP517=false
make prepare-tests-ubuntu # Only on Ubuntu and Debian based systems
make prepare-tests-macos # Only on macOS
```

Then, run the tests:

```bash
make test
```

They can also be run at multiple jobs to save some time:

```bash
JOBS=[n] make test
```

Where `[n]` is the number of jobs desired. If omitted, `[n]` will be automatically chosen by pytest.

### Resolving merge conflicts

Poetry doesn't include any solution that can help to resolve merge conflicts in
the lock file `poetry.lock` by default.
However, there is a great tool called [poetry-merge-lock](https://poetry-merge-lock.readthedocs.io/en/latest/).
Here is how use can install it:

```bash
pip install poetry-merge-lock
```

Just execute this command to resolve merge conflicts in `poetry.lock` automatically:

```bash
poetry-merge-lock
```

### Steps to release a new version
Releasing a new version is quite simple, as the packages are build and distributed by GitHub Actions.

Expand Down
1 change: 1 addition & 0 deletions changelog/5631.misc.rst
@@ -0,0 +1 @@
Set regularization constant in ``EmbeddingIntentClassifier`` to 0.001.
2 changes: 2 additions & 0 deletions changelog/5633.misc.rst
@@ -0,0 +1,2 @@
Add more information about the usage of Poetry and the process of merge conflict resolution
in the lockfile of Poetry to `README.md`.
1 change: 1 addition & 0 deletions changelog/5635.improvement.rst
@@ -0,0 +1 @@
Update dependencies based on the ``dependabot`` check.
2 changes: 2 additions & 0 deletions changelog/5636.improvement.rst
@@ -0,0 +1,2 @@
Add dropout between ``FFNN`` and ``DenseForSparse`` layers in ``DIETClassifier``,
``ResponseSelector`` and ``EmbeddingIntentClassifier`` controlled by ``use_dense_input_dropout`` config parameter.
13 changes: 13 additions & 0 deletions data/test_evaluations/end_to_end_trips_circuit_breaker.md
@@ -0,0 +1,13 @@
## story_trips_circuit_breaker
* greet: /greet
- utter_greet
- utter_greet
- utter_greet
- utter_greet
- utter_greet
- utter_greet
- utter_greet
- utter_greet
- utter_greet
- utter_greet
- utter_greet
13 changes: 13 additions & 0 deletions data/test_evaluations/stories_trip_circuit_breaker.md
@@ -0,0 +1,13 @@
## story_trips_circuit_breaker
* greet
- utter_greet
- utter_greet
- utter_greet
- utter_greet
- utter_greet
- utter_greet
- utter_greet
- utter_greet
- utter_greet
- utter_greet
- utter_greet
2 changes: 1 addition & 1 deletion docs/core/forms.rst
Expand Up @@ -286,7 +286,7 @@ In the restaurant case, your stories would look something like this:
( ... all other slots the form set ... )
- form{"name": null}
Again, is is **strongly** recommended that you use interactive
Again, it is **strongly** recommended that you use interactive
learning to build these stories.
Please read :ref:`section_interactive_learning_forms`
on how to use interactive learning with forms.
Expand Down
1 change: 1 addition & 0 deletions docs/index.rst
Expand Up @@ -29,6 +29,7 @@ Understand messages, hold conversations, and connect to messaging channels and A
user-guide/architecture
user-guide/messaging-and-voice-channels
user-guide/testing-your-assistant
user-guide/setting-up-ci-cd
user-guide/validate-files
user-guide/configuring-http-api
user-guide/how-to-deploy
Expand Down
12 changes: 9 additions & 3 deletions docs/nlu/components.rst
Expand Up @@ -922,7 +922,9 @@ EmbeddingIntentClassifier
| drop_rate | 0.2 | Dropout rate for encoder. Value should be between 0 and 1. |
| | | The higher the value the higher the regularization effect. |
+---------------------------------+------------------+--------------------------------------------------------------+
| use_sparse_input_dropout | True | If 'True' apply dropout to sparse tensors. |
| use_sparse_input_dropout | False | If 'True' apply dropout to sparse input tensors. |
+---------------------------------+------------------+--------------------------------------------------------------+
| use_dense_input_dropout | False | If 'True' apply dropout to dense input tensors. |
+---------------------------------+------------------+--------------------------------------------------------------+
| evaluate_every_number_of_epochs | 20 | How often to calculate validation accuracy. |
| | | Set to '-1' to evaluate just once at the end of training. |
Expand Down Expand Up @@ -1486,7 +1488,9 @@ ResponseSelector
| drop_rate_attention | 0.0 | Dropout rate for attention. Value should be between 0 and 1. |
| | | The higher the value the higher the regularization effect. |
+---------------------------------+-------------------+--------------------------------------------------------------+
| use_sparse_input_dropout | False | If 'True' apply dropout to sparse tensors. |
| use_sparse_input_dropout | False | If 'True' apply dropout to sparse input tensors. |
+---------------------------------+-------------------+--------------------------------------------------------------+
| use_dense_input_dropout | False | If 'True' apply dropout to dense input tensors. |
+---------------------------------+-------------------+--------------------------------------------------------------+
| evaluate_every_number_of_epochs | 20 | How often to calculate validation accuracy. |
| | | Set to '-1' to evaluate just once at the end of training. |
Expand Down Expand Up @@ -1715,7 +1719,9 @@ DIETClassifier
| drop_rate_attention | 0.0 | Dropout rate for attention. Value should be between 0 and 1. |
| | | The higher the value the higher the regularization effect. |
+---------------------------------+------------------+--------------------------------------------------------------+
| use_sparse_input_dropout | True | If 'True' apply dropout to sparse tensors. |
| use_sparse_input_dropout | True | If 'True' apply dropout to sparse input tensors. |
+---------------------------------+------------------+--------------------------------------------------------------+
| use_dense_input_dropout | True | If 'True' apply dropout to dense input tensors. |
+---------------------------------+------------------+--------------------------------------------------------------+
| evaluate_every_number_of_epochs | 20 | How often to calculate validation accuracy. |
| | | Set to '-1' to evaluate just once at the end of training. |
Expand Down
12 changes: 6 additions & 6 deletions docs/user-guide/building-assistants.rst
Expand Up @@ -155,9 +155,10 @@ For example:


While it's good to test the bot interactively, we should also add end to end test cases that
can later be included as part of our CI/CD system. `End to end stories <https://rasa.com/docs/rasa/user-guide/testing-your-assistant/#end-to-end-testing>`_
include NLU data, so that both components of Rasa can be tested. Create a file called
``test_stories.md`` in the root directory with some test cases:
can later be included as part of a :ref:`CI/CD system <setting-up-ci-cd>`. End-to-end :ref:`test conversations <end-to-end-testing>`
include NLU data, so that both components of Rasa can be tested. The file
``tests/conversation_tests.md`` contains example test conversations. Delete all the test conversations and replace
them with some test conversations for your assistant so far:

.. code-block:: md
Expand Down Expand Up @@ -185,7 +186,7 @@ To test our model against the test file, run the command:

.. code-block:: bash
rasa test --e2e --stories test_stories.md
rasa test --stories tests/conversation_tests.md
The test command will produce a directory named ``results``. It should contain a file
called ``failed_stories.md``, where any test cases that failed will be printed. It will
Expand Down Expand Up @@ -635,8 +636,7 @@ use the ``from_text`` method to extract the users whole message:

.. code-block:: python
def slot_mappings(self) -> Dict[Text: Union[Dict, List[Dict]]]:
# type: () -> Dict[Text: Union[Dict, List[Dict]]]
def slot_mappings(self) -> Dict[Text, Union[Dict, List[Dict[Text, Any]]]]:
"""A dictionary to map required slots to
- an extracted entity
- intent: value pairs
Expand Down
7 changes: 7 additions & 0 deletions docs/user-guide/command-line-interface.rst
Expand Up @@ -234,7 +234,14 @@ You can specify the training data, the fraction, and the output directory using


This command will attempt to keep the proportions of intents the same in train and test.
If you have NLG data for retrieval actions, this will be saved to seperate files:

.. code-block:: bash
ls train_test_split
nlg_test_data.md test_data.json
nlg_training_data.md training_data.json
Convert Data Between Markdown and JSON
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Expand Down
34 changes: 22 additions & 12 deletions docs/user-guide/connectors/twilio.rst
@@ -1,4 +1,4 @@
:desc: Build a Rasa Chat Bot on Twilio
:desc: Deploy a Rasa Open Source assistant through text message or WhatsApp via the Twilio connector

.. _twilio:

Expand All @@ -7,12 +7,17 @@ Twilio

.. edit-link::

You first have to create a Twilio app to get credentials.
Once you have them you can add these to your ``credentials.yml``.
You can use the Twilio connector to deploy an assistant that is available over text message.

.. contents::
:local:

Getting Credentials
^^^^^^^^^^^^^^^^^^^

You first have to create a Twilio app to get credentials.
Once you have them you can add these to your ``credentials.yml``.

**How to get the Twilio credentials:**
You need to set up a Twilio account.

Expand All @@ -25,24 +30,29 @@ You need to set up a Twilio account.
3. Now you can use the ``Account SID``, ``Auth Token``, and the phone
number you purchased in your ``credentials.yml``.

For more information, see the `Twilio REST API
<https://www.twilio.com/docs/iam/api>`_.
For more information, see the `Twilio REST API <https://www.twilio.com/docs/iam/api>`_.

Using run script
^^^^^^^^^^^^^^^^

If you want to connect to the Twilio input channel using the run
script, e.g. using:
Connecting to WhatsApp
----------------------

.. code-block:: bash
You can deploy a Rasa Open Source assistant to WhatsApp through Twilio. However, to do so, you have
to have a `WhatsApp Business <https://www.whatsapp.com/business/>`_ profile. Associate
your Whatsapp Business profile with the phone number you purchased through Twilio to
access the `Twilio API for WhatsApp <https://www.twilio.com/whatsapp>`_.

rasa run

you need to supply a ``credentials.yml`` with the following content:
Applying the Credentials
^^^^^^^^^^^^^^^^^^^^^^^^

Add the Twilio credentials to your ``credentials.yml``:

.. code-block:: yaml
twilio:
account_sid: "ACbc2dxxxxxxxxxxxx19d54bdcd6e41186"
auth_token: "e231c197493a7122d475b4xxxxxxxxxx"
twilio_number: "+440123456789"
Make sure to restart your Rasa Open Source server or container to make changes to
which connectors are available.

0 comments on commit 8e2cfe8

Please sign in to comment.