Beyond Subtokens: A Rich Character Embedding for Low-resource and Morphologically Complex Languages
Organizations: Computer Vision Group Friedrich Schiller University Jena
Abstract
Tokenization and sub-tokenization based models like word2vec, BERT and the GPTs are the state-of-the-art in natural language processing. Typically, these approaches have limitations with respect to their input representation. They fail to fully capture orthographic similarities and morphological variations, especially in highly inflected and under-resource languages. To mitigate this problem, we propose to computes word vectors directly from character strings, integrating both semantic and syntactic information. We denote this transformer-based approach Rich Character Embeddings (RCE). Furthermore, we propose a hybrid model that combines transformer and convolutional mechanisms. Both vector representations can be used as a drop-in replacement for dictionary- and subtoken-based word embeddings in existing model architectures. It has the potential to improve performance for both large context-based language models like BERT and small models like word2vec for under-resourced and morphologically rich languages. We evaluate our approach on various tasks like the SWAG, declension prediction for inflected languages, metaphor and chiasmus detection for various languages. Our experiments show that it outperforms traditional token-based approaches on limited data using OddOneOut and TopK metrics.
Figures & tables
| Category | Tokens |
|---|---|
| Base characters | a–z |
| Digits | 0–9 |
| Special symbols | ø , þ , ð , ł , ŋ , ° , ^ , ! , " , § , $ , % , & , / , ( , ) , = , ? , ` , ´ , + , * , ~ , # , ' , _ , . , : , , , ; , < , > , @ , € , { , [ , ] , } , … , „ , “ , ” , ‚ , ’ , — , » , « |
| Special word-level tokens | [BEG] (beginning of a word), [END] (end of a word), [UNK] (unknown character), [PAD] (padding token at the end of a word) |
| Special character-level tokens | Padding and unknown characters |
| Modifiers for diacritics | Acute Accent ( ´ ), Grave Accent ( ` ), Macron ( ¯ ), Tilde ( ~ ), Horn ( ˛ ), Diaeresis ( ¨ ), Ligature modifier, Uppercase modifier, Sharp S modifier ( ß ) with base character ’s’ |
| language | categories | total words | average words per category |
|---|---|---|---|
| Faroese | 8 | 161 | 20 |
| Latin | 9 | 158 | 18 |
| Uzbek | 9 | 141 | 16 |
| target language | training language | RCE | c2v | RCE+c2v | FastText |
|---|---|---|---|---|---|
| Faroese | Faroese | 0.26 | 0.20 | 0.25 | 0.21 |
| Faroese | Norwegian | 0.22 | 0.20 | 0.24 | 0.24 |
| Faroese | Icelandic | 0.24 | 0.22 | 0.26 | 0.22 |
| Latin | Latin | 0.23 | 0.25 | 0.27 | 0.25 |
| Latin | Italian | 0.16 | 0.26 | 0.24 | 0.15 |
| Uzbek | Uzbek | 0.20 | 0.25 | 0.25 | 0.20 |
| target language | training language | RCE | c2v | RCE+c2v | FastText |
|---|---|---|---|---|---|
| Faroese | Faroese | 0.13 | 0.12 | 0.29 | 0.08 |
| Faroese | Norwegian | 0.22 | 0.29 | 0.24 | 0.09 |
| Faroese | Icelandic | 0.11 | 0.14 | 0.16 | 0.09 |
| Latin | Latin | 0.25 | 0.60 | 0.30 | 0.10 |
| Latin | Italian | 0.18 | 0.35 | 0.31 | 0.08 |
| Uzbek | Uzbek | 0.17 | 0.36 | 0.39 | 0.10 |
| training language | RCE | c2v | RCE+c2v | FastText |
|---|---|---|---|---|
| Latin | ||||
| Italian |
| RCE | c2v | RCE+c2v | FastText | |
|---|---|---|---|---|
| all features | ||||
| only embedding |
| RCE | c2v | RCE+c2v | FastText |
|---|---|---|---|
| pretraining | task training | testing | WordPiece | RCE |
| en | en | en | 0.561 | 0.578 |
| de | de | de | 0.542 | 0.628 |
| fo | fo | fo | 0.279 | 0.265 |
| no | no | fo | 0.277 | 0.285 |
| no | fo | fo | 0.266 | 0.256 |
| is | is | fo | 0.244 | 0.280 |
Word Embeddings
Word embeddings map words or tokens to vectors that capture patterns of meaning, usage, and linguistic structure.
See all 40 papers