mmBERT-32K Intent Classifier (LoRA Adapter)

LoRA adapter for intent classification based on mmBERT-32K-YaRN (32K context, multilingual).

Model Details

  • Base Model: llm-semantic-router/mmbert-32k-yarn
  • Training Method: LoRA (Low-Rank Adaptation)
  • LoRA Rank: 32
  • LoRA Alpha: 64
  • Trainable Parameters: 6.8M (2.2% of base model)
  • Adapter Size: 27 MB

Training Data

Categories (14 classes)

biology, business, chemistry, computer science, economics, engineering, health, history, law, math, other, philosophy, physics, psychology

Performance

Metric Score
Test Accuracy 80.0%
Adapter Size 27 MB

Usage

from transformers import AutoTokenizer, AutoModelForSequenceClassification
from peft import PeftModel

# Load base model and LoRA adapter
base_model = AutoModelForSequenceClassification.from_pretrained(
    "llm-semantic-router/mmbert-32k-yarn", num_labels=14
)
model = PeftModel.from_pretrained(base_model, "llm-semantic-router/mmbert32k-intent-classifier-lora")
tokenizer = AutoTokenizer.from_pretrained("llm-semantic-router/mmbert32k-intent-classifier-lora")

# Inference
inputs = tokenizer("How do neural networks learn?", return_tensors="pt")
outputs = model(**inputs)
predicted_class = outputs.logits.argmax().item()

Training Configuration

  • Epochs: 5
  • Batch Size: 16
  • Learning Rate: 2e-4
  • Weight Decay: 0.1
  • Optimizer: AdamW with cosine LR scheduler
Downloads last month
155
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for llm-semantic-router/mmbert32k-intent-classifier-lora

Adapter
(4)
this model

Dataset used to train llm-semantic-router/mmbert32k-intent-classifier-lora

Collection including llm-semantic-router/mmbert32k-intent-classifier-lora