VerifiedPrompts/cntxt-class-final
Viewer β’ Updated β’ 200k β’ 7
How to use VerifiedPrompts/CNTXT-Filter-Prompt-Opt with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-classification", model="VerifiedPrompts/CNTXT-Filter-Prompt-Opt") # Load model directly
from transformers import AutoTokenizer, AutoModelForSequenceClassification
tokenizer = AutoTokenizer.from_pretrained("VerifiedPrompts/CNTXT-Filter-Prompt-Opt")
model = AutoModelForSequenceClassification.from_pretrained("VerifiedPrompts/CNTXT-Filter-Prompt-Opt")CNTXT-Filter-Prompt-Opt is a lightweight, high-accuracy text classification model designed to evaluate the contextual completeness of user prompts submitted to LLMs.
It acts as a gatekeeper before generation, helping eliminate vague or spam-like input and ensuring only quality prompts proceed to LLM2.
distilbert-base-uncasedThis model is intended for:
The model classifies prompts into 3 categories:
| Label | Description |
|---|---|
has context |
Prompt is clear, actionable, and self-contained |
missing platform, audience, budget, goal |
Prompt lacks structural clarity |
Intent is unclear, Please input more context |
Vague or incoherent prompt |
distilbert-base-uncasedfp16 | Metric | Score |
|---|---|
| Accuracy | 1.0 |
| F1 (macro/micro/weighted) | 1.0 |
| Precision / Recall | 1.0 |
| Validation Loss | 0.0 |
The model generalizes extremely well on all validation samples.
from transformers import pipeline
classifier = pipeline("text-classification", model="VerifiedPrompts/CNTXT-Filter-Prompt-Opt")
prompt = "Write a business plan for a freelance app in Canada."
result = classifier(prompt)
print(result)
# [{'label': 'has context', 'score': 0.98}]