Repository: RasaHQ/rasa
Pull request: Change default paths if arguments are provided
fixes #2741

**Proposed changes**:
- Change default paths to the provided arguments

**Status (please check what you already did)**:
- [x] made PR ready for code review
- [ ] added some tests for the functionality
- [ ] updated the documentation
- [x] updated the changelog


Problem statement:
Pass default directory to interactive learning
**Rasa Core version**:
0.12.x
**Python version**: 
2.7.15
**Operating system** (windows, osx, ...):
Ubuntu
**Issue**:
When training interactively, the default output paths are taken only from the hard-coded PATHS variable in the interactive.py:
```

PATHS = {"stories": "data/stories.md",
         "nlu": "data/nlu.md",
         "backup": "data/nlu_interactive.md",
         "domain": "domain.yml"}

def _request_export_info():
    ...
    # export training data and quit
    questions = [{
        "name": "export stories",
        "type": "input",
        "message": "Export stories to (if file exists, this "
                   "will append the stories)",
        "default": PATHS["stories"],
        "validate": validate_path
    }, {
        "name": "export nlu",
        "type": "input",
        "message": "Export NLU data to (if file exists, this "
                   "will merge learned data with previous training examples)",
        "default": PATHS["nlu"],
        "validate": validate_path
    }, {
        "name": "export domain",
        "type": "input",
        "message": "Export domain file to (if file exists, this "
                   "will be overwritten)",
        "default": PATHS["domain"],
        "validate": validate_path}]
    ...
```
Instead, it would be helpful to define the defaults through command-line arguments (or possibly a config). Otherwise you have to type the output path again and again for every training session.

Hints from issue discussion:
we'd be happy to accept a PR for this
Yes, I was just about to write an issue for this.

I have a custom directory and file naming and on saving after the interactive training I have to manually change all three paths.

```
Do you want to stop?  Export & Quit
? Export stories to (if file exists, this will append the stories) backend/data_train/stories.md
? Export NLU data to (if file exists, this will merge learned data with previous training examples) backend/data_train/nlu_data.md
? Export domain file to (if file exists, this will be overwritten) backend/data_train/domain.yml
```

It would be really cool if we could define all three paths + file names via command line arguments.
if you're up for it, we'd happily accept a PR for this :) 
@akelad I added a rather straightforward implementation and made a PR. Please feel free to adjust if it doesn't meet your standards.
awesome thanks!

Commit message: Merge branch 'master' into feature/2741

Patch to review:
diff --git a/rasa/core/cli/train.py b/rasa/core/cli/train.py
index 798d26910b58..458ee6f4324b 100644
--- a/rasa/core/cli/train.py
+++ b/rasa/core/cli/train.py
@@ -50,6 +50,9 @@ def add_interactive_args(parser):
         default=False,
         action='store_true',
         help="retrain the model immediately based on feedback.")
+    parser.add_argument('--data',
+        default=None,
+        help="Location where the training data should be saved.")
 
     arguments.add_output_arg(
         parser,
diff --git a/rasa/core/training/interactive.py b/rasa/core/training/interactive.py
index eae8c50fd8de..56d469d4c063 100644
--- a/rasa/core/training/interactive.py
+++ b/rasa/core/training/interactive.py
@@ -1421,6 +1421,15 @@ def run_interactive_learning(stories: Text = None,
 
     server_args = server_args or {}
 
+    if server_args.get('data'):
+        PATHS['nlu'] = server_args['data']
+
+    if server_args.get('stories'):
+        PATHS['stories'] = server_args['stories']
+
+    if server_args.get('domain'):
+        PATHS['domain'] = server_args['domain']
+
     if not skip_visualization:
         p = Process(target=start_visualization, args=("story_graph.dot",))
         p.deamon = True


Code review comments:
diff_hunk: @@ -50,6 +50,9 @@ def add_interactive_args(parser):
         default=False,
         action='store_true',
         help="retrain the model immediately based on feedback.")
+    parser.add_argument('--data',
path: rasa/core/cli/train.py
text: @user2:
`--data` could be a bit misleading here, right? Should we call it `--nlu`  as it's done for the NLU training? 
@user1 Any wishes? 

@author:
@user2 I agree that it is misleading but `--nlu` is not possible here since it is already used for the directory of the trained nlu model. But what this parameter refers to is the path to the intent training data file. The rasa nlu training parameter for this file is also called `--data` (see here: [rasa/nlu/train.py#L26](https://github.com/RasaHQ/rasa_nlu/blob/7ca592a2e78380388251adf58236994299488761/rasa/nlu/train.py#L26)) and therefore I thought it would be a good idea to keep it consistent.

@user1:
@author I think that when you're training NLU, it makes sense for `--data` to mean NLU data. But when you're training core, you'd expect `--data` to mean core data. I would suggest something like `--nlu_data` or something of the sort

@author:
@user1 `--nlu_data` sounds good to me 👍 

@user2:
Awesome, then let's do that 🚀 

@author:
@user2 I did change the argument naming 🚀