code: def train_model_from_file(parameter_filename: str,
                            serialization_dir: str,
                            overrides: str = "",
                            file_friendly_logging: bool = False,
                            recover: bool = False,
                            force: bool = False,
                            cache_directory: str = None,
                            cache_prefix: str = None) -> Model:
      
      # Load the experiment config from a file and pass it to ``train_model``.
      params = Params.from_file(parameter_filename, overrides)
      return train_model(params,
                         serialization_dir,
                         file_friendly_logging,
                         recover,
                         force,
                         cache_directory, cache_prefix)
docs: A wrapper around :func:`train_model` which loads the params from a file.
  
      Parameters
      ----------
      parameter_filename : ``str``
          A json parameter file specifying an AllenNLP experiment.
      serialization_dir : ``str``
          The directory in which to save results and logs. We just pass this along to
          :func:`train_model`.
      overrides : ``str``
          A JSON string that we will use to override values in the input parameter file.
      file_friendly_logging : ``bool``, optional (default=False)
          If ``True``, we make our output more friendly to saved model files.  We just pass this
          along to :func:`train_model`.
      recover : ``bool`, optional (default=False)
          If ``True``, we will try to recover a training run from an existing serialization
          directory.  This is only intended for use when something actually crashed during the middle
          of a run.  For continuing training a model on new data, see the ``fine-tune`` command.
      force : ``bool``, optional (default=False)
          If ``True``, we will overwrite the serialization directory if it already exists.
      cache_directory : ``str``, optional
          For caching data pre-processing.  See :func:`allennlp.training.util.datasets_from_params`.
      cache_prefix : ``str``, optional
          For caching data pre-processing.  See :func:`allennlp.training.util.datasets_from_params`.