def METHOD_NAME(cls, args, **kwargs):
    data_cfg = S2TDataConfig(op.join(args.data, args.config_yaml))
    dict_path = op.join(args.data, data_cfg.vocab_filename)
    if not op.isfile(dict_path):
        raise FileNotFoundError(f"Dict not found: {dict_path}")
    tgt_dict = Dictionary.load(dict_path)
    logger.info(
        f"dictionary size ({data_cfg.vocab_filename}): " f"{len(tgt_dict):,}"
    )
    if getattr(args, "train_subset", None) is not None:
        if not all(s.startswith("train") for s in args.train_subset.split(",")):
            raise ValueError('Train splits should be named like "train*".')
    return cls(args, tgt_dict)