VerifiedPrompts commited on
Commit
62d5850
·
verified ·
1 Parent(s): c519d42

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +90 -18
README.md CHANGED
@@ -1,18 +1,90 @@
1
- 📘 Model Card: CNTXT-Filter-Prompt-Opt
2
- 🔍 Model Overview
3
- CNTXT-Filter-Prompt-Opt is a lightweight, high-accuracy text classification model designed to evaluate the contextual completeness of prompts submitted to large language models (LLMs). It serves as the first gatekeeper in a multi-stage moderation and optimization pipeline. Built on `distilbert-base-uncased`, it classifies prompts into three context categories, allowing or blocking them before LLM2 generation is triggered.
4
- 🎯 Intended Use
5
- This model is used as a real-time filter in AI-powered systems to:
- Block unclear or vague prompts
- Identify missing key information (e.g., platform, audience, budget)
- Allow only context-rich prompts to pass to downstream models (LLM2)
6
- 🔢 Labels & Meanings
7
- The model is trained to classify prompts into the following classes:
- `has context` — prompt is clear, actionable, and well-defined
- `missing platform, audience, budget, goal` — prompt lacks structural clarity
- `Intent is unclear, Please input more context` — prompt is vague or spam-like
8
- 📊 Training Details
9
- Trained on a curated dataset of 200,000 prompts using Hugging Face AutoTrain with LoRA disabled. Class balance and curriculum learning were applied: fully positive prompts first, followed by negative and vague examples.

Key parameters:
- Model: distilbert-base-uncased
- Max sequence length: 128
- Batch size: 8
- Epochs: 3
- Optimizer: AdamW
- Learning rate: 5e-5
- Mixed precision: FP16
- Accuracy: 100% (training + validation)
10
- Evaluation Metrics
11
- The model achieved perfect scores on the evaluation set:
- Accuracy: 1.0
- F1 Score (macro/micro/weighted): 1.0
- Precision & Recall: 1.0
This reflects perfect generalization within the prompt context classification task.
12
- ⚙️ How to Use
13
- Using the `transformers` library:
```python
from transformers import pipeline
classifier = pipeline("text-classification", model="VerifiedPrompts/CNTXT-Filter-Prompt-Opt")
result = classifier("Write an advertising plan for an eco product in Canada.")
print(result)
# → [{'label': 'has context', 'score': 0.97}]
```
14
- 🧱 Role in AI Pipeline
15
- This model should be deployed at the start of any user-to-AI interaction system. It works alongside:
- OpenAI’s Moderation API (for abuse/harm filtering)
- LLM2 (like GPT-3.5 or Mistral) which executes generation if context is valid
- Prompt optimizers, feedback systems, or analytics dashboards
16
- ⚖️ License & Ownership
17
- MIT License freely reusable for research, commercial, or operational deployment.
Developed and owned by VerifiedPrompts.
18
- 
🗓️ Last updated: May 27, 2025
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: mit
3
+ tags:
4
+ - text-classification
5
+ - prompt-powered systems to:
- Block unclear or vague prompts
- Identify missing key information (e.g., platform, audience, budget)
- Allow only context-rich prompts to pass to downstream models (LLM2)filtering
6
+ - moderation
7
+ The model is trained to classify prompts into the following classes:
 - `has context` — prompt is clear, actionable, and well-defined
- `missing platform, audience, budget, goal` — prompt lacks structural clarity
- `Intent is unclear, Please input more context` — prompt is vague or spam-likedistilbert
8
+ - transformers
9
+ datasets: fully positive prompts first, followed by negative and vague examples.

Key parameters:
- Model: distilbert-base-uncased
- Max sequence length: 128
- Batch size: 8
- Epochs: 3
- Optimizer: AdamW
- Learning rate: 5e-5
- Mixed precision: FP16
- Accuracy: 100% (training + validation)
10
+ - VerifiedPrompts/cntxt-class-final
11
+ language:
- Accuracy: 1.0
- F1 Score (macro/micro/weighted): 1.0
- Precision & Recall: 1.0
This reflects perfect generalization within the prompt context classification task.
12
+ - en
13
+ pipeline_tag:
```python
from transformers import pipeline
classifier = pipeline("text-classification", model="VerifiedPrompts/CNTXT-Filter-Prompt-Opt")
result = classifier("Write an advertising plan for an eco product in Canada.")
print(result)
# → [{'label': 'has context', 'score': 0.97}]
```
14
+ widget:
15
+ - text: "Write a LinkedIn post about eco-friendly tech system. It works alongside:
- OpenAI’s Moderation API (for Gen filtering)
-Z entrepreneurs.5 or Mistral) which executes generation if context is valid
- Prompt optimizers, feedback systems, or analytics dashboards"
16
+ example_title: Context-rich prompt
17
+ - text: "Write freely reusable for research, commercial, or operational deployment.
Developed and owned by VerifiedPrompts.something"
18
+ 
🗓️ Last updated example_title: Vague prompt
19
+ ---
20
+ # 📘 Model Card: CNTXT-Filter-Prompt-Opt
21
+
22
+ ## 🔍 Model Overview
23
+ **CNTXT-Filter-Prompt-Opt** is a lightweight, high-accuracy text classification model designed to evaluate the **contextual completeness of user prompts** submitted to LLMs.
24
+ It acts as a **gatekeeper** before generation, helping eliminate vague or spam-like input and ensuring only quality prompts proceed to LLM2.
25
+
26
+ - **Base model**: `distilbert-base-uncased`
27
+ - **Trained on**: 200k labeled prompts
28
+ - **Purpose**: Prompt validation, spam filtering, and context enforcement
29
+
30
+ ---
31
+
32
+ ## 🎯 Intended Use
33
+
34
+ This model is intended for:
35
+ - Pre-processing prompts before LLM2 generation
36
+ - Blocking unclear or context-poor requests
37
+ - Structuring user input pipelines in AI apps, bots, and assistants
38
+
39
+ ---
40
+
41
+ ## 🔢 Labels
42
+
43
+ The model classifies prompts into 3 categories:
44
+
45
+ | Label | Description |
46
+ |-------|-------------|
47
+ | `has context` | Prompt is clear, actionable, and self-contained |
48
+ | `missing platform, audience, budget, goal` | Prompt lacks structural clarity |
49
+ | `Intent is unclear, Please input more context` | Vague or incoherent prompt |
50
+
51
+ ---
52
+
53
+ ## 📊 Training Details
54
+
55
+ - **Model**: `distilbert-base-uncased`
56
+ - **Training method**: Hugging Face AutoTrain
57
+ - **Dataset size**: 200,000 prompts (curated, curriculum style)
58
+ - **Epochs**: 3
59
+ - **Batch size**: 8
60
+ - **Max seq length**: 128
61
+ - **Mixed Precision**: `fp16`
62
+ - **LoRA**: ❌ Disabled
63
+ - **Optimizer**: AdamW
64
+
65
+ ---
66
+
67
+ ## ✅ Evaluation
68
+
69
+ | Metric | Score |
70
+ |--------|-------|
71
+ | Accuracy | 1.0 |
72
+ | F1 (macro/micro/weighted) | 1.0 |
73
+ | Precision / Recall | 1.0 |
74
+ | Validation Loss | 0.0 |
75
+
76
+ The model generalizes extremely well on all validation samples.
77
+
78
+ ---
79
+
80
+ ## ⚙️ How to Use
81
+
82
+ ```python
83
+ from transformers import pipeline
84
+
85
+ classifier = pipeline("text-classification", model="VerifiedPrompts/CNTXT-Filter-Prompt-Opt")
86
+ prompt = "Write a business plan for a freelance app in Canada."
87
+ result = classifier(prompt)
88
+
89
+ print(result)
90
+ # [{'label': 'has context', 'score': 0.98}]