Narrative label auditCoding guide

Narrative label audit: coding guide (P5, step C)

This guide is for the two coders and the adjudicator. It holds no narrative text.

Record lookup: Iowa CrashData DB. Narrative is table znar, field NARRATIVE, key CRASH_KEY. Officer fields are table zpve (same key); do not open or copy them.

Coding happens in the web labeling tool on aiws. The tool reads ~/scratch/cellstate/r21/audit/sample.csv and fetches each narrative on aiws. Narrative text never leaves aiws.

1. Why we audit

The paper uses ten crash-type labels built from the police narrative and coded crash fields.

The reviewer asked how often the labels are right. We need precision (of the crashes a rule tags, how many truly fit) and recall (of the crashes that truly fit, how many the rule tags).

The machine labels are hidden from you. You code from the report alone.

2. Files on aiws

FileWho opens itWhat it holds
sample.csvlabeling tool, analystrow, crash_key, year, county, stratum, weight, machine labels L01-L10. No narrative text. The tool hides stratum and machine labels from coders
audit_key.csvanalyst onlystratum, weight, machine labels and negation flags per row. Coders must not open it
a01_sample.pyanalystbuilds the sample (seed 20261101)
a02_score.pyanalystscores the finished sheets

Each row shows audit_id, CRASH_KEY, the officer-coded manner of collision, the officer-coded traffic control and the narrative.

Officer names and badge numbers are masked as [OFFICER] and [ID]. If you still see a personal name, note the row in notes. Do not copy the name.

3. How to code a row

A crash can carry several labels. Code every label that applies.

4. Label dictionary

"Manner" means the officer-coded manner of collision (r6 mapping). "Signal" means any unit coded traffic signals.

The machine rule column states exactly what the code does (r7/b_narr.py regexes, r8/a_labels.py rules). The coder rule column states what you judge.

LabelPaper nameMachine ruleCoder rule: code 1 when
L01_queue_rearQueue rear-endmanner rear-end AND narrative matches queue wording (slowed, stopped or backed-up traffic ahead, stop and go, congestion, queue, sudden stop or brake, slammed brakes, line of traffic, stopped at a red light). A match is dropped if a negation word sits in the 40 characters before itrear-end, and the narrative says the struck vehicle was slowing, stopped or in a line of traffic
L02_sudden_rearRear-end without queue wordingmanner rear-end AND no queue wording (includes rear-ends with no narrative)rear-end, and the narrative gives no slowing, stopped or queued traffic ahead
L03_sigchange_angleSignal-change anglemanner broadside AND signal AND narrative mentions yellow or amber, or "light/signal changed/turned", or "turned green/yellow/red"broadside at a signal, and the narrative says the signal was changing or yellow when a driver entered
L04_red_angleRed-running anglemanner broadside AND signal AND (ran-signal contributing code OR red-light wording) AND no yellow/amber wordingbroadside at a signal, and the narrative or code says a driver entered on red
L05_pl_yellowPermissive left on yellow(manner oncoming left OR failed-to-yield-left code with opposite directions) AND signal AND yellow/amber wordinga left-turn versus opposing crash at a signal, and the narrative mentions yellow
L06_left_opp_otherOther left versus opposingsame left-turn condition AND NOT (signal AND yellow wording)a left-turn versus opposing crash that is not L05
L07_pulled_outPulled out(stop or yield control, OR driveway road type, OR signature S16 to S18) AND not signal AND (pulled-out or failed-to-yield wording OR failed-to-yield code 40, 41, 44, 47)a driver entered from a stop, yield or driveway into a vehicle with priority
L08_did_not_seeDid not see (reported)narrative matches "did not / could not / failed to / unable to see, notice or observe", "looked but", "blind spot". No negation filtera driver is reported as saying or being found not to have seen the other party
L09_lc_sideswipeLane-change sideswipemanner sideswipe same direction AND (lane change or merge wording OR lane-change code 9 OR lane-change contributing group)same-direction sideswipe during a lane change or merge
L10_secondarySecondary crashnarrative secondary wording (secondary, prior/earlier/another crash, traffic backed up from a crash, rubbernecking) OR SecondaryCrash flag OR traffic-backup circumstance OR signature S05the crash happened because of, or in the queue from, an earlier incident

Notes on the rules:

5. Question columns

ColumnCode 1 when
Q_queue_wordingthe narrative describes slowed, stopped or queued traffic ahead, in any wording
Q_sudden_stop_positivethe narrative positively says the lead vehicle stopped or braked suddenly or unexpectedly (not just "stopped")
Q_unclearthe narrative is too short, garbled or contradictory to code any label with confidence

When Q_unclear is 1, still code each label with your best reading, and explain in notes.

6. Overlap and precedence

7. Negation

The machine drops a queue, yellow or red-light match when one of these words sits in the 40 characters before it, inside the same clause: not, no, never, wasn't, weren't, denied, deny, didn't, did not, without, nor.

This can misfire both ways. "No brake lights, traffic was stopped" may drop a true queue. "Did not stop for the red light" may drop a true red-running.

Code what the sentence means. The NEG stratum oversamples these cases.

8. Sample design

The frame is the 21,181 analysed Polk and Linn crashes with a narrative (21,318 analysed, 137 without narrative).

Strata partition the frame. A crash goes to the first stratum it fits, in this order.

StratumRuleFrame N_hSample n_hWeight N_h / n_h
NEGa queue, yellow or red-light match fully removed by negation227307.6
MULTItwo or more machine labels3,6024090.1
S_L01 to S_L10exactly one machine label3,627; 3,010; 426; 1,294; 375; 967; 1,048; 859; 1,122; 7820 each3.9 to 181.4
U_ANGLEno label, manner broadside9321562.1
U_OTHERno label, any other manner3,61415240.9

Total sample 300. The unlabeled strata carry large weights, so recall intervals for rare labels will be wide. Add rows to U_ANGLE and U_OTHER if recall matters for a label.

9. Adjudication

10. Scoring

Run a02_score.py on aiws after adjudication. It reports per label:

The pipeline was tested on simulated codes only (a02_scores_sim.json). Those numbers are not results.