def add_args(parser):
        """Add task-specific arguments to the parser."""
        TranslationTask.add_args(parser)
        # fmt: off
        parser.add_argument('--channel-model', metavar='FILE',
                            help='path to P(S|T) model. P(S|T) and P(T|S) must share source and target dictionaries.')
        parser.add_argument('--combine-method', default='lm_only',
                            choices=['lm_only', 'noisy_channel'],
                            help="""method for combining direct and channel model scores.
                                    lm_only: decode with P(T|S)P(T)
                                    noisy_channel: decode with 1/t P(T|S) + 1/s(P(S|T)P(T))""")
        parser.add_argument('--normalize-lm-scores-by-tgt-len', action='store_true', default=False,
                            help='normalize lm score by target length instead of source length')
        parser.add_argument('--channel-scoring-type', default='log_norm', choices=['unnormalized', 'log_norm', 'k2_separate', 'src_vocab', 'src_vocab_batched'],
                            help="Normalize bw scores with log softmax or return bw scores without log softmax")
        parser.add_argument('--top-k-vocab', default=0, type=int,
                            help='top k vocab IDs to use with `src_vocab` in channel model scoring')
        parser.add_argument('--k2', default=50, type=int,
                            help='the top k2 candidates to rescore with the noisy channel model for each beam')
        parser.add_argument('--ch-wt', default=1, type=float,
                            help='weight for the channel model')
        parser.add_argument('--lm-model', metavar='FILE',
                            help='path to lm model file, to model P(T). P(T) must share the same vocab as the direct model on the target side')
        parser.add_argument('--lm-data', metavar='FILE',
                            help='path to lm model training data for target language, used to properly load LM with correct dictionary')
        parser.add_argument('--lm-wt', default=1, type=float,
                            help='the weight of the lm in joint decoding')
        # fmt: on
Add task-specific arguments to the parser.
understand_icl/fairseq/examples/fast_noisy_channel/noisy_channel_translation.py