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
1pip install git+https://github.com/bravo-pena/ig-classifier.git
2ig-classifier paso1_output.xlsx # depth 4 (full detail) by default
3ig-classifier paso1_output.xlsx -d 1 # rule-type level only
1from ig_classifier import load_model, run_file
2
3model, meta = load_model("bravo-pena/ig-classifier-1.0")
4run_file("paso1_output.xlsx", "paso2_output.xlsx", model,
5 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.