The general ParlAI Script interface.

An abstract class to help standardize the call to ParlAI scripts, enabling them to be completed easily.

Also contains helper classes for loading scripts, etc.


Loads the scripts so that @register_script is hit for all.

class parlai.core.script.ParlaiScript(opt: parlai.core.opt.Opt)[source]

Bases: object

A ParlAI script is a standardized form of access.

abstract classmethod setup_args() → parlai.core.params.ParlaiParser[source]

Create the parser with args.

__init__(opt: parlai.core.opt.Opt)[source]

Initialize self. See help(type(self)) for accurate signature.

abstract run()[source]

The main method.

Must be implemented by the script writer.

classmethod main(*args, **kwargs)[source]

Run the program, possibly with some given args.

You may provide command line args in the form of strings, or options. For example:

>>> MyScript.main(['--task', 'convai2'])
>>> MyScript.main(task='convai2')

You may not combine both args and kwargs.


Superscript is a loader for all the other scripts.