shazan18 commited on
Commit
90c0d69
·
verified ·
1 Parent(s): 3985a3d

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +23 -33
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
- ## Supported Languages & Scripts
25
- This model has been robustly fine-tuned to handle both native scripts and Romanized (code-mixed) phonetic typing, which is highly prevalent in South Asian digital communication.
26
 
27
- | Language | Script | Example Input |
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
- ## Use Case & Architecture
36
- This model is intended to be used as the **Digital Text Router** in a hybrid multimodal pipeline. When a user submits a typed text ticket (without an image/screenshot), this model deeply analyzes the semantic context of the text to instantly categorize the ticket for the correct banking department.
 
 
 
 
 
 
37
 
38
- ## Evaluation & OCR Ablation Results
39
- During our ablation studies, this Transformer model was evaluated against traditional Machine Learning algorithms (Linear SVMs) to determine its robustness to OCR-induced Character Error Rates (CER).
 
40
 
41
- The F1-scores below represent how well the models retain intent-classification accuracy when forced to read noisy OCR text (Tesseract) extracted from varying image qualities, compared to clean ground-truth text.
42
 
43
- | Image Quality Condition | LaBSE Raw OCR vs Clean | LaBSE+SpellCheck vs Clean | SVM Raw OCR vs Clean |
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 requests
58
 
59
- API_URL = "https://api-inference.huggingface.co/models/Swift-Support/labse-intent-1.0"
60
- headers = {"Authorization": "Bearer YOUR_HF_TOKEN"}
61
 
62
- # Sending a Singlish code-mixed ticket
63
- response = requests.post(API_URL, headers=headers, json={"inputs": "mage card eka nathi wela"})
64
- print(response.json())
 
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}]