AllenNLP

作者: ShuiLocked | 来源:发表于2018-07-09 14:53 被阅读42次

    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.
    

    相关文章

      网友评论

          本文标题:AllenNLP

          本文链接:https://www.haomeiwen.com/subject/idxtpftx.html