this /static/media/twitter/XK73C3.png

Did you ever find yourself in one of the following situations?

  • You hard-coded a parameter and now you really wish you could easily change it.
  • A proper command line interface would be nice, but you are way too lazy to write a lot of code for it.
  • You have a bunch of config files for different runs which only differ in a few entries.
  • When executing the help, you get completely lost scrolling through the endless list of parameters.
  • You want to switch between two different options, but each option has different parameters.
  • You changed one entry in your config but forgot to change a related one, and your program crashes.

Being able to configure your code is a frequent need, so it's worth to learn about helpful tools for it. In this talk, I will introduce the open-source library jsonargparse. Starting from good old built-in argparse, I will show you how to switch to jsonargparse and easily manage the situations described above.

If you are new to this topic, this talk can hopefully save you configuration-related frustrations in the future. If you are already using the likes of click, fire, typer or hydra, you'll get to know some of jsonargparse's advanced features that your current tool might be missing.

Marianne Stecklina

Affiliation: omni:us

As a deep learning engineer at omni:us, I'm working on different NLP topics related to document understanding.