Text Classification
Adapters
Safetensors
English
distilbert
hopjetair commited on
Commit
d5eddd7
·
verified ·
1 Parent(s): 1f5ea1f

Create README.md

Browse files
Files changed (1) hide show
  1. README.md +30 -0
README.md ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # DistilBERT with LoRA for Intent Recognition
2
+
3
+ This is a parameter-efficient fine-tuned version of `distilbert-base-uncased` using the LoRA technique via [PEFT](https://github.com/huggingface/peft). The model was trained for intent recognition using a custom dataset.
4
+
5
+ ## 🧾 Model Details
6
+ - Base model: `distilbert-base-uncased`
7
+ - Fine-tuning method: [LoRA (Low-Rank Adaptation)](https://arxiv.org/abs/2106.09685) using 🤗 PEFT
8
+ - Task: Intent Recognition (Text Classification)
9
+
10
+ ## 🧠 Intended Use
11
+ You can use this model to classify user intents in applications like chatbots, virtual assistants, or voice-based interfaces.
12
+
13
+ ## 📥 How to Use
14
+
15
+ ```python
16
+ from transformers import AutoTokenizer, AutoModelForSequenceClassification
17
+ from peft import PeftModel
18
+
19
+ # Load tokenizer and base model
20
+ tokenizer = AutoTokenizer.from_pretrained("hopjetair/intent")
21
+ base_model = AutoModelForSequenceClassification.from_pretrained("distilbert-base-uncased",num_labels=33)
22
+
23
+ # Load LoRA adapter
24
+ model = PeftModel.from_pretrained(base_model, "hopjetair/intent")
25
+
26
+ # Inference
27
+ text = "Book me a flight to New York"
28
+ inputs = tokenizer(text, return_tensors="pt")
29
+ outputs = model(**inputs)
30
+ intent_class = outputs.logits.argmax(dim=1).item()