Downloads · 30 days
0
OASecure/promptguard-context-classifier
promptguard-context-classifier is a text classification model from OASecure. Use it when you need a label for a piece of text. It is set up for sklearn. The card lists the license as other.
This repository hosts the complete runtime artifact package for PromptGuard's context-risk classifier.
Downloads · 30 days
0
Access
Public
Updated Jun 23, 2026
Repo size
443 MB
Likes
0
Public
Click a slice to open those files.
.safetensors443 MB · 100%
From the Hugging Face model README
This repository hosts the complete runtime artifact package for PromptGuard's context-risk classifier.
It contains both required runtime stages:
LR candidate generator: models/context_with_patch_v287_lr_c4_dev_classifier.joblibRoBERTa verifier: models/context_verifier_klue_roberta_base_lrmined_v287_global002_compactv2_lpft_focal_1p2ep/model.safetensorsThe Hugging Face base_model metadata points only to the fine-tuned verifier base, klue/roberta-base. The LR stage is a scikit-learn linear classifier over Qwen embedding vectors, so it has no Transformer base model of its own.
PromptGuard uses a two-stage context classifier. This repository is a runtime artifact package, not a single Transformer checkpoint loaded from the repository root.
The Logistic Regression stage is a high-recall linear candidate generator stored as a joblib artifact. It is not a fine-tuned Qwen model and does not have its own Hugging Face base model. It expects normalized embedding vectors produced by Qwen/Qwen3-Embedding-0.6B.
The RoBERTa verifier is the fine-tuned Transformer stage. Its base model is klue/roberta-base, and the fine-tuned verifier checkpoint is stored under models/context_verifier_klue_roberta_base_lrmined_v287_global002_compactv2_lpft_focal_1p2ep/.
The runtime is complete only when all of these files are present:
| Runtime part | File |
|---|---|
| Source-of-truth manifest | models/context_lr_roberta_active_best_f1_manifest.json |
| Target label list | models/context_target_labels.json |
| Verifier label definitions | models/context_label_definitions_verifier_compact_v2.json |
| LR candidate generator | models/context_with_patch_v287_lr_c4_dev_classifier.joblib |
| RoBERTa verifier checkpoint | models/context_verifier_klue_roberta_base_lrmined_v287_global002_compactv2_lpft_focal_1p2ep/model.safetensors |
| RoBERTa tokenizer/config | models/context_verifier_klue_roberta_base_lrmined_v287_global002_compactv2_lpft_focal_1p2ep/* |
If only the LR joblib file is downloaded, the PromptGuard context pipeline is incomplete. Download with --include "models/*" so both stages are available.
Download the models/ directory into the PromptGuard project root. The application reads:
models/context_lr_roberta_active_best_f1_manifest.jsonmodels/context_target_labels.jsonmodels/context_label_definitions_verifier_compact_v2.jsonmodels/context_with_patch_v287_lr_c4_dev_classifier.joblibmodels/context_verifier_klue_roberta_base_lrmined_v287_global002_compactv2_lpft_focal_1p2ep/models/SHA256SUMS contains checksums for the uploaded runtime files.
SECRET_CREDENTIAL_CONTEXTPERSONAL_DATA_CONTEXTFINANCIAL_IDENTIFIER_CONTEXTCONFIDENTIAL_BUSINESS_CONTEXTPROPRIETARY_TECHNICAL_CONTEXTSECURITY_CONTROL_CONTEXTINTERNAL_OPERATION_CONTEXTBULK_SENSITIVE_RECORD_CONTEXTThe source-of-truth policy is stored in models/context_lr_roberta_active_best_f1_manifest.json.
0.02chunk_chars=900, chunk_overlap=120, max_chunks=8From the PromptGuard repository root:
pip install "huggingface_hub[hf_xet]"
hf download OASecure/promptguard-context-classifier \
--revision v287-20260623 \
--include "models/*" \
--local-dir .
Then enable the runtime:
PROMPTGUARD_CLASSIFIER_RUNTIME_ENABLED=true
PROMPTGUARD_CLASSIFIER_MANIFEST_PATH=/opt/promptguard/models/context_lr_roberta_active_best_f1_manifest.json
PROMPTGUARD_VERIFIER_RUNTIME_ENABLED=true
PROMPTGUARD_VERIFIER_MANIFEST_PATH=/opt/promptguard/models/context_lr_roberta_active_best_f1_manifest.json
Do not load this repository root directly with AutoModelForSequenceClassification.from_pretrained("OASecure/promptguard-context-classifier"). PromptGuard reads models/context_lr_roberta_active_best_f1_manifest.json, loads the LR joblib file for candidate generation, and loads the verifier directory named in that manifest for RoBERTa verification.
This repository contains runtime artifacts only. It does not include raw prompts, source documents, extracted text, filenames, training/evaluation detail rows, embedding vectors, logits, exact classifier scores, or full masked prompts.
The PromptGuard application code is distributed separately on GitHub. These model artifacts are published for PromptGuard runtime use. Qwen/Qwen3-Embedding-0.6B is used as a frozen embedding dependency for the LR stage, not as the fine-tuned base model of this repository. klue/roberta-base is the verifier base model. Downstream users should review base-model and training-data obligations before redistribution or commercial use.
This model is a context-risk classifier. It is not a complete DLP system by itself and does not replace PromptGuard's separate regex/span masking policy layer.