Instructions to use Chinonso11/phmsa-incident-models with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Chinonso11/phmsa-incident-models with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="Chinonso11/phmsa-incident-models")# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("Chinonso11/phmsa-incident-models", device_map="auto") - Notebooks
- Google Colab
- Kaggle
PHMSA incident models
Two DistilBERT models fine-tuned on public PHMSA pipeline incident reports (gas distribution,
gas transmission and gathering, hazardous liquid; 2010 to present). Used by the Space
phmsa-incident-extraction.
| Folder | Task | Held-out result |
|---|---|---|
ner/ |
token classification, 12 entity types | micro-F1 0.608 on 840 spans (1,050 sentences labelled by one annotator) |
severity/ |
narrative classification: minor, moderate, severe, critical | macro-F1 0.777, accuracy 0.956 on 1,921 narratives |
Limits
- Severity labels come from PHMSA's structured flags (fatality, injury requiring inpatient hospitalization, ignition, explosion), not from the narrative text. About 40% of critical narratives never mention a death (rough keyword estimate) and the model detects none of those. Severity says nothing about spill size or environmental damage.
- The entity model does not extract root causes (
CAUSE_FACTORscores 0) and is weak on locations and regulatory references. Rare classes per commodity are too small to evaluate. - Tested only on PHMSA narratives. Not for operational, safety or regulatory decisions.
Loading
Download the repo with huggingface_hub.snapshot_download("Chinonso11/phmsa-incident-models"), then load the two subfolders with
AutoModelForTokenClassification.from_pretrained(<path>/ner) and
AutoModelForSequenceClassification.from_pretrained(<path>/severity).
Model tree for Chinonso11/phmsa-incident-models
Base model
distilbert/distilbert-base-uncased