Update README.md
Browse files
README.md
CHANGED
@@ -19,7 +19,7 @@ model = AutoModelForSeq2SeqLM.from_pretrained("n8rob/kreyol-mt-pubtrain")
|
|
19 |
# Or use model = MBartForConditionalGeneration.from_pretrained("n8rob/kreyol-mt-pubtrain")
|
20 |
|
21 |
# First tokenize the input and outputs. The format below is how the model was trained so the input should be "Sentence </s> SRCCODE". Similarly, the output should be "TGTCODE Sentence </s>".
|
22 |
-
# For
|
23 |
# For a mapping of the original language and language code (3 character) to mBART-50 compatible language tokens consider the following dictionary:
|
24 |
# dictmap = {'acf': 'ar_AR', 'ara': 'cs_CZ', 'aze': 'it_IT', 'bzj': 'hi_IN', 'cab': 'az_AZ', 'ceb': 'et_EE', 'crs': 'fi_FI', 'deu': 'de_DE', 'djk': 'gu_IN', 'eng': 'en_XX', 'fra': 'fr_XX', 'gcf': 'ja_XX', 'gul': 'kk_KZ', 'hat': 'ko_KR', 'icr': 'lt_LT', 'jam': 'lv_LV', 'kea': 'my_MM', 'kri': 'ne_NP', 'ktu': 'nl_XX', 'mart1259': 'ro_RO', 'mfe': 'ru_RU', 'nep': 'si_LK', 'pap': 'tr_TR', 'pcm': 'vi_VN', 'por': 'pt_XX', 'sag': 'af_ZA', 'spa': 'es_XX', 'srm': 'bn_IN', 'srn': 'fa_IR', 'tpi': 'he_IL', 'zho': 'hr_HR', 'wes': 'zh_CN', 'trf': 'id_ID', 'svc': 'ka_GE', 'rcf': 'km_KH', 'pre': 'mk_MK', 'pov': 'ml_IN', 'mue': 'mn_MN', 'lou': 'mr_IN', 'gyn': 'pl_PL', 'gpe': 'ps_AF', 'gcr': 'sv_SE', 'fpe': 'sw_KE', 'fng': 'ta_IN', 'fab': 'te_IN', 'dcr': 'th_TH', 'cri': 'tl_XX', 'bzk': 'uk_UA', 'brc': 'ur_PK', 'bah': 'xh_ZA', 'aoa': 'gl_ES'}
|
25 |
# Note: We mapped languages to their language tokens manually. For example, we used en_XX, fr_XX, es_XX for English, French and Spanish as in the original mBART-50 model. But then we repurposed other tokens for Creoles.
|
|
|
19 |
# Or use model = MBartForConditionalGeneration.from_pretrained("n8rob/kreyol-mt-pubtrain")
|
20 |
|
21 |
# First tokenize the input and outputs. The format below is how the model was trained so the input should be "Sentence </s> SRCCODE". Similarly, the output should be "TGTCODE Sentence </s>".
|
22 |
+
# Example: For Saint Lucian Patois to English translation, we need to use language indicator tags: <2acf> and <2eng> where acf represents Saint Lucian Patois and eng represents English.
|
23 |
# For a mapping of the original language and language code (3 character) to mBART-50 compatible language tokens consider the following dictionary:
|
24 |
# dictmap = {'acf': 'ar_AR', 'ara': 'cs_CZ', 'aze': 'it_IT', 'bzj': 'hi_IN', 'cab': 'az_AZ', 'ceb': 'et_EE', 'crs': 'fi_FI', 'deu': 'de_DE', 'djk': 'gu_IN', 'eng': 'en_XX', 'fra': 'fr_XX', 'gcf': 'ja_XX', 'gul': 'kk_KZ', 'hat': 'ko_KR', 'icr': 'lt_LT', 'jam': 'lv_LV', 'kea': 'my_MM', 'kri': 'ne_NP', 'ktu': 'nl_XX', 'mart1259': 'ro_RO', 'mfe': 'ru_RU', 'nep': 'si_LK', 'pap': 'tr_TR', 'pcm': 'vi_VN', 'por': 'pt_XX', 'sag': 'af_ZA', 'spa': 'es_XX', 'srm': 'bn_IN', 'srn': 'fa_IR', 'tpi': 'he_IL', 'zho': 'hr_HR', 'wes': 'zh_CN', 'trf': 'id_ID', 'svc': 'ka_GE', 'rcf': 'km_KH', 'pre': 'mk_MK', 'pov': 'ml_IN', 'mue': 'mn_MN', 'lou': 'mr_IN', 'gyn': 'pl_PL', 'gpe': 'ps_AF', 'gcr': 'sv_SE', 'fpe': 'sw_KE', 'fng': 'ta_IN', 'fab': 'te_IN', 'dcr': 'th_TH', 'cri': 'tl_XX', 'bzk': 'uk_UA', 'brc': 'ur_PK', 'bah': 'xh_ZA', 'aoa': 'gl_ES'}
|
25 |
# Note: We mapped languages to their language tokens manually. For example, we used en_XX, fr_XX, es_XX for English, French and Spanish as in the original mBART-50 model. But then we repurposed other tokens for Creoles.
|