yzhangcs / parser

:rocket: State-of-the-art parsers for natural language.
https://parser.yzhang.site/
MIT License
827 stars 139 forks source link

config file #45

Closed attardi closed 3 years ago

attardi commented 3 years ago

Values in a config file which are also CLI arguments are discarded, since class Config overwrites those values from kwargs.

Is this intended?

The alternative is to set their default to config.SUPPRESS, like this:

subparser.add_argument('--n-word-embed', default=argparse.SUPPRESS, type=int, help='dimension of embeddings')
subparser.add_argument('--bert', default=argparse.SUPPRESS, help='which bert model to use')

If not specified in the CLI, they will get a default value from function call to train()

yzhangcs commented 3 years ago

@attardi Sorry for my late reply.

Is this intended?

Yeah, it is an expected behaviour.

The alternative is to set their default to config.SUPPRESS, like this:

That's really a good solution. I never knew the usage before. Thank you!