Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Language names of Languages supported by Fasttext

I am trying to find out the names of languages supported by Fasttext's LID tool, given these language codes listed here:

af als am an ar arz as ast av az azb ba bar bcl be bg bh bn bo bpy br bs bxr ca cbk ce ceb ckb co cs cv cy da de diq dsb dty dv el eml en eo es et eu fa fi fr frr fy ga gd gl gn gom gu gv he hi hif hr hsb ht hu hy ia id ie ilo io is it ja jbo jv ka kk km kn ko krc ku kv kw ky la lb lez li lmo lo lrc lt lv mai mg mhr min mk ml mn mr mrj ms mt mwl my myv mzn nah nap nds ne new nl nn no oc or os pa pam pfl pl pms pnb ps pt qu rm ro ru rue sa sah sc scn sco sd sh si sk sl so sq sr su sv sw ta te tg th tk tl tr tt tyv ug uk ur uz vec vep vi vls vo wa war wuu xal xmf yi yo yue zh

I tried to map the ISO codes to each language, but it seems non-standard, either using ISO-639-1 or ISO-639-3. Does anyone have a list of language names for these codes, or know how to find them?
Wikipedia's list does not cover all of them either, so a manual mapping too did not help.

UPDATE: Opened an issue on GitHub.

like image 253
Abhinav Sukumar Rao Avatar asked Sep 05 '25 01:09

Abhinav Sukumar Rao


1 Answers

Most codes I found in Wikipedia's list, but some of them I found on subpage ISO 639 macrolanguage

But using Google to find bpy I found page ISO 639 Code Tables and probably there are all codes.

There is even page Download and there is file with codes iso-639-3.tab (similar to .csv)

Using this file and pandas (function read_csv with tab as separator) I wrote this script

odes = 'af als am an ar arz as ast av az azb ba bar bcl be bg bh bn bo bpy br bs bxr ca cbk ce ceb ckb co cs cv cy da de diq dsb dty dv el eml en eo es et eu fa fi fr frr fy ga gd gl gn gom gu gv he hi hif hr hsb ht hu hy ia id ie ilo io is it ja jbo jv ka kk km kn ko krc ku kv kw ky la lb lez li lmo lo lrc lt lv mai mg mhr min mk ml mn mr mrj ms mt mwl my myv mzn nah nap nds ne new nl nn no oc or os pa pam pfl pl pms pnb ps pt qu rm ro ru rue sa sah sc scn sco sd sh si sk sl so sq sr su sv sw ta te tg th tk tl tr tt tyv ug uk ur uz vec vep vi vls vo wa war wuu xal xmf yi yo yue zh'
codes = codes.split(' ')

import pandas as pd

df = pd.read_csv('/home/furas/iso-639-3.tab', sep='\t')

print(df)

for code in codes:
    name = df[ (df['Id'].str.strip() == code) | (df['Part1'].str.strip() == code) ]
    
    if not name.empty:
        print(code, name['Ref_Name'].iloc[0])
    
    #if name.empty:
    #    print('unknown:', code)

And it gives me almost all languages - except bh, eml, nah.
You can see it if you use code with if name.empty:


EDIT:

As @tripleee mentioned in a comment:

  • bh is deprecated code for Bihari: https://en.wikipedia.org/wiki/Bihari_languages

  • eml is obsolete code for Emilian-Romagnol: https://en.wikipedia.org/wiki/Emilian-Romagnol_language

  • nah is the ISO 639-2 code for Nahuatl: https://en.wikipedia.org/wiki/Nahuatl

like image 189
furas Avatar answered Sep 06 '25 23:09

furas