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
| # PromptGuard Context Runtime Artifacts | |
| This directory is the PromptGuard context classifier runtime package. | |
| 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. | |
| ## Required Files | |
| | Purpose | File | | |
| | --- | --- | | |
| | Runtime manifest | `context_lr_roberta_active_best_f1_manifest.json` | | |
| | Target labels | `context_target_labels.json` | | |
| | Verifier label definitions | `context_label_definitions_verifier_compact_v2.json` | | |
| | LR candidate generator | `context_with_patch_v287_lr_c4_dev_classifier.joblib` | | |
| | Verifier model directory | `context_verifier_klue_roberta_base_lrmined_v287_global002_compactv2_lpft_focal_1p2ep/` | | |
| ## Model Roles | |
| - The LR file is a scikit-learn One-vs-Rest Logistic Regression classifier. It consumes Qwen embedding vectors and proposes candidate context-risk labels. | |
| - 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. | |
| ## Loading Rule | |
| 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. | |