MaleeshaK commited on
Commit
7225712
·
verified ·
1 Parent(s): bc3cca2

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +51 -62
README.md CHANGED
@@ -1,62 +1,51 @@
1
- ---
2
- language:
3
- - sin
4
- - pli
5
- - san
6
- - en
7
- - ta
8
- - hi
9
- - bn
10
- - ar
11
- - fr
12
- - de
13
- license: cc-by-4.0
14
- tags:
15
- - language-identification
16
- - fasttext
17
- - continual-learning
18
- - leaf-surgery
19
- - sinhala
20
- - pali
21
- - sanskrit
22
- datasets:
23
- - script-langid/sinhala-pali-sanskrit-target
24
- metrics:
25
- - f1
26
- - accuracy
27
- ---
28
-
29
- # FastText Continual Leaf Surgery (11-Language Rehearsal)
30
-
31
- This model is a continual fine-tuning of Meta's `fastText LID-176` utilizing **Hierarchical Softmax Leaf Surgery**.
32
-
33
- ## Architecture & Innovation
34
- - **Base Architecture**: Meta `fastText LID-176` (100-dim dense subword embeddings with Huffman tree hierarchical softmax).
35
- - **Leaf Surgery**: Instead of retraining the classification head from scratch (which shuffles the Huffman tree and causes catastrophic forgetting of 176 pre-trained languages), the original hierarchical softmax binary decision paths are preserved. The Sinhala (`si`) leaf node is surgically split into an internal decision node branching into modern Sinhala and canonical Pali, with Sanskrit adaptation.
36
- - **Continual Rehearsal**: Trained on the 11-language uniform rehearsal buffer (`train_11lang_uniform.csv`) balancing the 3 target languages in Sinhala script with 8 global and regional anchor languages (English, Tamil, Hindi, Bengali, Arabic, French, German, and Sanskrit in Devanagari).
37
-
38
- ## Benchmark Performance
39
-
40
- | Benchmark | Macro F1 | Sinhala F1 | Pali F1 | Sanskrit F1 | Overall Accuracy |
41
- |---|:---:|:---:|:---:|:---:|:---:|
42
- | **WiLI-2018 (11-Lang)** | **0.9811** | 0.9766 | 0.9881 | 0.9895 | **98.00%** |
43
- | **CommonLID (11-Lang)** | **0.9486** | 0.9766 | 0.9881 | 0.9695 | **96.82%** |
44
- | **FLORES+ (11-Lang)** | **0.9395** | 0.9766 | 0.9881 | 0.9817 | **92.71%** |
45
-
46
- ## How to Load in Python
47
-
48
- ```python
49
- from data_pipeline.fasttext_continual.model import ContinualLID
50
-
51
- # Loads config.json, vocab.json, and weights.pt automatically from Hugging Face
52
- model = ContinualLID.from_pretrained("script-langid/fasttext-leaf-surgery-11lang")
53
-
54
- # Inference example:
55
- text = "නමෝ තස්ස භගවතෝ අරහතෝ සම්මා සම්බුද්ධස්ස"
56
- prediction = model.predict(text)
57
- print(prediction) # 'pi' (Pali)
58
- ```
59
-
60
- ## Repository & Research
61
- - **GitHub**: [Sinhala-Script-Language-Identification-LangID-for-Sinhala-Pali-and-Sanskrit](https://github.com/Maleesha-K/Sinhala-Script-Language-Identification-LangID-for-Sinhala-Pali-and-Sanskrit)
62
- - **Research**: University of Moratuwa, Department of Computer Science & Engineering.
 
1
+ ---
2
+ license: cc-by-nc-4.0
3
+ language:
4
+ - sin
5
+ - pli
6
+ - san
7
+ - en
8
+ - ta
9
+ - hi
10
+ - bn
11
+ - ar
12
+ - fr
13
+ - de
14
+ tags:
15
+ - language-identification
16
+ - fasttext
17
+ - continual-learning
18
+ - leaf-surgery
19
+ - table-3-multilingual-rehearsal
20
+ pipeline_tag: text-classification
21
+ base_model: facebook/fasttext-language-identification
22
+ ---
23
+
24
+ # fastText Continual Leaf Surgery: 11-Language Multilingual Rehearsal (Table 3)
25
+
26
+ This model represents our **Continual Learning (Leaf Surgery)** architecture trained with the 11-language balanced rehearsal buffer (Table 3 in the research paper):
27
+ > **"A Benchmark for Sinhala-Script Language Identification: Disambiguating Sinhala, Pali, and Sanskrit in Closed and Open World Contexts"**
28
+ > *University of Moratuwa, Department of Computer Science & Engineering*
29
+
30
+ ## 1. Architecture & Innovation
31
+ - **Hierarchical Softmax Leaf Surgery**: The Sinhala (`si`) leaf node in the official Facebook `lid.176.bin` Huffman tree was split into Sinhala and Pali branches.
32
+ - **Multilingual Rehearsal**: Fine-tuned on the balanced 11-language Aya dataset buffer (3 target languages in Sinhala script + 8 global/anchor languages: English, Tamil, Hindi, Bengali, Arabic, French, German, and Sanskrit Devanagari) to preserve cross-lingual representations.
33
+
34
+ ## 2. Benchmark Performance (11-Language Evaluation)
35
+ - **WiLI-2018 (Macro-F1):** **0.9811** (Accuracy: 98.00%)
36
+ - **CommonLID (Macro-F1):** **0.9486** (Accuracy: 96.82%)
37
+ - **FLORES+ (Macro-F1):** **0.9395** (Accuracy: 92.71%)
38
+
39
+ ## 3. How to Load and Run Inference in Python
40
+ ```python
41
+ from data_pipeline.fasttext_continual.model import ContinualLID
42
+
43
+ # Loads weights.pt, config.json, and vocab.json automatically from Hugging Face
44
+ model = ContinualLID.from_pretrained("script-langid/fasttext-leaf-surgery-11lang")
45
+
46
+ # Inference example:
47
+ text = "නමෝ තස්ස භගවතෝ අරහතෝ සම්මා සම්බුද්ධස්ස"
48
+ prediction, score = model.predict(text)
49
+ print(f"Language: {prediction}, Score: {score:.4f}")
50
+ # Output: Language: pi, Score: 0.99...
51
+ ```