Skip to content

Commit

Permalink
Merge branch 'master' into external-triggers
Browse files Browse the repository at this point in the history
  • Loading branch information
wochinge committed Jul 29, 2019
2 parents a65d701 + bf0ed9f commit 678eb83
Show file tree
Hide file tree
Showing 36 changed files with 481 additions and 242 deletions.
28 changes: 23 additions & 5 deletions CHANGELOG.rst
Expand Up @@ -6,9 +6,30 @@ Rasa Change Log
All notable changes to this project will be documented in this file.
This project adheres to `Semantic Versioning`_ starting with version 1.0.

[Unreleased 1.1.8] - `master`_

[Unreleased 1.1.9] - `master`_
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Added
-----
- add root route to server started without ``--enable-api`` parameter
- add ``--evaluate-model-directory`` to ``rasa test core`` to evaluate models from ``rasa train core -c <config-1> <config-2>``

Changed
-------

Removed
-------

Fixed
-----
- ``rasa test core`` can handle compressed model files
- Rasa can handle story files containing multi line comments


[1.1.8] - 2019-07-25
^^^^^^^^^^^^^^^^^^^^

Added
-----
- ``TrainingFileImporter`` interface to support customizing the process of loading
Expand All @@ -23,10 +44,6 @@ Changed
or a policy ensemble
- Update pytype to ``2019.7.11``

Removed
-------


Fixed
-----
- interactive learning bug where reverted user utterances were dumped to training data
Expand All @@ -36,6 +53,7 @@ Fixed
- ``rasa train core`` in comparison mode stores the model files compressed (``tar.gz`` files)
- slot setting in interactive learning with the TwoStageFallbackPolicy


[1.1.7] - 2019-07-18
^^^^^^^^^^^^^^^^^^^^

Expand Down
36 changes: 36 additions & 0 deletions data/test_stories/stories_with_multiline_comments.md
@@ -0,0 +1,36 @@
<!-- a
fancy
multiline
comment -->
## happy path
* greet
- utter_greet
* mood_great
- utter_happy

## sad path 1
* greet <!-- inline comment -->
- utter_greet
* mood_unhappy
- utter_cheer_up
- utter_did_that_help
* affirm
- utter_happy

<!-- just one line comment-->
## sad path 2
* greet
- utter_greet
* mood_unhappy
- utter_cheer_up
- utter_did_that_help
* deny
- utter_goodbye

<!--
one more
-->

## say goodbye
* goodbye
- utter_goodbye
22 changes: 11 additions & 11 deletions docs/core/actions.rst
Expand Up @@ -6,16 +6,17 @@
Actions
=======

.. contents::

Actions are the things your bot runs in response to user input.
There are three kinds of actions in Rasa:

1. **Default actions**: e.g. ``action_listen``, ``action_restart``,
``action_default_fallback``
2. **Utterance actions**: start with ``utter_``, just send a message
1. **Utterance actions**: start with ``utter_``, just send a message
to the user
3. **Custom actions**: any other action, these actions can run arbitrary code
2. **Custom actions**: any other action, these actions can run arbitrary code
3. **Default actions**: e.g. ``action_listen``, ``action_restart``,
``action_default_fallback``

.. contents::
:local:

Utterance Actions
-----------------
Expand Down Expand Up @@ -66,7 +67,7 @@ other language and define your actions there - but we provide
a small python SDK to make development there even easier.

Custom Actions Written in Python
--------------------------------
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

For actions written in python, we have a convenient SDK which starts
this action server for you.
Expand Down Expand Up @@ -147,16 +148,15 @@ events in :ref:`Events <events>`.
Execute Actions in Other Code
-----------------------------

Rasa will send an HTTP ``POST`` request to the server defined as your ``action_endpoint`` containing
information on which action to run. In addition, this request will contain all
Rasa will send an HTTP ``POST`` request to your server containing
information on which action to run. Furthermore, this request will contain all
information about the conversation. :ref:`action-server` shows the detailed API spec.

As a response to the action call from Rasa, you can modify the tracker,
e.g. by setting slots and sending responses back to the user.
e.g. by setting slots and send responses back to the user.
All of the modifications are done using events.
There is a list of all possible event types in :ref:`events`.


Proactively Reaching Out to the User Using Actions
--------------------------------------------------

Expand Down
12 changes: 9 additions & 3 deletions docs/core/domains.rst
Expand Up @@ -11,6 +11,12 @@ It specifies the ``intents``, ``entities``, ``slots``, and ``actions``
your bot should know about. Optionally, it can also include ``templates``
for the things your bot can say.

.. contents::
:local:


An example of a Domain
----------------------

As an example, the ``DefaultDomain`` has the following yaml definition:

Expand Down Expand Up @@ -51,7 +57,7 @@ For example, an action could:
* just about anything!

Custom Actions and Slots
^^^^^^^^^^^^^^^^^^^^^^^^
------------------------

To reference slots in your domain, you need to reference them by
their **module path**. To reference custom actions, use their **name**.
Expand All @@ -76,7 +82,7 @@ see :ref:`custom-actions`).
.. _utter_templates:

Utterance templates
^^^^^^^^^^^^^^^^^^^
-------------------

Utterance templates are messages the bot will send back to the user. There are
two ways to use these templates:
Expand Down Expand Up @@ -270,7 +276,7 @@ multiple responses and Rasa will randomly pick one of them, e.g.:
- text: "Hey, {name}. How is your day going?"
Ignoring entities for certain intents
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-------------------------------------

If you want all entities to be ignored for certain intents, you can
add the ``use_entities: []`` parameter to the intent in your domain
Expand Down
2 changes: 2 additions & 0 deletions docs/core/interactive-learning.rst
Expand Up @@ -22,6 +22,8 @@ Some people call this `Software 2.0 <https://medium.com/@karpathy/software-2-0-a
Rasa X provides a UI for interactive learning, and you can use any user conversation
as a starting point. See `Annotate Conversations <https://rasa.com/docs/rasa-x/annotate-conversations/>`_ in the Rasa X docs.

.. contents::
:local:

Running Interactive Learning
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Expand Down
6 changes: 6 additions & 0 deletions docs/core/slots.rst
Expand Up @@ -7,6 +7,12 @@
Slots
=====

.. contents::
:local:

What are slots?
---------------

**Slots are your bot's memory.** They act as a key-value store
which can be used to store information the user provided (e.g their home city)
as well as information gathered about the outside world (e.g. the result of a
Expand Down
16 changes: 10 additions & 6 deletions docs/nlu/choosing-a-pipeline.rst
Expand Up @@ -10,6 +10,10 @@ Choosing a Pipeline
Choosing an NLU pipeline allows you to customize your model and finetune
it on your dataset.

.. contents::
:local:


The Short Answer
----------------

Expand Down Expand Up @@ -154,12 +158,12 @@ final context dictionary is used to persist the model's metadata.



Returned Entities Object
------------------------
In the object returned after parsing there are two fields that show information
about how the pipeline impacted the entities returned. The ``extractor`` field
of an entity tells you which entity extractor found this particular entity.
The ``processors`` field contains the name of components that altered this
The "entity" object explained
-----------------------------
After parsing, the entity is returned as a dictionary. There are two fields that show information
about how the pipeline impacted the entities returned: the ``extractor`` field
of an entity tells you which entity extractor found this particular entity, and
the ``processors`` field contains the name of components that altered this
specific entity.

The use of synonyms can also cause the ``value`` field not match the ``text``
Expand Down
3 changes: 3 additions & 0 deletions docs/nlu/language-support.rst
Expand Up @@ -14,6 +14,9 @@ pipeline in :ref:`choosing-a-pipeline`.
Other backends have some restrictions and support those languages
which have pre-trained word vectors available.

.. contents::
:local:


Training a model in any language using the ``supervised_embeddings`` pipeline
-----------------------------------------------------------------------------
Expand Down
6 changes: 3 additions & 3 deletions docs/nlu/training-data-format.rst
Expand Up @@ -6,12 +6,12 @@
Training Data Format
====================

Data Format
~~~~~~~~~~~

You can provide training data as Markdown or as JSON, as a single file or as a directory containing multiple files.
Note that Markdown is usually easier to work with.

.. contents::
:local:


Markdown Format
---------------
Expand Down
6 changes: 3 additions & 3 deletions docs/user-guide/evaluating-models.rst
Expand Up @@ -204,11 +204,11 @@ mode to evaluate the models you just trained:

.. code-block:: bash
$ rasa test core -m comparison_models/<model-1>.tar.gz comparison_models/<model-2>.tar.gz \
--stories stories_folder --out comparison_results
$ rasa test core -m comparison_models --stories stories_folder
--out comparison_results --evaluate-model-directory
This will evaluate each of the models on the training set and plot some graphs
to show you which policy performs best. By evaluating on the full set of stories, you
to show you which policy performs best. By evaluating on the full set of stories, you
can measure how well Rasa Core is predicting the held-out stories.

If you're not sure which policies to compare, we'd recommend trying out the
Expand Down
1 change: 0 additions & 1 deletion rasa/cli/arguments/data.py
Expand Up @@ -4,7 +4,6 @@
add_nlu_data_param,
add_out_param,
add_data_param,
add_stories_param,
add_domain_param,
)

Expand Down
19 changes: 14 additions & 5 deletions rasa/cli/arguments/test.py
@@ -1,7 +1,7 @@
import argparse
from typing import Union

from rasa.constants import DEFAULT_MODELS_PATH, DEFAULT_CONFIG_PATH
from rasa.constants import DEFAULT_MODELS_PATH, DEFAULT_RESULTS_PATH

from rasa.cli.arguments.default_arguments import (
add_stories_param,
Expand Down Expand Up @@ -42,7 +42,7 @@ def add_test_core_argument_group(
)
add_out_param(
parser,
default="results",
default=DEFAULT_RESULTS_PATH,
help_text="Output path for any files created during the evaluation.",
)
parser.add_argument(
Expand Down Expand Up @@ -70,6 +70,15 @@ def add_test_core_argument_group(
"trains on it. Fetches the data by sending a GET request "
"to the supplied URL.",
)
parser.add_argument(
"--evaluate-model-directory",
default=False,
action="store_true",
help="Should be set to evaluate models trained via "
"'rasa train core --config <config-1> <config-2>'. "
"All models in the provided directory are evaluated "
"and compared against each other.",
)


def add_test_nlu_argument_group(
Expand Down Expand Up @@ -150,7 +159,7 @@ def add_test_nlu_argument_group(
required=False,
nargs="+",
type=int,
default=[0, 25, 50, 75, 90],
default=[0, 25, 50, 75],
help="Percentages of training data to exclude during comparison.",
)

Expand All @@ -164,6 +173,6 @@ def add_test_core_model_param(parser: argparse.ArgumentParser):
default=[default_path],
help="Path to a pre-trained model. If it is a 'tar.gz' file that model file "
"will be used. If it is a directory, the latest model in that directory "
"will be used. If multiple 'tar.gz' files are provided, all those models "
"will be compared.",
"will be used (exception: '--evaluate-model-directory' flag is set). If multiple "
"'tar.gz' files are provided, all those models will be compared.",
)
2 changes: 1 addition & 1 deletion rasa/cli/arguments/train.py
Expand Up @@ -88,7 +88,7 @@ def add_compare_params(
"--percentages",
nargs="*",
type=int,
default=[0, 5, 25, 50, 70, 90, 95],
default=[0, 25, 50, 75],
help="Range of exclusion percentages.",
)
parser.add_argument(
Expand Down
1 change: 1 addition & 0 deletions rasa/cli/scaffold.py
Expand Up @@ -81,6 +81,7 @@ def print_run_or_instructions(args: argparse.Namespace, path: Text) -> None:
"jwt_secret",
"jwt_method",
"enable_api",
"remote_storage",
]
for a in attributes:
setattr(args, a, None)
Expand Down

0 comments on commit 678eb83

Please sign in to comment.