    def _to_params(self) -> Dict[str, Any]:
        """
        Returns a dictionary of parameters that, when turned into a `Params` object and
        then fed to `.from_params()`, will recreate this object.

        You don't need to implement this all the time. AllenNLP will let you know if you
        need it.
        """
        raise NotImplementedError()
Returns a dictionary of parameters that, when turned into a `Params` object and
then fed to `.from_params()`, will recreate this object.

You don't need to implement this all the time. AllenNLP will let you know if you
need it.
allennlp/common/from_params.py