    def to_dict(self):
        """
        Only the non-empty attributes are returned, to minimize empty values.
        """
        info = {}
        for key, val in self.__dict__.items():
            if val:
                info[key] = val
        return info
Only the non-empty attributes are returned, to minimize empty values.
allennlp/common/model_card.py