def create_argument_parser(): """Parse all the command line arguments for the visualisation script.""" parser = argparse.ArgumentParser( description='Visualize the stories in a dialogue training file') parser.add_argument('-s', '--stories', required=True, type=str, help="story file or folder containing the stories" "to visualize") parser.add_argument('-d', '--domain', required=True, type=str, help="domain file") parser.add_argument('-o', '--output', required=True, type=str, help="filename of the output path, e.g. 'graph.png") parser.add_argument('-m', '--max_history', default=2, type=int, help="max history to consider when merging " "paths in the output graph") parser.add_argument('-nlu', '--nlu_data', default=None, type=str, help="path of the Rasa NLU training data, " "used to insert example messages into the graph") utils.add_logging_option_arguments(parser) return parser
def create_argparser(): parser = argparse.ArgumentParser(description='starts the bot') parser.add_argument('-d', '--core', required=True, type=str, help="core model to run") parser.add_argument('-u', '--nlu', type=str, help="nlu model to run") parser.add_argument('-p', '--port', default=5002, type=int, help="port to run the server at") parser.add_argument('-o', '--log_file', type=str, default="rasa_core.log", help="store log file in specified file") utils.add_logging_option_arguments(parser) return parser
def create_argument_parser(): """Parse all the command line arguments for the visualisation script.""" parser = argparse.ArgumentParser( description='Visualize the stories in a dialogue training file') parser.add_argument('-o', '--output', required=True, type=str, help="filename of the output path, e.g. 'graph.html") parser.add_argument('-m', '--max_history', default=2, type=int, help="max history to consider when merging " "paths in the output graph") parser.add_argument('-nlu', '--nlu_data', default=None, type=str, help="path of the Rasa NLU training data, " "used to insert example messages into the graph") utils.add_logging_option_arguments(parser) cli.arguments.add_config_arg(parser, nargs=1) cli.arguments.add_domain_arg(parser) cli.arguments.add_model_and_story_group(parser, allow_pretrained_model=False) return parser
def create_argument_parser(): """Parse all the command line arguments for the server script.""" parser = argparse.ArgumentParser( description='starts server to serve an agent') parser.add_argument( '-e', '--environment', type=str, help="environment config file to run with the server") parser.add_argument( '--cors', nargs='*', type=str, help="enable CORS for the passed origin. " "Use * to whitelist all origins") parser.add_argument( '--auth_token', type=str, help="Enable token based authentication. Requests need to provide " "the token to be accepted.") parser.add_argument( '-o', '--log_file', type=str, default="rasa_core.log", help="store log file in specified file") utils.add_logging_option_arguments(parser) return parser
def create_argument_parser(): """Parse all the command line arguments for the restore script.""" parser = argparse.ArgumentParser( description='starts the bot') parser.add_argument( '-d', '--core', required=True, type=str, help="core model to run") parser.add_argument( '-u', '--nlu', type=str, help="nlu model to run") parser.add_argument( 'tracker_dump', type=str, help="file that contains a dumped tracker state in json format") parser.add_argument( '--enable_api', action="store_true", help="Start the web server api in addition to the input channel") utils.add_logging_option_arguments(parser) return parser
def create_argument_parser(): """Create argument parser for the evaluate script.""" parser = argparse.ArgumentParser( description='evaluates a dialogue model') parser.add_argument( '-s', '--stories', type=str, required=True, help="file that contains the stories to evaluate on") parser.add_argument( '-m', '--max_stories', type=int, default=None, help="maximum number of stories to test on") parser.add_argument( '-d', '--core', required=True, type=str, help="core model to run with the server") parser.add_argument( '-u', '--nlu', type=str, help="nlu model to run with the server. None for regex interpreter") parser.add_argument( '-o', '--output', type=str, default="story_confmat.pdf", help="output path for the created evaluation plot") utils.add_logging_option_arguments(parser) return parser
def create_argument_parser(): """Parse all the command line arguments for the run script.""" parser = argparse.ArgumentParser(description='starts the bot') parser.add_argument('-d', '--core', required=True, type=str, help="core model to run") parser.add_argument('-u', '--nlu', type=str, help="nlu model to run") parser.add_argument( '-p', '--port', default=5002, type=int, help="port to run the server at (if a server is run " "- depends on the chosen channel, e.g. facebook uses this)") parser.add_argument('-o', '--log_file', type=str, default="rasa_core.log", help="store log file in specified file") parser.add_argument( '--credentials', default=None, help="authentication credentials for the connector as a yml file") parser.add_argument('-c', '--connector', default="cmdline", choices=["facebook", "slack", "telegram", "cmdline"], help="service to connect to") utils.add_logging_option_arguments(parser) return parser
def create_argument_parser(): """Parse all the command line arguments for the training script.""" parser = argparse.ArgumentParser(description='trains a dialogue model') parent_parser = argparse.ArgumentParser(add_help=False) add_args_to_parser(parent_parser) add_model_and_story_group(parent_parser) utils.add_logging_option_arguments(parent_parser) subparsers = parser.add_subparsers(help='mode', dest='mode') subparsers.add_parser('default', help='default mode: train a dialogue' ' model', parents=[parent_parser]) compare_parser = subparsers.add_parser('compare', help='compare mode: train multiple ' 'dialogue models to compare ' 'policies', parents=[parent_parser]) interactive_parser = subparsers.add_parser('interactive', help='teach the bot with ' 'interactive learning', parents=[parent_parser]) add_compare_args(compare_parser) add_interactive_args(interactive_parser) return parser
def create_argument_parser(): """Parse all the command line arguments for the training script.""" parser = argparse.ArgumentParser( description='trains a dialogue model') parser.add_argument( '-s', '--stories', type=str, required=True, help="file or folder containing the training stories") parser.add_argument( '-o', '--out', type=str, required=True, help="directory to persist the trained model in") parser.add_argument( '-d', '--domain', type=str, required=True, help="domain specification yaml file") parser.add_argument( '-u', '--nlu', type=str, default=None, help="trained nlu model") parser.add_argument( '--history', type=int, default=3, help="max history to use of a story") parser.add_argument( '--epochs', type=int, default=100, help="number of epochs to train the model") parser.add_argument( '--validation_split', type=float, default=0.1, help="Percentage of training samples used for validation, " "0.1 by default") parser.add_argument( '--batch_size', type=int, default=20, help="number of training samples to put into one training batch") parser.add_argument( '--online', default=False, action='store_true', help="enable online training") parser.add_argument( '--augmentation', type=int, default=50, help="how much data augmentation to use during training") utils.add_logging_option_arguments(parser) return parser
def create_argument_parser(): """Parse all the command line arguments for the run script.""" parser = argparse.ArgumentParser( description='starts the bot') parser.add_argument( '-d', '--core', required=True, type=str, help="core model to run") parser.add_argument( '-u', '--nlu', type=str, help="nlu model to run") parser.add_argument( '-p', '--port', default=constants.DEFAULT_SERVER_PORT, type=int, help="port to run the server at") parser.add_argument( '--auth_token', type=str, help="Enable token based authentication. Requests need to provide " "the token to be accepted.") parser.add_argument( '--cors', nargs='*', type=str, help="enable CORS for the passed origin. " "Use * to whitelist all origins") parser.add_argument( '-o', '--log_file', type=str, default="rasa_core.log", help="store log file in specified file") parser.add_argument( '--credentials', default=None, help="authentication credentials for the connector as a yml file") parser.add_argument( '--endpoints', default=None, help="Configuration file for the connectors as a yml file") parser.add_argument( '-c', '--connector', default="cmdline", choices=["facebook", "slack", "telegram", "mattermost", "cmdline", "twilio", "botframework", "rocketchat"], help="service to connect to") parser.add_argument( '--enable_api', action="store_true", help="Start the web server api in addition to the input channel") utils.add_logging_option_arguments(parser) return parser
def create_argument_parser(): """Create argument parser for the evaluate script.""" parser = argparse.ArgumentParser(description='evaluates a dialogue model') parser.add_argument( '-s', '--stories', type=str, required=True, help="file or folder containing stories to evaluate on") parser.add_argument('-m', '--max_stories', type=int, help="maximum number of stories to test on") parser.add_argument('-d', '--core', required=True, type=str, help="core model to run with the server") parser.add_argument( '-u', '--nlu', type=str, help="nlu model to run with the server. None for regex interpreter") parser.add_argument( '-o', '--output', type=str, nargs="?", const="story_confmat.pdf", help="output path for the created evaluation plot. If not " "specified, no plot will be generated.") parser.add_argument( '--e2e', '--end-to-end', action='store_true', help="Run an end-to-end evaluation for combined action and " "intent prediction. Requires a story file in end-to-end " "format.") parser.add_argument('--failed', type=str, default="failed_stories.md", help="output path for the failed stories") parser.add_argument( '--endpoints', default=None, help="Configuration file for the connectors as a yml file") parser.add_argument( '--fail_on_prediction_errors', action='store_true', help="If a prediction error is encountered, an exception " "is thrown. This can be used to validate stories during " "tests, e.g. on travis.") utils.add_logging_option_arguments(parser) return parser
def create_argument_parser(): """Parse all the command line arguments for the run script.""" parser = argparse.ArgumentParser( description='starts the bot') parser.add_argument( '-d', '--core', required=True, type=str, help="core model to run") parser.add_argument( '-u', '--nlu', type=str, help="nlu model to run") parser.add_argument( '-p', '--port', default=constants.DEFAULT_SERVER_PORT, type=int, help="port to run the server at") parser.add_argument( '--auth_token', type=str, help="Enable token based authentication. Requests need to provide " "the token to be accepted.") parser.add_argument( '--cors', nargs='*', type=str, help="enable CORS for the passed origin. " "Use * to whitelist all origins") parser.add_argument( '-o', '--log_file', type=str, default="rasa_core.log", help="store log file in specified file") parser.add_argument( '--credentials', default=None, help="authentication credentials for the connector as a yml file") parser.add_argument( '--endpoints', default=None, help="Configuration file for the connectors as a yml file") parser.add_argument( '-c', '--connector', default="cmdline", choices=["facebook", "slack", "telegram", "mattermost", "cmdline", "twilio", "botframework", "rocketchat","bot"], help="service to connect to") parser.add_argument( '--enable_api', action="store_true", help="Start the web server api in addition to the input channel") utils.add_logging_option_arguments(parser) return parser
def create_argument_parser(): """Parse all the command line arguments for the training script.""" parser = argparse.ArgumentParser(description='trains a dialogue model') add_model_and_story_group(parser) add_args_to_parser(parser) utils.add_logging_option_arguments(parser) return parser
def create_argument_parser(): """Parse all the command line arguments for the training script.""" parser = argparse.ArgumentParser(description='trains a dialogue model') # either the user can pass in a story file, or the data will get # downloaded from a url group = parser.add_mutually_exclusive_group(required=True) group = add_args_to_group(group) parser = add_args_to_parser(parser) utils.add_logging_option_arguments(parser) return parser
def create_argument_parser(): parser = argparse.ArgumentParser(description='Startet einen Chatbot') parser.add_argument('-c', '--core', type=str, required=True, help="coreModel folder") parser.add_argument('-n', '--nlu', type=str, required=True, help="nluModelFolder") utils.add_logging_option_arguments(parser) return parser
def create_argument_parser(): """Create argument parser for the evaluate script.""" parser = argparse.ArgumentParser(description='evaluates a dialogue model') parser.add_argument( '-s', '--stories', type=str, required=True, help="file or folder containing stories to evaluate on") parser.add_argument('-m', '--max_stories', type=int, default=None, help="maximum number of stories to test on") parser.add_argument('-d', '--core', required=True, type=str, help="core model to run with the server") parser.add_argument( '-u', '--nlu', type=str, help="nlu model to run with the server. None for regex interpreter") parser.add_argument( '-p', '--message-preprocessor', type=str, help= "The message pre-processor parameter, if None => no message pre-processor provided" ) parser.add_argument( '-i', '--interpreter-class', type=str, help= "The interpreter class parameter, if None => RASANluInterpreter provided" ) parser.add_argument('-o', '--output', type=str, default="story_confmat.pdf", help="output path for the created evaluation plot") utils.add_logging_option_arguments(parser) return parser
def create_argument_parser(): """Create argument parser for the evaluate script.""" parser = argparse.ArgumentParser(description='evaluates a dialogue model') parent_parser = argparse.ArgumentParser(add_help=False) add_args_to_parser(parent_parser) utils.add_logging_option_arguments(parent_parser) subparsers = parser.add_subparsers(help='mode', dest='mode') subparsers.add_parser('default', help='default mode: evaluate a dialogue' ' model', parents=[parent_parser]) subparsers.add_parser('compare', help='compare mode: evaluate multiple' ' dialogue models to compare ' 'policies', parents=[parent_parser]) return parser
def add_general_args(parser): parser.add_argument( '--augmentation', type=int, default=50, help="how much data augmentation to use during training") parser.add_argument('--dump_stories', default=False, action='store_true', help="If enabled, save flattened stories to a file") parser.add_argument( '--debug_plots', default=False, action='store_true', help="If enabled, will create plots showing checkpoints " "and their connections between story blocks in a " "file called `story_blocks_connections.html`.") utils.add_logging_option_arguments(parser)
def create_argument_parser(): """Parse all the command line arguments for the server script.""" parser = argparse.ArgumentParser( description='starts server to serve an agent') parser.add_argument('-d', '--core', required=True, type=str, help="core model to run with the server") parser.add_argument('-e', '--emulate', choices=['wit', 'luis', 'dialogflow'], help='which service to emulate (default: None i.e.' 'use simple built in format)') parser.add_argument('-u', '--nlu', type=str, help="nlu model to run with the server") parser.add_argument('-p', '--port', type=int, default=5005, help="port to run the server at") parser.add_argument('--cors', nargs='*', type=str, help="enable CORS for the passed origin. " "Use * to whitelist all origins") parser.add_argument( '--auth_token', type=str, help="Enable token based authentication. Requests need to provide " "the token to be accepted.") parser.add_argument('-o', '--log_file', type=str, default="rasa_core.log", help="store log file in specified file") utils.add_logging_option_arguments(parser) return parser
def create_argument_parser(): """Parse all the command line arguments for the server script.""" parser = argparse.ArgumentParser( description='starts server to serve an agent') parser.add_argument( '-d', '--core', required=True, type=str, help="core model to run with the server") parser.add_argument( '-u', '--nlu', type=str, help="nlu model to run with the server") parser.add_argument( '-p', '--port', type=int, default=5005, help="port to run the server at") parser.add_argument( '--cors', nargs='*', type=str, help="enable CORS for the passed origin. " "Use * to whitelist all origins") parser.add_argument( '--auth_token', type=str, help="Enable token based authentication. Requests need to provide " "the token to be accepted.") parser.add_argument( '-o', '--log_file', type=str, default="rasa_core.log", help="store log file in specified file") parser.add_argument( '--endpoints', default=None, help="Configuration file for the connectors as a yml file") utils.add_logging_option_arguments(parser) return parser
def create_argument_parser(): """Parse all the command line arguments for the run script.""" parser = argparse.ArgumentParser( description='starts the bot') parser.add_argument( '-d', '--core', required=True, type=str, help="core model to run") parser.add_argument( '-u', '--nlu', type=str, help="nlu model to run") parser.add_argument( '-p', '--port', default=constants.DEFAULT_SERVER_PORT, type=int, help="port to run the server at (if a server is run " "- depends on the chosen channel, e.g. facebook uses this)") parser.add_argument( '-o', '--log_file', type=str, default="rasa_core.log", help="store log file in specified file") parser.add_argument( '--credentials', default=None, help="authentication credentials for the connector as a yml file") parser.add_argument( '--endpoints', default=None, help="Configuration file for the connectors as a yml file") parser.add_argument( '-c', '--connector', default="cmdline", choices=["facebook", "slack", "telegram", "mattermost", "cmdline", "twilio"], help="service to connect to") utils.add_logging_option_arguments(parser) return parser
def create_argument_parser(): """Parse all the command line arguments for the server script.""" parser = argparse.ArgumentParser( description='starts server to serve an agent') parser.add_argument('-d', '--core', required=True, type=str, help="core model to run with the server") parser.add_argument('-u', '--nlu', type=str, help="nlu model to run with the server") parser.add_argument('-p', '--port', type=int, default=50005, help="port to run the server at") parser.add_argument('--cors', nargs='*', type=str, help="enable CORS for the passed origin. " "Use * to whitelist all origins") parser.add_argument( '--auth_token', type=str, help="Enable token based authentication. Requests need to provide " "the token to be accepted.") parser.add_argument('-o', '--log_file', type=str, default="rasa_core.log", help="store log file in specified file") parser.add_argument( '--endpoints', default=None, help="Configuration file for the connectors as a yml file") utils.add_logging_option_arguments(parser) return parser
def create_argument_parser(): parser = argparse.ArgumentParser(description='Startet Online-Training') parser.add_argument('-s', '--stories', type=str, required=True, help="storiesFile") parser.add_argument('-d', '--domain', type=str, required=True, help="domainFile") parser.add_argument('-n', '--nlu', type=str, required=True, help="NLUModel") utils.add_logging_option_arguments(parser) return parser
def create_argument_parser(): """Create argument parser for the evaluate script.""" parser = argparse.ArgumentParser(description='evaluates a dialogue model') parser.add_argument( '-s', '--stories', type=str, required=True, help="file or folder containing stories to evaluate on") parser.add_argument('-m', '--max_stories', type=int, default=100, help="maximum number of stories to test on") parser.add_argument('-d', '--core', required=True, type=str, help="core model to run with the server") parser.add_argument( '-u', '--nlu', type=str, help="nlu model to run with the server. None for regex interpreter") parser.add_argument( '-o', '--output', type=str, default="story_confmat.pdf", help="output path for the created evaluation plot. If set to None" "or an empty string, no plot will be generated.") parser.add_argument('--failed', type=str, default="failed_stories.txt", help="output path for the failed stories") utils.add_logging_option_arguments(parser) return parser
def create_argument_parser(): """Create argument parser for the evaluate script.""" parser = argparse.ArgumentParser( description='evaluates a dialogue model') parser.add_argument( '-s', '--stories', type=str, required=True, help="file or folder containing stories to evaluate on") parser.add_argument( '-m', '--max_stories', type=int, default=100, help="maximum number of stories to test on") parser.add_argument( '-d', '--core', required=True, type=str, help="core model to run with the server") parser.add_argument( '-u', '--nlu', type=str, help="nlu model to run with the server. None for regex interpreter") parser.add_argument( '-o', '--output', type=str, default="story_confmat.pdf", help="output path for the created evaluation plot. If set to None" "or an empty string, no plot will be generated.") parser.add_argument( '--failed', type=str, default="failed_stories.txt", help="output path for the failed stories") utils.add_logging_option_arguments(parser) return parser
def create_argparser(): parser = argparse.ArgumentParser( description='starts the bot') parser.add_argument( '-u', '--nlu', type=str, default= "../models/nlu_models/default", help="nlu model to use") parser.add_argument( '-m', '--model_output', type=str, default= "../models/dialogueModels/custom", help="path of output dialogue model") parser.add_argument( '-td', '--training_data_file', type=str, default= "../data/stories/stories.md", help="data to build model with") utils.add_logging_option_arguments(parser) return parser
def create_argument_parser(): """Parse all the command line arguments for the training script.""" parser = argparse.ArgumentParser( description='trains a dialogue model') parser.add_argument( '-s', '--stories', type=str, required=True, help="file or folder containing the training stories") parser.add_argument( '-o', '--out', type=str, required=True, help="directory to persist the trained model in") parser.add_argument( '-d', '--domain', type=str, required=True, help="domain specification yaml file") parser.add_argument( '-u', '--nlu', type=str, default=None, help="trained nlu model") parser.add_argument( '--history', type=int, default=3, help="max history to use of a story") parser.add_argument( '--epochs', type=int, default=100, help="number of epochs to train the model") parser.add_argument( '--validation_split', type=float, default=0.1, help="Percentage of training samples used for validation, " "0.1 by default") parser.add_argument( '--batch_size', type=int, default=20, help="number of training samples to put into one training batch") parser.add_argument( '--online', default=False, action='store_true', help="enable online training") parser.add_argument( '--augmentation', type=int, default=50, help="how much data augmentation to use during training") parser.add_argument( '--debug_plots', default=False, action='store_true', help="If enabled, will create plots showing checkpoints " "and their connections between story blocks in a " "file called `story_blocks_connections.pdf`.") parser.add_argument( '--dump_stories', default=False, action='store_true', help="If enabled, save flattened stories to a file") parser.add_argument( '--endpoints', default=None, help="Configuration file for the connectors as a yml file") parser.add_argument( '--nlu_threshold', type=float, default=DEFAULT_NLU_FALLBACK_THRESHOLD, help="If NLU prediction confidence is below threshold, fallback " "will get triggered.") parser.add_argument( '--core_threshold', type=float, default=DEFAULT_CORE_FALLBACK_THRESHOLD, help="If Core action prediction confidence is below the threshold " "a fallback action will get triggered") parser.add_argument( '--fallback_action_name', type=str, default=DEFAULT_FALLBACK_ACTION, help="When a fallback is triggered (e.g. because the ML prediction " "is of low confidence) this is the name of tje action that " "will get triggered instead.") utils.add_logging_option_arguments(parser) return parser
def create_argument_parser(): """Parse all the command line arguments for the run script.""" parser = argparse.ArgumentParser( description='starts the bot') parser.add_argument( '-d', '--core', required=True, type=str, help="core model to run") parser.add_argument( '-u', '--nlu', type=str, help="nlu model to run") parser.add_argument( '-p', '--port', default=constants.DEFAULT_SERVER_PORT, type=int, help="port to run the server at") parser.add_argument( '--auth_token', type=str, help="Enable token based authentication. Requests need to provide " "the token to be accepted.") parser.add_argument( '--cors', nargs='*', type=str, help="enable CORS for the passed origin. " "Use * to whitelist all origins") parser.add_argument( '-o', '--log_file', type=str, default="rasa_core.log", help="store log file in specified file") parser.add_argument( '--credentials', default=None, help="authentication credentials for the connector as a yml file") parser.add_argument( '--endpoints', default=None, help="Configuration file for the connectors as a yml file") parser.add_argument( '-c', '--connector', type=str, help="service to connect to") parser.add_argument( '--enable_api', action="store_true", help="Start the web server api in addition to the input channel") jwt_auth = parser.add_argument_group('JWT Authentication') jwt_auth.add_argument( '--jwt_secret', type=str, help="Public key for asymmetric JWT methods or shared secret" "for symmetric methods. Please also make sure to use " "--jwt_method to select the method of the signature, " "otherwise this argument will be ignored.") jwt_auth.add_argument( '--jwt_method', type=str, default="HS256", help="Method used for the signature of the JWT authentication " "payload.") utils.add_logging_option_arguments(parser) return parser
def create_argument_parser(): """Parse all the command line arguments for the training script.""" parser = argparse.ArgumentParser(description='trains a dialogue model') # either the user can pass in a story file, or the data will get # downloaded from a url group = parser.add_mutually_exclusive_group(required=True) group.add_argument('-s', '--stories', type=str, help="file or folder containing the training stories") group.add_argument( '--url', type=str, help="If supplied, downloads a story file from a URL and " "trains on it. Fetches the data by sending a GET request " "to the supplied URL.") group.add_argument( '--core', default=None, help="path to load a pre-trained model instead of training (for " "interactive mode only)") parser.add_argument('-o', '--out', type=str, required=False, help="directory to persist the trained model in") parser.add_argument('-d', '--domain', type=str, required=False, help="domain specification yaml file") parser.add_argument('-u', '--nlu', type=str, default=None, help="trained nlu model") parser.add_argument('--history', type=int, default=3, help="max history to use of a story") parser.add_argument('--epochs', type=int, default=100, help="number of epochs to train the model") parser.add_argument( '--validation_split', type=float, default=0.1, help="Percentage of training samples used for validation, " "0.1 by default") parser.add_argument( '--batch_size', type=int, default=20, help="number of training samples to put into one training batch") parser.add_argument('--interactive', default=False, action='store_true', help="enable interactive training") parser.add_argument('--skip_visualization', default=False, action='store_true', help="disables plotting the visualization during " "interactive learning") parser.add_argument( '--finetune', default=False, action='store_true', help="retrain the model immediately based on feedback.") parser.add_argument( '--augmentation', type=int, default=50, help="how much data augmentation to use during training") parser.add_argument( '--debug_plots', default=False, action='store_true', help="If enabled, will create plots showing checkpoints " "and their connections between story blocks in a " "file called `story_blocks_connections.pdf`.") parser.add_argument('--dump_stories', default=False, action='store_true', help="If enabled, save flattened stories to a file") parser.add_argument( '--endpoints', default=None, help="Configuration file for the connectors as a yml file") parser.add_argument( '--nlu_threshold', type=float, default=DEFAULT_NLU_FALLBACK_THRESHOLD, help="If NLU prediction confidence is below threshold, fallback " "will get triggered.") parser.add_argument( '--core_threshold', type=float, default=DEFAULT_CORE_FALLBACK_THRESHOLD, help="If Core action prediction confidence is below the threshold " "a fallback action will get triggered") parser.add_argument( '--fallback_action_name', type=str, default=DEFAULT_FALLBACK_ACTION, help="When a fallback is triggered (e.g. because the ML prediction " "is of low confidence) this is the name of tje action that " "will get triggered instead.") utils.add_logging_option_arguments(parser) return parser
def create_argument_parser(): """Parse all the command line arguments for the training script.""" parser = argparse.ArgumentParser( description='trains a dialogue model') # either the user can pass in a story file, or the data will get # downloaded from a url group = parser.add_mutually_exclusive_group(required=True) group.add_argument( '-s', '--stories', type=str, help="file or folder containing the training stories") group.add_argument( '--url', type=str, help="If supplied, downloads a story file from a URL and " "trains on it. Fetches the data by sending a GET request " "to the supplied URL.") parser.add_argument( '-o', '--out', type=str, required=True, help="directory to persist the trained model in") parser.add_argument( '-d', '--domain', type=str, required=True, help="domain specification yaml file") parser.add_argument( '-u', '--nlu', type=str, default=None, help="trained nlu model") parser.add_argument( '--history', type=int, default=3, help="max history to use of a story") parser.add_argument( '--epochs', type=int, default=100, help="number of epochs to train the model") parser.add_argument( '--validation_split', type=float, default=0.1, help="Percentage of training samples used for validation, " "0.1 by default") parser.add_argument( '--batch_size', type=int, default=20, help="number of training samples to put into one training batch") parser.add_argument( '--online', default=False, action='store_true', help="enable online training") parser.add_argument( '--augmentation', type=int, default=50, help="how much data augmentation to use during training") parser.add_argument( '--debug_plots', default=False, action='store_true', help="If enabled, will create plots showing checkpoints " "and their connections between story blocks in a " "file called `story_blocks_connections.pdf`.") parser.add_argument( '--dump_stories', default=False, action='store_true', help="If enabled, save flattened stories to a file") parser.add_argument( '--endpoints', default=None, help="Configuration file for the connectors as a yml file") parser.add_argument( '--nlu_threshold', type=float, default=DEFAULT_NLU_FALLBACK_THRESHOLD, help="If NLU prediction confidence is below threshold, fallback " "will get triggered.") parser.add_argument( '--core_threshold', type=float, default=DEFAULT_CORE_FALLBACK_THRESHOLD, help="If Core action prediction confidence is below the threshold " "a fallback action will get triggered") parser.add_argument( '--fallback_action_name', type=str, default=DEFAULT_FALLBACK_ACTION, help="When a fallback is triggered (e.g. because the ML prediction " "is of low confidence) this is the name of tje action that " "will get triggered instead.") utils.add_logging_option_arguments(parser) return parser