Instructions to use Upadhyee/swar-nlu-gemma3-4b-lora with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use Upadhyee/swar-nlu-gemma3-4b-lora with PEFT:
Task type is invalid.
- Notebooks
- Google Colab
- Kaggle
SWAR-NLU β Gemma 3 4B LoRA Adapters
SWAR-NLU is a multilingual Natural Language Understanding (NLU) system built on Google Gemma 3 4B Instruct and fine-tuned using Low-Rank Adaptation (LoRA) through PEFT.
The project focuses on multilingual intent classification and slot filling across Indian languages and evaluates how training data size and language holdout affect NLU performance.
This Hugging Face repository contains the trained LoRA adapters and the tokenizer artifacts required to load them.
Important: These files are LoRA adapters, not standalone copies of Gemma 3 4B. The original base model is required to use these adapters.
Model Details
| Property | Value |
|---|---|
| Base model | google/gemma-3-4b-it |
| Fine-tuning | LoRA |
| Framework | Hugging Face Transformers + PEFT |
| Model type | Causal Language Model |
| Task | Multilingual NLU |
| Tasks | Intent classification + slot filling |
| Languages | Bengali, Hindi, Kannada, Malayalam, Tamil, Telugu |
| Adapter format | Safetensors |
| Base model parameters | Gemma 3 4B |
| Adapter size | ~114 MiB per adapter |
The adapters were trained using parameter-efficient fine-tuning rather than updating the complete Gemma model.
Available Adapters
The repository contains two groups of experiments.
1. Training-Size Experiments
These adapters investigate the effect of increasing the amount of training data.
| Adapter | Training Data |
|---|---|
r3k |
3,000 examples |
r9k |
9,000 examples |
r18k |
18,000 examples |
r3k
LoRA adapter trained using approximately 3,000 training examples.
r9k
LoRA adapter trained using approximately 9,000 training examples.
r18k
LoRA adapter trained using approximately 18,000 training examples.
2. Leave-One-Language-Out Experiments
The leave-one-language-out (LOO) experiments evaluate cross-lingual generalization by holding one language out of training.
| Adapter | Held-Out Language |
|---|---|
loo_bn-BD |
Bengali |
loo_hi-IN |
Hindi |
loo_kn-IN |
Kannada |
loo_ml-IN |
Malayalam |
loo_ta-IN |
Tamil |
loo_te-IN |
Telugu |
For example, loo_ml-IN represents the experiment where Malayalam
is the held-out language.
These adapters are intended to support analysis of how well the model generalizes to a language that was not included in the corresponding training setup.
Languages
The project covers the following Indian languages:
| Language | Locale |
|---|---|
| Bengali | bn-BD |
| Hindi | hi-IN |
| Kannada | kn-IN |
| Malayalam | ml-IN |
| Tamil | ta-IN |
| Telugu | te-IN |
Evaluation
The trained adapters are evaluated for multilingual NLU performance.
The evaluation pipeline reports the following metrics:
- Intent Accuracy
- Intent Macro F1
- Slot Micro F1
- Slot Precision
- Slot Recall
- Slot Type F1
- Exact Match
- JSON Validity
The detailed evaluation outputs are maintained separately in the SWAR-NLU source repository.
The Hugging Face repository primarily provides the trained model artifacts required for reproducing inference with the adapters.
Repository Structure
swar-nlu-gemma3-4b-lora/
β
βββ r3k/
β βββ adapter_config.json
β βββ adapter_model.safetensors
β βββ tokenizer artifacts
β
βββ r9k/
β βββ adapter_config.json
β βββ adapter_model.safetensors
β βββ tokenizer artifacts
β
βββ r18k/
β βββ adapter_config.json
β βββ adapter_model.safetensors
β βββ tokenizer artifacts
β
βββ loo_bn-BD/
β βββ adapter_config.json
β βββ adapter_model.safetensors
β βββ tokenizer artifacts
β
βββ loo_hi-IN/
β βββ adapter_config.json
β βββ adapter_model.safetensors
β βββ tokenizer artifacts
β
βββ loo_kn-IN/
β βββ adapter_config.json
β βββ adapter_model.safetensors
β βββ tokenizer artifacts
β
βββ loo_ml-IN/
β βββ adapter_config.json
β βββ adapter_model.safetensors
β βββ tokenizer artifacts
β
βββ loo_ta-IN/
β βββ adapter_config.json
β βββ adapter_model.safetensors
β βββ tokenizer artifacts
β
βββ loo_te-IN/
βββ adapter_config.json
βββ adapter_model.safetensors
βββ tokenizer artifacts
- Downloads last month
- -