def run(args):

    has_effect = False

    if args:
        try:

            train_corpus, val_corpus, test_corpus = data.get_train_val_test()
            words, embeddings = data.get_polyglot_words_embeddings()

            parser = PCFG()
            parser.learn_probabilities_and_rules(train_corpus)
            parser.set_oov_module(OovModule, words, embeddings)

            if args.inference:

                get_gold(parser, test_corpus, filename='evaluation_data.gold')
                get_predictions(parser,
                                test_corpus,
                                filename='evaluation_data.parser_output')

            if args.evaluation:
                evaluation('evaluation_data.gold',
                           'evaluation_data.parser_output')

            if args.parse:
                parser.parse_from_txt(args.txt_path)

        except Exception as e:
            logger.exception(e)
            logger.error("Uhoh, the script halted with an error.")
    else:
        if not has_effect:
            logger.error(
                "Script halted without any effect. To run code, use command:\npython3 main.py <args>"
            )