class_docstr: Seq2Edits for grammatical error correction.
class_docstr_tok: ["Seq2Edits","for","grammatical","error","correction","."]
code: def hparams(self, defaults, model_hparams):
      super(Seq2editsGec, self).hparams(defaults, model_hparams)
  
      for pointer_feat in ["targets_start_token", "targets_end_token"]:
          defaults.modality[
              pointer_feat
          ] = modalities.ModalityType.IDENTITY
          defaults.vocab_size[pointer_feat] = None
          model_hparams.bottom[pointer_feat] = pointer_bottom
          model_hparams.top[pointer_feat] = pointer_top
      # Whether to use tags.
      if "use_error_tags" not in model_hparams:
          model_hparams.add_hparam("use_error_tags", True)
      # If true, span and tag prediction is in the middle of the decoder layer
      # stack. Otherwise, they are at the end of the decoder layer stack.
      if "middle_prediction" not in model_hparams:
          model_hparams.add_hparam("middle_prediction", True)
      # If middle_prediction=True, divide num_decoder_layers by this to get the
      # number of layers before and after the middle prediction.
      if "middle_prediction_layer_factor" not in model_hparams:
          model_hparams.add_hparam("middle_prediction_layer_factor", 2)
      # Whether to predict the targets_start_token feature. If this is false, use
      # the previous end token as implicit start token.
      if "use_start_token" not in model_hparams:
          model_hparams.add_hparam("use_start_token", False)
      # Whether to feed back targets_end_token to the next time step. If false,
      # only feed back targets_start_token.
      if "feedback_end_token" not in model_hparams:
          model_hparams.add_hparam("feedback_end_token", False)
      # Number of feedforward layers between prediction layers in the cascade.
      if "ffn_in_prediction_cascade" not in model_hparams:
          model_hparams.add_hparam("ffn_in_prediction_cascade", 1)
      # Embedding size for error tags.
      if "error_tag_embed_size" not in model_hparams:
          model_hparams.add_hparam("error_tag_embed_size", 6)
      if model_hparams.use_error_tags:
          defaults.modality[
              "targets_error_tag"
          ] = modalities.ModalityType.SYMBOL
          error_tag_vocab_size = self._encoders[
              "targets_error_tag"
          ].vocab_size
          defaults.vocab_size[
              "targets_error_tag"
          ] = error_tag_vocab_size
          model_hparams.top["targets_error_tag"] = pointer_top
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import os
  from tensor2tensor.data_generators import text_encoder
  from tensor2tensor.data_generators import text_problems
  from tensor2tensor.layers import modalities
  from tensor2tensor.utils import registry
  import tensorflow.compat.v1
label_desc: Use image node_id 6 for calling the Seq2editsGec obj's underlying member method code with example usage: obj.hparams(defaults, model_hparams) without return types