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

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +33 -15
README.md CHANGED
@@ -20,27 +20,45 @@ This is a fine-tuned **Language-Agnostic BERT Sentence Embedding (LaBSE)** model
20
  * **Base Architecture:** `sentence-transformers/LaBSE`
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
- ## Use Case
26
- 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, regardless of the language, to instantly categorize the ticket for the correct banking department.
27
 
28
- ## Performance & Ablation Findings
29
- During our extensive ablation studies, this Transformer model was evaluated against traditional Machine Learning algorithms (like Linear SVMs).
 
 
 
 
 
30
 
31
- * **Digital/Clean Text:** This LaBSE model achieves state-of-the-art semantic understanding on clean, typed digital text.
32
- * **OCR Noisy Text:** When exposed to high Character Error Rates (CER) from Tesseract OCR (e.g., extracting text from blurry mobile screenshots), this model's F1-score drops to ~49.70% because Transformers are highly sensitive to sub-word tokenization destruction.
33
- * **Architecture Decision:** Because of this sensitivity, the Swift backend dynamically routes **OCR-extracted text** to a robust Linear SVM, while routing **clean digital text** to this LaBSE model.
34
 
35
- ## How to use in Python
 
36
 
37
- You can easily use this model via the `transformers` pipeline:
 
 
 
 
 
 
 
 
 
 
 
 
 
38
 
39
  ```python
40
- from transformers import pipeline
41
 
42
- classifier = pipeline("text-classification", model="Swift-Support/labse-intent-1.0")
 
43
 
44
- result = classifier("I lost my credit card yesterday, please help me cancel it")
45
- print(result)
46
- # Output: [{'label': 'Card payment declined', 'score': 0.98}]
 
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())