    def build_criterion(self, args: Namespace):
        """
        Build the :class:`~fairseq.criterions.FairseqCriterion` instance for
        this task.

        Args:
            args (argparse.Namespace): parsed command-line arguments

        Returns:
            a :class:`~fairseq.criterions.FairseqCriterion` instance
        """
        from fairseq import criterions

        return criterions.build_criterion(args, self)
Build the :class:`~fairseq.criterions.FairseqCriterion` instance for
this task.

Args:
args (argparse.Namespace): parsed command-line arguments

Returns:
a :class:`~fairseq.criterions.FairseqCriterion` instance
fairseq/tasks/fairseq_task.py