Skip to content

Commit

Permalink
Merge branch 'master' into rasa-run-model-server
Browse files Browse the repository at this point in the history
  • Loading branch information
tabergma committed Jul 12, 2019
2 parents 9e1db0b + e31bc10 commit 2eca11c
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 5 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.rst
Expand Up @@ -15,6 +15,8 @@ Added

Changed
-------
- recommended syntax for empty ``use_entities`` and ``ignore_entities`` in the domain file
has been updated from ``False`` or ``None`` to an empty list (``[]``)


Removed
Expand Down
1 change: 1 addition & 0 deletions data/test_domains/default_unfeaturized_entities.yml
Expand Up @@ -4,6 +4,7 @@ intents:
- goodbye: {use_entities: None}
- thank: {use_entities: False}
- ask: {use_entities: True}
- why: {use_entities: []}

entities:
- name
Expand Down
2 changes: 2 additions & 0 deletions data/test_stories/stories_unfeaturized_entities.md
Expand Up @@ -13,3 +13,5 @@
- utter_default
* ask{"name": "Peter", "unrelated_recognized_entity": "whatever", "other": "foo"}
- utter_default
* why{"name": "Peter", "unrelated_reognized_entity": "whatever", "other": "foo"}
- utter_default
4 changes: 2 additions & 2 deletions docs/core/domains.rst
Expand Up @@ -273,14 +273,14 @@ Ignoring entities for certain intents
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

If you want all entities to be ignored for certain intents, you can
add the ``use_entities: None`` parameter to the intent in your domain
add the ``use_entities: []`` parameter to the intent in your domain
file like this:

.. code-block:: yaml
intents:
- greet:
use_entities: None
use_entities: []
To ignore some entities or explicitly take only certain entities
into account you can use this syntax:
Expand Down
4 changes: 2 additions & 2 deletions examples/formbot/domain.yml
@@ -1,8 +1,8 @@
intents:
- request_restaurant:
use_entities: false
use_entities: []
- chitchat:
use_entities: false
use_entities: []
- inform
- affirm
- deny
Expand Down
4 changes: 3 additions & 1 deletion rasa/core/schemas/domain.yml
Expand Up @@ -6,7 +6,9 @@ mapping:
- type: "map"
mapping:
use_entities:
type: "bool"
type: "any"
ignore_entities:
type: "any"
allowempty: True
- type: "str"
entities:
Expand Down
2 changes: 2 additions & 0 deletions tests/core/test_domain.py
Expand Up @@ -128,6 +128,8 @@ async def test_create_train_data_unfeaturized_entities():

assert hashed == [
"[{}]",
'[{"intent_why": 1.0, "prev_utter_default": 1.0}]',
'[{"intent_why": 1.0, "prev_action_listen": 1.0}]',
'[{"intent_thank": 1.0, "prev_utter_default": 1.0}]',
'[{"intent_thank": 1.0, "prev_action_listen": 1.0}]',
'[{"intent_greet": 1.0, "prev_utter_greet": 1.0}]',
Expand Down

0 comments on commit 2eca11c

Please sign in to comment.