| --- |
| license: cc-by-sa-3.0 |
| language: |
| - mul |
| tags: |
| - linguistics |
| - multilingual |
| - lexicon |
| - translation |
| - etymology |
| - phonology |
| - typology |
| pretty_name: LangDex |
| size_categories: |
| - 100M<n<1B |
| --- |
| |
| # LangDex |
|
|
| LangDex is a unified multilingual lexical dataset that integrates seven open linguistic resources under a common relational schema. All tables are keyed on two identifiers: a Glottolog language code (glottocode) and a PanLex concept identifier. The dataset covers approximately 5,700 languages and is distributed as Parquet tables and a prebuilt DuckDB database. |
|
|
| ## Try it |
|
|
| - Notebook in this repository: [`getting-started.ipynb`](getting-started.ipynb), which runs in Colab or Jupyter and covers translation, word profiles, etymology, phonology, and cognate sets. |
| - On Kaggle: https://www.kaggle.com/code/alekoi/langdex-getting-started |
|
|
| ## Motivation |
|
|
| Open linguistic resources are maintained as independent projects with incompatible identifier systems and file formats. Genealogical classification (Glottolog), cross-lingual lexical data (PanLex), dictionary content (Wiktionary), phoneme inventories (PHOIBLE), and typological features (WALS) are each authoritative in their domain but do not share a key or a schema. Answering a question that spans two of them requires acquiring both resources, reconciling their language identifiers, and performing a large join. LangDex performs this integration once and distributes the result. |
|
|
| A second motivation concerns the structure of bilingual lexical data. Most bilingual resources are organized around a high-resource pivot, in practice English, so a correspondence between two other languages is mediated by an English entry. LangDex instead represents translation through a shared, language-independent concept identifier. Two lexemes in any two languages that denote the same PanLex meaning are linked directly, so lexical correspondences can be retrieved for arbitrary language pairs without an intervening pivot language. |
|
|
| ## Construction |
|
|
| The integration is keyed on two identifiers. The glottocode identifies a language; the concept identifier is a PanLex meaning, a language-independent sense to which lexemes in different languages are attached. |
|
|
| Language identifiers are reconciled through a crosswalk relating glottocode, ISO 639-3, PanLex language variety, and Wiktionary language code. ISO 639-1 codes used by Wiktionary for major languages are mapped to ISO 639-3 using the SIL ISO 639-3 code tables before being resolved to glottocodes. Lexemes and their concept links are derived from PanLex; part of speech, pronunciation, and definitions are derived from Wiktionary via wiktextract; etymology, phoneme inventories, typological features, and cognate sets are taken from the Etymology Atlas, a Kaggle dataset that aggregates etymology-db, PHOIBLE, WALS, and Lexibank. |
|
|
| ### Data sources |
|
|
| Fetched directly: |
|
|
| | source | contribution | license | |
| |---|---|---| |
| | PanLex | cross-lingual concepts and translations | CC0 1.0 | |
| | Wiktionary (via wiktextract) | definitions, part of speech, IPA | CC BY-SA 3.0 | |
| | Glottolog | language classification, geography | CC BY 4.0 | |
|
|
| The following tables are obtained from the Etymology Atlas (Luke Steuber; CC BY-SA 3.0; Zenodo 10.5281/zenodo.18321479), a Kaggle dataset that aggregates these upstream sources: |
|
|
| | source | contribution | license | |
| |---|---|---| |
| | etymology-db | etymological relations | CC BY-SA | |
| | PHOIBLE | phoneme inventories | CC BY 4.0 | |
| | WALS | typological features | CC BY 4.0 | |
| | Lexibank (IE-CoR) | expert cognate sets | CC BY 4.0 | |
|
|
| ## Schema |
|
|
| | table | rows | description | |
| |---|---|---| |
| | `languoids` | 8,618 | languages from Glottolog with family, macroarea, and coordinates | |
| | `crosswalk` | 10,643 | mapping between glottocode, ISO 639-3, PanLex, and Wiktionary identifiers | |
| | `concepts` | 28,566,389 | PanLex meanings, with an English gloss where available | |
| | `lexemes` | 77,729,645 | word forms attached to a language and a concept (PanLex) | |
| | `lexeme_concept` | 79,088,196 | lexeme-to-concept links; the cross-lingual translation graph | |
| | `kaikki_lexemes` | 10,757,863 | Wiktionary word forms with part of speech and IPA; 91% carry a glottocode; `ipa_norm` gives the IPA with `/ /` and `[ ]` delimiters stripped | |
| | `senses` | 10,479,635 | definitions | |
| | `etymology` | 4,173,462 | typed etymological edges (borrowed, inherited, cognate, derived), with resolved `glottocode1/2` + `family1/2` (~80% of edges) and a deterministic `coarse_label` (formation / inherited / cognate / contact / unresolved) with `coarse_method` and `coarse_confidence` | |
| | `phonology` | 105,484 | phoneme inventory entries (PHOIBLE) | |
| | `typology` | 76,475 | typological feature values (WALS) | |
| | `cognate_sets` | 4,981 | expert cognate sets (Lexibank) | |
|
|
| Translation coverage extends to approximately 5,700 languages through PanLex; definitions and IPA are available for approximately 5,000 languages through Wiktionary. |
|
|
| ## Dictionaries |
|
|
| Digitized public-domain and openly-licensed scanned dictionaries for under-resourced languages live in a **separate companion dataset**, [Asakiri/langdex-dictionaries](https://huggingface.co/datasets/Asakiri/langdex-dictionaries) — kept apart so their mixed per-dictionary licensing never complicates this dataset's clean CC BY-SA core. The `open`-scope dictionaries there link into LangDex's shared concept hub. |
|
|
| ## Access |
|
|
| The dataset is distributed as Parquet tables and a prebuilt `langdex.duckdb`. The Parquet tables can be read with DuckDB, pandas, or Polars, including remotely over `hf://` without a full download. |
|
|
| Concept-mediated translation between two languages, without an English pivot: |
|
|
| ```python |
| import duckdb |
| con = duckdb.connect("langdex.duckdb") |
| |
| con.execute(""" |
| WITH src AS ( |
| SELECT DISTINCT lc.concept_id |
| FROM lexemes le |
| JOIN languoids lg ON lg.glottocode = le.glottocode AND lg.iso639_3 = 'spa' |
| JOIN lexeme_concept lc ON lc.lexeme_id = le.lexeme_id |
| WHERE le.lemma = 'agua' |
| ) |
| SELECT l.name, string_agg(DISTINCT le.lemma, ', ') |
| FROM src |
| JOIN lexeme_concept lc USING (concept_id) |
| JOIN lexemes le ON le.lexeme_id = lc.lexeme_id |
| JOIN languoids l ON l.glottocode = le.glottocode |
| WHERE l.iso639_3 IN ('jpn', 'kor') |
| GROUP BY 1 |
| """).fetchall() |
| ``` |
|
|
| Retrieval of part of speech, pronunciation, and definitions for a form: |
|
|
| ```python |
| con.execute(""" |
| SELECT k.pos, k.ipa, s.definition |
| FROM kaikki_lexemes k |
| JOIN senses s ON s.lexeme_id = k.lexeme_id |
| WHERE k.lang_code = 'en' AND k.lemma = 'free' |
| """).fetchall() |
| ``` |
|
|
| ## Applications |
|
|
| The dataset supports cross-lingual lexical retrieval for arbitrary language pairs, including low-resource pairs without an existing bilingual dictionary; construction and evaluation of multilingual word embeddings from the `lexeme_concept` graph; comparative and historical work combining etymology, cognate sets, and phoneme inventories; typological analysis joining WALS features to lexical and phonological data; and lexicographic or documentation tools requiring pronunciation, part of speech, definitions, and translations under a single schema. |
|
|
| ## Limitations |
|
|
| - PanLex meanings vary in granularity, and some are broad, so a lexeme may link to a cluster of related senses. Restricting a query to a single concept identifier yields a narrower correspondence set. |
| - Approximately 9% of Wiktionary lexemes use codes for macrolanguages (for example Chinese `zh`, Arabic `ar`) that have no single language-level glottocode. These rows retain a `lang_code` but no glottocode. |
| - Some PanLex translation links are transitively inferred, and some etymological relations are uncertain. The `confidence` fields, cognate sets, and phoneme inventories can be used to filter. |
|
|
| ## License |
|
|
| Released under CC BY-SA 3.0. The combined dataset inherits ShareAlike terms from sources that carry them (Wiktionary, the Etymology Atlas, etymology-db); PanLex is CC0 and the remaining sources are CC BY 4.0. Per-source licenses are listed above and in the LICENSE file. Attribution to the upstream projects and to the Etymology Atlas is required. |
|
|