Text Classification
Transformers
Safetensors
English
deberta-v2
secret-detection
security
cybersecurity
devsecops
deberta
binary-classification
text-embeddings-inference
Instructions to use hypn05/secrets-sentinel-small with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use hypn05/secrets-sentinel-small with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="hypn05/secrets-sentinel-small")# Load model directly from transformers import AutoTokenizer, AutoModelForSequenceClassification tokenizer = AutoTokenizer.from_pretrained("hypn05/secrets-sentinel-small") model = AutoModelForSequenceClassification.from_pretrained("hypn05/secrets-sentinel-small") - Notebooks
- Google Colab
- Kaggle
| license: mit | |
| language: | |
| - en | |
| base_model: | |
| - microsoft/deberta-v3-small | |
| pipeline_tag: text-classification | |
| library_name: transformers | |
| tags: | |
| - secret-detection | |
| - security | |
| - cybersecurity | |
| - devsecops | |
| - deberta | |
| - text-classification | |
| - binary-classification | |
| # Secrets Sentinel — small-v1 (deberta-v3-small) | |
| > Variant of [hypn05/secrets-sentinel](https://huggingface.co/hypn05/secrets-sentinel) | |
| > Architecture: **deberta-v3-small** · Parameters: **141M** · Speed: **3.5× vs base** · pos\_att\_type: `p2c + c2p (default)` | |
| Full fine-tune on data_v10 (1.14M lines, 195 negative + 162 positive patterns, 37,866 real-world labeled examples). 6 transformer layers vs 12 in base. Identical accuracy to base on all 9 test scenarios. | |
| ## Benchmark (test\_cases\_realistic · 700 lines · 9 scenarios · private\_key excluded) | |
| | Model | F1 | Prec | Rec | FP | ms/line | Speedup | | |
| |---|---|---|---|---|---|---| | |
| | base v5.0.0 (reference) | 1.0000 | 1.0000 | 1.0000 | 0 | 0.938ms | 1× | | |
| | **small-v1 (this model)** | see notes | — | 1.0000 | see notes | ~3.5× faster | 3.5× | | |
| ## Usage | |
| ```python | |
| from transformers import pipeline | |
| detector = pipeline("text-classification", model="hypn05/secrets-sentinel-small") | |
| lines = [ | |
| "AWS_SECRET_ACCESS_KEY = 'wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY'", | |
| "password = os.environ.get('DB_PASSWORD')", | |
| "uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef", | |
| "DB_PASSWORD=null", | |
| ] | |
| for line, result in zip(lines, detector(lines)): | |
| label = "SECRET" if result["label"] == "LABEL_1" else "safe " | |
| print(f"[{label}] {result['score']:.1%} {line[:70]}") | |
| ``` | |
| **Expected output:** | |
| ``` | |
| [SECRET] 100.0% AWS_SECRET_ACCESS_KEY = 'wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY' | |
| [safe ] 0.0% password = os.environ.get('DB_PASSWORD') | |
| [safe ] 0.0% uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef | |
| [safe ] 0.0% DB_PASSWORD=null | |
| ``` | |
| ## Parent model | |
| See [hypn05/secrets-sentinel](https://huggingface.co/hypn05/secrets-sentinel) for full documentation, | |
| integration examples (pre-receive hooks, GitHub Actions, pre-commit), training data details, | |
| and complete benchmark numbers across all variants. | |