Skip to content

Commit

Permalink
Merge 92cee3b into f670556
Browse files Browse the repository at this point in the history
  • Loading branch information
msamogh committed Jul 10, 2019
2 parents f670556 + 92cee3b commit 2729041
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 4 deletions.
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
2 changes: 2 additions & 0 deletions rasa/core/schemas/domain.yml
Expand Up @@ -7,6 +7,8 @@ mapping:
mapping:
use_entities:
type: "bool"
ignore_entities:
type: "bool"
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 2729041

Please sign in to comment.