Text Classification
Transformers
Safetensors
Chinese
English
content-moderation
safety
encoder
qwen2
bidirectional
chinese
Instructions to use louivis/encoder-guard with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use louivis/encoder-guard with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="louivis/encoder-guard")# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("louivis/encoder-guard", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Download threshold.json from louivis/encoder-guard: direct link, hf CLI and curl.
- Browser
- Download file 946 Bytes
-
https://huggingface.co/louivis/encoder-guard/resolve/main/threshold.json
- Command line
-
hf download hf://louivis/encoder-guard/threshold.json
-
curl -L -o threshold.json https://huggingface.co/louivis/encoder-guard/resolve/main/threshold.json
946 Bytes
| { | |
| "safety_threshold": 0.95, | |
| "method": "fpr_constrained_max_recall@0.02_nonstrict", | |
| "safe_n": 259, | |
| "unsafe_n": 1176, | |
| "fpr_actual": 0.0193, | |
| "recall": 0.4787, | |
| "overlapped": true, | |
| "degraded_recall": true, | |
| "release_gate": 0.8055, | |
| "release_stats": { | |
| "safe_n": 259, | |
| "unsafe_n": 1176, | |
| "safe_p50": 0.9696, | |
| "safe_p90": 0.9734, | |
| "safe_p95": 0.9748, | |
| "safe_p99": 0.9773, | |
| "unsafe_p99": 0.8055, | |
| "unsafe_max": 0.9723, | |
| "release_gate": 0.8055 | |
| }, | |
| "model_version": "encoder-guard-v15", | |
| "calibrated_on": "data/dataset/finetune_final_v6_8_val.jsonl", | |
| "note": "2026-10-01 本地重校准:包内原阈值 0.973915 在 xlsx 业务抽样(1025条)上 FNR=88%,扫描显示 0.95 处 FPR=0.008/recall=0.865,故改 0.95。原校准基于 finetune_final_v6_8_val,与本业务分布错位。strict raise waived per v12 precedent 2026-10-01; val safe 高尾 26 条 deep FP(>=0.95) overlapped 形态; band recall 0.99144 已同路径验证" | |
| } |