AllenNLP

How `subcommand' works?

In subcommand.py:

if 'func' in dir(args):
        # Import any additional modules needed (to register custom classes).
        for package_name in getattr(args, 'include_package', ()):
            import_submodules(package_name)
        args.func(args)
    else:
        parser.print_help()

while in predict.py:

subparser.set_defaults(func=_predict)

Finally, it calls the function _predict() in predict.py, if we type in the command :

allennlp predict.
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • rljs by sennchi Timeline of History Part One The Cognitiv...
    sennchi阅读 7,458评论 0 10
  • 今天80、90创业者成为了这个社会的焦点,他们淌洋在媒体的闪光灯和舞台的镁光灯之下,但是在灯光的背后还有一个背负着...
    上火老干部阅读 422评论 0 1
  • 那一池塘柳,齐身把手栽。 葱葱青色里,片片绿藏哀。
    文字虫阅读 380评论 0 0
  • 梦中有一叶舟, 在汹涌的浪里翻滚, 情人跳进了海里, 我们在那个梦里。 梦中有一片海, 在呼啸的风里号叫, 灵魂被...
    十四行丶阅读 193评论 0 0