Text Classification
Scikit-learn
Joblib
Safetensors
promptguard
privacy
dlp
korean
roberta
logistic-regression
Instructions to use OASecure/promptguard-context-classifier with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Scikit-learn
How to use OASecure/promptguard-context-classifier with Scikit-learn:
from huggingface_hub import hf_hub_download import joblib model = joblib.load( hf_hub_download("OASecure/promptguard-context-classifier", "sklearn_model.joblib") ) # only load pickle files from sources you trust # read more about it here https://skops.readthedocs.io/en/stable/persistence.html - Notebooks
- Google Colab
- Kaggle
Add runtime artifact inventory README
Browse files- models/README.md +24 -0
models/README.md
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# PromptGuard Context Runtime Artifacts
|
| 2 |
+
|
| 3 |
+
This directory is the PromptGuard context classifier runtime package.
|
| 4 |
+
|
| 5 |
+
It is not a single Hugging Face Transformer model directory. PromptGuard loads the source-of-truth manifest first, then resolves the LR and verifier paths from that manifest.
|
| 6 |
+
|
| 7 |
+
## Required Files
|
| 8 |
+
|
| 9 |
+
| Purpose | File |
|
| 10 |
+
| --- | --- |
|
| 11 |
+
| Runtime manifest | `context_lr_roberta_active_best_f1_manifest.json` |
|
| 12 |
+
| Target labels | `context_target_labels.json` |
|
| 13 |
+
| Verifier label definitions | `context_label_definitions_verifier_compact_v2.json` |
|
| 14 |
+
| LR candidate generator | `context_with_patch_v287_lr_c4_dev_classifier.joblib` |
|
| 15 |
+
| Verifier model directory | `context_verifier_klue_roberta_base_lrmined_v287_global002_compactv2_lpft_focal_1p2ep/` |
|
| 16 |
+
|
| 17 |
+
## Model Roles
|
| 18 |
+
|
| 19 |
+
- The LR file is a scikit-learn One-vs-Rest Logistic Regression classifier. It consumes Qwen embedding vectors and proposes candidate context-risk labels.
|
| 20 |
+
- The verifier directory is a fine-tuned `klue/roberta-base` sequence classifier. It accepts or rejects candidate labels using the label definitions and thresholds in the manifest.
|
| 21 |
+
|
| 22 |
+
## Loading Rule
|
| 23 |
+
|
| 24 |
+
Do not load this directory with `AutoModelForSequenceClassification.from_pretrained()` at the repository root. PromptGuard should load `context_lr_roberta_active_best_f1_manifest.json`, then load the LR `joblib` and the verifier directory named in that manifest.
|