4 ms·
AllenNLP uses Jsonnet for config files, for anyone ondering what one potential use case is. For example, here's a config for NER with ELMo: https://github.com
by rococode 8y ago
AllenNLP uses Jsonnet for config files, for anyone ondering what one potential use case is.
For example, here's a config for NER with ELMo:
https://github.com/allenai/allennlp/blob/master/training_config/ner_elmo.jsonnet https://github.com/allenai/allennlp/blob/master/training_con...
I guess the only really jsonnet-specific thing here is std.extVar() call, but generally speaking it's just a more flexible JSON file that doesn't cost much more to use (brainpower or physical resources). I use it to mix and match configs while debugging sometimes as you can do things like if statements and adding dicts together.
It's also nice for modularization, you can do things like having a function that returns a dict, so if your config needs two slightly different datareaders you can just pull out all the common parts and call the function twice instead of having two copies of the entire datareader config (with only minor differences).