def from_dict(cls, json_object, strict=False):
    """Constructs a `BertConfig` from a Python dictionary of parameters."""
    config = cls(vocab_size=None)
    for (key, value) in six.iteritems(json_object):
      if strict and key not in config.__dict__:
        raise ValueError("BertConfig has no field '{}'".format(key))
      config.__dict__[key] = value
    if strict and config.vocab_size is None:
      raise ValueError("BertConfig field 'vocab_size' is unset")
    return config
Constructs a `BertConfig` from a Python dictionary of parameters.
language/canine/bert_modeling.py