Skip to content
This repository has been archived by the owner on Aug 22, 2019. It is now read-only.

Commit

Permalink
Merge pull request #1634 from RasaHQ/fix-domain-persistence
Browse files Browse the repository at this point in the history
properly instantiate domain properties
  • Loading branch information
tmbo committed Jan 25, 2019
2 parents cba58c6 + 887fde4 commit 029c8ff
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 15 deletions.
9 changes: 5 additions & 4 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,24 @@ This project adheres to `Semantic Versioning`_ starting with version 0.2.0.

.. _master-release:

[Unreleased 0.13.1.aX] - `master`_
[Unreleased 0.14.0.aX] - `master`_
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

.. note:: This version is not yet released and is under active development.

Added
-----
- ``message_id`` can now be passed in the payload to the ``NLUHttpInterpreter``

Removed
Changed
-------

Changed
Removed
-------
- ``message_id`` can now be passed in the payload to the ``NLUHttpInterpreter``

Fixed
-----
- fixed domain persistence after exiting interactive learning
- fix form validation question error in interactive learninig

.. _v0-13-0:
Expand Down
25 changes: 14 additions & 11 deletions rasa_core/training/interactive.py
Original file line number Diff line number Diff line change
Expand Up @@ -779,18 +779,21 @@ def _write_domain_to_file(
messages = _collect_messages(evts)
actions = _collect_actions(evts)

domain_dict = dict.fromkeys(domain.keys(), [])

# TODO for now there is no way to distinguish between action and form
domain_dict["forms"] = []
domain_dict["intents"] = _intents_from_messages(messages)
domain_dict["entities"] = _entities_from_messages(messages)
# do not automatically add default actions to the domain dict
domain_dict["actions"] = list({e["name"]
for e in actions
if e["name"] not in default_action_names()})

new_domain = Domain.from_dict(domain_dict)
intent_properties = Domain.collect_intent_properties(
_intents_from_messages(messages))

collected_actions = list({e["name"]
for e in actions
if e["name"] not in default_action_names()})

new_domain = Domain(
intent_properties=intent_properties,
entities=_entities_from_messages(messages),
slots=[],
templates={},
action_names=collected_actions,
form_names=[])

old_domain.merge(new_domain).persist_clean(domain_path)

Expand Down

0 comments on commit 029c8ff

Please sign in to comment.