Update README.md
Browse files12345---license: otherlicense_name: link-attributionlicense_link: https://dejanmarketing.com/link-attribution/---12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970---license: otherlicense_name: link-attributionlicense_link: https://dejanmarketing.com/link-attribution/language:- enmetrics:- accuracy- f1- precision- recallbase_model: microsoft/deberta-v3-largepipeline_tag: text-classificationtags:- grounding- retrieval- LLM-enhancement- DejanAI---[](https://dejan.ai/blog/grounding-classifier/)## Prompt Grounding Classifier — DeBERTa v3 Large (Fine-Tuned)This model predicts whether a natural language prompt **requires grounding** in external sources such as search, database, or retrieval-augmented generation (RAG).It was fine-tuned from [microsoft/deberta-v3-large](https://huggingface.co/microsoft/deberta-v3-large) using a binary label format (`1 = requires grounding`, `0 = self-contained`).### Why this mattersRouting decisions matter. This classifier acts as a gatekeeper for LLM pipelines by predicting whether a prompt should trigger external retrieval. It optimizes performance, reduces latency, and avoids unnecessary API calls.---## Model Details- 🧠 **Architecture**: DeBERTa v3 Large- ⚙️ **Training**: Full fine-tuning (no PEFT)- 🧪 **Batch size**: 24 (with accumulation)- 🔁 **Scheduler**: Cosine learning rate decay with warmup- 📉 **Dropout adjusted**: 0.1 for attention and hidden layers- 📦 **Final checkpoint size**: ~1.7 GB---## Example Predictions| Prompt | Grounding | Confidence ||------------------------------------------------------|-----------|------------|| What’s the exchange rate for USD to Yen right now? | 1 | 0.999 || Tell me a bedtime story about a robot and a dragon. | 0 | 0.996 || Who is the current CEO of Microsoft? | 1 | 0.998 |---## How to Use```pythonfrom transformers import AutoTokenizer, AutoModelForSequenceClassificationimport torch.nn.functional as Fmodel = AutoModelForSequenceClassification.from_pretrained("dejan/deberta-grounding-classifier")tokenizer = AutoTokenizer.from_pretrained("dejan/deberta-grounding-classifier")prompt = "What time is the next train from Tokyo to Osaka?"inputs = tokenizer(prompt, return_tensors="pt")outputs = model(**inputs).logitsprobs = F.softmax(outputs, dim=-1)label = probs.argmax().item()confidence = probs[0][label].item()
README.md+70-5