def METHOD_NAME(self, train_subset):
    src_lang_set, tgt_lang_set, domain_set = set(), set(), set()
    for split in train_subset.split(","):
        seq = split.split("_")
        assert len(seq) == 4, "subset {} should be in the format of train_src_tgt_domain".format(split)
        _, src_lang, tgt_lang, domain = seq
        src_lang_set.add(src_lang)
        tgt_lang_set.add(tgt_lang)
        domain_set.add(domain)
    src_langs = sorted(src_lang_set)
    tgt_langs = sorted(tgt_lang_set)
    domains = sorted(domain_set)
    self.src_lang_map = {src_lang: i for (i, src_lang) in enumerate(src_langs)}
    self.tgt_lang_map = {tgt_lang: i for (i, tgt_lang) in enumerate(tgt_langs)}
    self.domain_map = {domain: i for (i, domain) in enumerate(domains)}
    if self.task_type == "lang":
        self.encoder_tasks = len(self.src_lang_map)
        self.decoder_tasks = len(self.tgt_lang_map)
    elif self.task_type == "domain":
        self.encoder_tasks = len(self.domain_map)
        self.decoder_tasks = len(self.domain_map)