Exemplo n.º 1
0
def add_subparser(subparsers: argparse._SubParsersAction,
                  parents: List[argparse.ArgumentParser]):
    import rasa.core.cli.train as core_cli

    train_parser = subparsers.add_parser(
        "train", help="Train the Rasa bot")

    train_subparsers = train_parser.add_subparsers()
    train_core_parser = train_subparsers.add_parser(
        "core",
        conflict_handler="resolve",
        formatter_class=argparse.ArgumentDefaultsHelpFormatter,
        help="Train Rasa Core")
    train_core_parser.set_defaults(func=train_core)

    train_nlu_parser = train_subparsers.add_parser(
        "nlu",
        parents=parents,
        formatter_class=argparse.ArgumentDefaultsHelpFormatter,
        help="Train Rasa NLU")
    train_nlu_parser.set_defaults(func=train_nlu)

    for p in [train_parser, train_core_parser, train_nlu_parser]:
        add_general_arguments(p)

    for p in [train_core_parser, train_parser]:
        add_domain_param(p)
        core_cli.add_general_args(p)
    add_stories_param(train_core_parser)
    _add_core_compare_arguments(train_core_parser)

    add_nlu_data_param(train_nlu_parser)

    add_joint_parser_arguments(train_parser)
    train_parser.set_defaults(func=train)
Exemplo n.º 2
0
def add_core_visualization_params(parser: argparse.ArgumentParser):
    from rasa_core.cli.visualization import add_visualization_arguments

    add_visualization_arguments(parser)
    add_domain_param(parser)
    add_stories_param(parser)