'Initializes the predictor, setting up opt automatically if necessary.
Args is expected to be in the same format as sys.argv: e.g. a list in
the form [\'--model\', \'seq2seq\', \'-hs\', 128, \'-lr\', 0.5].
kwargs is interpreted by appending \'--\' to it and replacing underscores
with hyphens, so \'dict_file=/tmp/dict.tsv\' would be interpreted as
\'--dict-file /tmp/dict.tsv\'.'

def __init__(self, args=None, **kwargs):

    from parlai.core.params import ParlaiParser
    from parlai.core.agents import create_agent
    if (args is None):
        args = []
    for (k, v) in kwargs.items():
        args.append(('--' + str(k).replace('_', '-')))
        args.append(str(v))
    parser = ParlaiParser(True, True, model_argv=args)
    self.opt = parser.parse_args(args)
    self.agent = create_agent(self.opt)
