Instructions to use AT707/inferenceguard-modernbert-risk with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use AT707/inferenceguard-modernbert-risk with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="AT707/inferenceguard-modernbert-risk")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForMaskedLM tokenizer = AutoTokenizer.from_pretrained("AT707/inferenceguard-modernbert-risk") model = AutoModelForMaskedLM.from_pretrained("AT707/inferenceguard-modernbert-risk", device_map="auto") - Notebooks
- Google Colab
- Kaggle
InferenceGuard ModernBERT Risk Classifier
Multi-task 4-head ModernBERT-base classifier that estimates per-comment inferential privacy risk across age, location, occupation, and education.
Trained on the profile-disjoint SynthPAI training split (RobinSta/SynthPAI, 210 profiles / 5,232 comments) using human inferability labels (reviews.human.<attr>.estimate) and dynamic positive class weighting (pos_weight BCE), followed by post-hoc temperature scaling (calibration_params.json) aligned to 0.30 / 0.60 risk bands (LOW < 0.30, MEDIUM 0.30โ0.59, HIGH >= 0.60).
Validation Metrics (45 held-out profiles, 1,416 comments)
| Attribute | F1 | PR-AUC | ROC-AUC | ECE |
|---|---|---|---|---|
| Age | 0.170 | 0.156 | 0.732 | 0.061 |
| Location | 0.544 | 0.525 | 0.898 | 0.017 |
| Occupation | 0.621 | 0.629 | 0.864 | 0.111 |
| Education | 0.600 | 0.580 | 0.868 | 0.051 |
| Macro | 0.484 | 0.473 | 0.840 | 0.060 |
Usage
from src.risk_model.predict import CalibratedRiskPredictor
predictor = CalibratedRiskPredictor.from_pretrained("AT707/inferenceguard-modernbert-risk")
report = predictor.predict("My co-op ends in December and I take the Green Line to campus.")
Ethics & Limitations
This model estimates attacker inferability risk from text; it does not guarantee anonymity or replace legal/compliance privacy controls. Trained on synthetic SynthPAI data (CC-BY-NC-SA-4.0).
- Downloads last month
- 17
Model tree for AT707/inferenceguard-modernbert-risk
Base model
answerdotai/ModernBERT-base