Rasa: Allow config path to be passed to Rasa X

Created on 10 Aug 2019  ยท  7Comments  ยท  Source: RasaHQ/rasa

Description of Problem:

Because users are able to pass custom config paths to rasa train, there should be CLI parity for the same.

Overview of the Solution:

Accept custom config path to override default config path, unless none is passed, then use default.

That, or allow for a config/ folder to be passed for all configuration-related files.

Examples (if relevant):

Mainly would help clean up some of the folder structure; without using Rasa X, you can have something like this:

โ”œโ”€โ”€ actions
โ”œโ”€โ”€ config
    โ”œโ”€โ”€ config.yml
    โ”œโ”€โ”€ credentials.yml
    โ””โ”€โ”€ endpoints.yml
โ”œโ”€โ”€ data
    โ”œโ”€โ”€ nlu
    โ””โ”€โ”€ stories
โ”œโ”€โ”€ logs
โ””โ”€โ”€ domain.yml

and pass the config file by passing --config config/config.yml

instead of having the config files clutter up the root directory.

Blockers (if relevant): N/A

Definition of Done:

  • [ ] Tests are added
  • [ ] config path handling is changed
  • [ ] Feature mentioned in the changelog
area type

All 7 comments

Thanks for submitting this feature request ๐Ÿš€@wochinge will get back to you about it soon!โœจ

@ortsaCniveK Thanks for bringing this. I agree, that this could be useful ๐Ÿ‘

Furthermore I would like to set a path to domain.yml and the models folder? Are there any plans to make this configurable too?

I think that's a good idea; there should be absolute parity between the rasa train command options, of which candidates are:

  -c CONFIG, --config CONFIG
                        The policy and NLU pipeline configuration of your bot.
                        (default: config.yml)
  -d DOMAIN, --domain DOMAIN
                        Domain specification (yml file). (default: domain.yml)
  --out OUT             Directory where your models should be stored.
                        (default: models)
  --augmentation AUGMENTATION
                        How much data augmentation to use during training.
                        (default: 50)
  --debug-plots         If enabled, will create plots showing checkpoints and
                        their connections between story blocks in a file
                        called `story_blocks_connections.html`. (default:
                        False)
  --dump-stories        If enabled, save flattened stories to a file.
                        (default: False)
  --fixed-model-name FIXED_MODEL_NAME
                        If set, the name of the model file/directory will be
                        set to the given name. (default: None)
  --persist-nlu-data    Persist the nlu training data in the saved model.
                        (default: False)
  --force               Force a model training even if the data has not
                        changed. (default: False)

Not sure if this is something we'd want to add to the CLI or just abstract into another config file, though.

The original request is now implemented:

-c CONFIG, --config CONFIG
                        The policy and NLU pipeline configuration of your bot.
                        (default: config.yml)

@wochinge , what do you think about implementation of the other command options:

  -d DOMAIN, --domain DOMAIN
                        Domain specification (yml file). (default: domain.yml)
  --out OUT             Directory where your models should be stored.
                        (default: models)
  --augmentation AUGMENTATION
                        How much data augmentation to use during training.
                        (default: 50)
  --debug-plots         If enabled, will create plots showing checkpoints and
                        their connections between story blocks in a file
                        called `story_blocks_connections.html`. (default:
                        False)
  --dump-stories        If enabled, save flattened stories to a file.
                        (default: False)
  --fixed-model-name FIXED_MODEL_NAME
                        If set, the name of the model file/directory will be
                        set to the given name. (default: None)
  --persist-nlu-data    Persist the nlu training data in the saved model.
                        (default: False)
  --force               Force a model training even if the data has not
                        changed. (default: False)

I think

  • it makes sense for --domain and --out
  • it doesn't make sense for --fixed-model-name, --force,--dump-stories and --debug-plots
  • it would make sense to allow --augmentation, --persist-nlu-data to be specified in the config,yml file

What do you think?

@wochinge I agree with above, it would be really nice to just run rasa train and specify training-related parameters in the config file and let the CLI just handle where output is sent or where input is found. It would make a bot more portable if the training-related parameters are specified in the config.

Was this page helpful?
0 / 5 - 0 ratings