IG Classifier 1.0 (interim)

Paso 2 of the IS Identifier pipeline: takes the reviewable Excel produced by bravo-pena/is-identifier-1.0 (Paso 1: segments + institutional-statement candidates) and classifies every AIM candidate with the official Rules-taxonomy V4.0 β€” TYPE (7 root classes), hierarchical TAXON (71 terminal leaves, flexible reporting depth 1–4) and canonical LINK.typ β€” with per-class probabilities.

⚠️ Interim model. Trained while the annotation base is still being completed. Several terminal taxa have very few examples (15/71 leaves under 10, 7 with zero at training time; the classifier covers the 64 observed leaves). It will be retrained when the base reaches β‰₯10 examples per leaf.

Architecture

TF-IDF (word 1–2grams + char 2–5grams over the AIM fragment, word 1–2grams over the segment) + one-hot verb-lexicon TYPE + deontic flag, feeding four logistic-regression heads:

Head Target
TYPE 7 root classes (AGG, BOU, CHO, INF, PAY, POS, SCO)
TAXON terminal leaves observed in training (64 of 71)
has_link binary: does this AIM participate in a link?
link_typ one-vs-rest over the 5 canonical link tokens

Inference fuses TYPE into the leaf distribution (P'(leaf) ∝ P_taxon(leaf) Γ— P_type(branch(leaf))) and derives every reported depth from that single fused distribution by rolling probabilities up the official tree β€” depths are consistent by construction.

Files

File Purpose
paso2_baseline.joblib Pickled Paso2Baseline (sklearn 1.9, ~27 MB)
meta.json Training metadata (classes, dataset hash, CV metric)

Security note: the model is a joblib pickle. Load it only through the official package (github.com/bravo-pena/ig-classifier) or from this repo.

Usage

pip install git+https://github.com/bravo-pena/ig-classifier.git
ig-classifier paso1_output.xlsx            # depth 4 (full detail) by default
ig-classifier paso1_output.xlsx -d 1       # rule-type level only
from ig_classifier import load_model, run_file

model, meta = load_model("bravo-pena/ig-classifier-1.0")
run_file("paso1_output.xlsx", "paso2_output.xlsx", model,
         model_version="ig-classifier-1.0", depth=4)

Output Excel sheets: planilla (team-style wide: one row per segment with specificAIM.i / TYPE.i / TAXON.i and their confidences), aims (one row per AIM with readable top-3 probabilities such as PAY 81% | CHO 12% | BOU 4%), schema, summary.

Validation (provisional)

5-fold cross-validation grouped by case (no document leakage), evaluated on clean-label rows only, June 2026 corrected base (6,496 AIMs):

Metric Value
TYPE macro-F1 0.580
TAXON depth-1 macro-F1 (fused) 0.587
TAXON terminal-leaf macro-F1 (fused) 0.187
has_link F1 0.690

These numbers are provisional: the annotation base is still under revision and many leaves are under-supported. They will be frozen after the next retraining on the completed base.

Limitations

  • Interim performance. Terminal-leaf predictions (depth 4) are suggestions to review, not final codes. Depth 1–2 aggregates are the reliable output today.
  • LINK pair-matching is not implemented β€” the model predicts whether an AIM participates in a link and its canonical LINK.typ, but not which other AIM it links to (the LINK column is empty).
  • Trained on Spanish/English community-irrigation and similar natural-resource regulations; other domains are out of distribution.
  • The input must be the Paso 1 Excel (sheet segments with AIM candidates); the model does not segment raw documents β€” that is Paso 1's job.

Taxonomy

Official Rules-taxonomy V4.0 (7 types, 71 terminal leaves), from ResilientRules/Rules-taxonomy (CC0-1.0), bundled with the package.

License

MIT (code and weights). Taxonomy: CC0-1.0.

Downloads last month
-
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support

Space using bravo-pena/ig-classifier-1.0 1

Evaluation results

  • TYPE macro-F1 (7 classes) on Private regulatory annotation dataset (June 2026 corrected base)
    self-reported
    0.580
  • TAXON depth-1 macro-F1 (fused) on Private regulatory annotation dataset (June 2026 corrected base)
    self-reported
    0.587
  • TAXON terminal-leaf macro-F1 (fused) on Private regulatory annotation dataset (June 2026 corrected base)
    self-reported
    0.187
  • has_link F1 on Private regulatory annotation dataset (June 2026 corrected base)
    self-reported
    0.690