Update README.md
Browse files
README.md
CHANGED
|
@@ -17,48 +17,38 @@ tags:
|
|
| 17 |
This is a fine-tuned **Language-Agnostic BERT Sentence Embedding (LaBSE)** model designed for trilingual intent classification in the banking and financial support domain. It was developed as part of the **Swift** Support Ticket Classification project.
|
| 18 |
|
| 19 |
## Model Details
|
| 20 |
-
* **Base Architecture:** `sentence-transformers/LaBSE`
|
| 21 |
* **Task:** Text Classification (Intent Recognition)
|
| 22 |
* **Number of Classes:** 77 (Derived from the BANKING77 taxonomy)
|
|
|
|
| 23 |
|
| 24 |
-
##
|
| 25 |
-
|
| 26 |
|
| 27 |
-
|
| 28 |
-
|---|---|---|
|
| 29 |
-
| **English** | Latin | *"I lost my credit card yesterday"* |
|
| 30 |
-
| **Sinhala** | Sinhala | *"මගේ කාඩ් එක නැතිවුනා"* |
|
| 31 |
-
| **Singlish** | Latin (Code-mixed) | *"mage card eka nathi wela"* |
|
| 32 |
-
| **Tamil** | Tamil | *"என் கார்டு தொலைந்துவிட்டது"* |
|
| 33 |
-
| **Tanglish** | Latin (Code-mixed) | *"en card tholainthu vittathu"* |
|
| 34 |
|
| 35 |
-
|
| 36 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 37 |
|
| 38 |
-
|
| 39 |
-
|
|
|
|
| 40 |
|
| 41 |
-
|
| 42 |
|
| 43 |
-
|
| 44 |
-
|---|---|---|---|
|
| 45 |
-
| `clean` | 49.70% | 31.17% | **94.15%** |
|
| 46 |
-
| `blur` | 39.56% | 30.74% | **45.32%** |
|
| 47 |
-
| `rotation` | 48.29% | 26.58% | **69.30%** |
|
| 48 |
-
| `low-resolution` | 30.05% | 25.47% | **30.36%** |
|
| 49 |
-
| **OVERALL** | 34.18% | 23.42% | **35.37%** |
|
| 50 |
-
|
| 51 |
-
**Conclusion:**
|
| 52 |
-
Transformers like LaBSE are highly sensitive to sub-word tokenization destruction caused by OCR typos. Because of this architectural sensitivity, the Swift backend dynamically routes **OCR-extracted text** to a robust Linear SVM (which proved to be 94.15% resilient on clean OCR), while routing **clean typed digital text** to this LaBSE model to leverage its superior deep semantic understanding.
|
| 53 |
-
|
| 54 |
-
## How to use via Serverless API
|
| 55 |
|
| 56 |
```python
|
| 57 |
-
import
|
| 58 |
|
| 59 |
-
|
| 60 |
-
headers = {"Authorization": "Bearer YOUR_HF_TOKEN"}
|
| 61 |
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
|
|
|
| 17 |
This is a fine-tuned **Language-Agnostic BERT Sentence Embedding (LaBSE)** model designed for trilingual intent classification in the banking and financial support domain. It was developed as part of the **Swift** Support Ticket Classification project.
|
| 18 |
|
| 19 |
## Model Details
|
| 20 |
+
* **Base Architecture:** `sentence-transformers/LaBSE` (501k Vocabulary)
|
| 21 |
* **Task:** Text Classification (Intent Recognition)
|
| 22 |
* **Number of Classes:** 77 (Derived from the BANKING77 taxonomy)
|
| 23 |
+
* **Supported Languages:** English, Sinhala, Tamil, Singlish (Code-mixed), and Tanglish (Code-mixed).
|
| 24 |
|
| 25 |
+
## Evaluation & Benchmark Results
|
| 26 |
+
During the architectural ablation phase, this model was strictly evaluated on a held-out test set against classical ML algorithms, Indic Specialists (MuRIL & IndicBERT), and XLM-RoBERTa.
|
| 27 |
|
| 28 |
+
The metric used is **Macro-F1** across all 77 intent classes.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 29 |
|
| 30 |
+
| Language Track | Best Classical ML | MuRIL | IndicBERT | XLM-RoBERTa | **LaBSE (This Model)** |
|
| 31 |
+
|---|---:|---:|---:|---:|---:|
|
| 32 |
+
| **English** | 90.98% | — | — | 93.88% | **94.13%** |
|
| 33 |
+
| **Sinhala** | 83.08% | — | — | 92.42% | **92.95%** |
|
| 34 |
+
| **Singlish** (Romanized) | 86.49% | — | — | 90.03% | **90.65%** |
|
| 35 |
+
| **Tamil** | 86.35% | 66.01% | 89.81% | 91.74% | **93.27%** |
|
| 36 |
+
| **Tanglish** (Romanized) | 61.05% | 57.62% | 61.25% | **72.04%** | 70.57% |
|
| 37 |
+
| **ALL (Pooled)** | 83.18% | 62.10% | 76.24% | 88.29% | **88.54%** |
|
| 38 |
|
| 39 |
+
**Key Findings:**
|
| 40 |
+
1. **LaBSE is the Intent Champion:** Achieving **88.54% Macro-F1** on the pooled track, it outperformed the classical baseline by +5.36pp.
|
| 41 |
+
2. **Specialists failed on Code-Mixed Data:** Indic specialists like MuRIL and IndicBERT failed outright on the pooled and code-mixed tracks because their smaller vocabularies couldn't handle heavy romanization or English slang, proving that massive multilingual coverage (LaBSE's 501k vocab) is required for real-world South Asian support tickets.
|
| 42 |
|
| 43 |
+
## How to use in Python
|
| 44 |
|
| 45 |
+
You can easily use this model via the `transformers` pipeline:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 46 |
|
| 47 |
```python
|
| 48 |
+
from transformers import pipeline
|
| 49 |
|
| 50 |
+
classifier = pipeline("text-classification", model="Swift-Support/labse-intent-1.0")
|
|
|
|
| 51 |
|
| 52 |
+
result = classifier("I lost my credit card yesterday, please help me cancel it")
|
| 53 |
+
print(result)
|
| 54 |
+
# Output: [{'label': 'Card payment declined', 'score': 0.98}]
|