def METHOD_NAME(self, languages: str):
    """
    Build a map from languages to ids. These ids are used as segment labels
    for cross-lingual LM training.
    """
    lang2id = {}
    langs = [l.strip() for l in languages.split(",")]
    for id, lang in enumerate(langs):
        lang2id[lang] = id
    return lang2id