Parsing the Code of Federal Regulations for the Commodity Flow Survey's Expanded Hazardous Materials Supplement

Krista Chan, U.S. Census Bureau

Christian Moscardi, U.S. Census Bureau

FCSM

November 4, 2021

1

Disclaimer: Any views expressed are those of the author(s) and not necessarily those of the U.S Census Bureau. The Census Bureau has reviewed this data product for unauthorized disclosure of confidential information and has approved the disclosure avoidance applied. (Approval ID: CBDRB-FY22-ERD006-001)

The Commodity Flow Survey and Expanded Hazardous Materials Supplement

Commodity Flow Survey (CFS)

Provides a comprehensive multimodal picture of national freight flows

Sponsored by the Bureau of Transportation Statistics (BTS) and the Census Bureau

Includes hazmat shippers, but not focused on them

Expanded Hazardous Materials (EHM) supplement

Part of CFS, but focused on hazardous materials (hazmat)

Sponsored by Pipeline and Hazardous Materials Safety Administration (PHMSA) 

2

Expanded Hazardous Materials (EHM) Supplement

Estimates by hazmat type and packaging type

National and possibly subnational level

No survey currently collects detailed data on packaging of hazardous materials offered for transportation

For PHMSA: determine the impact of changes to hazmat shipping rules and regulatory requirements, application of the Evidence Act

3

**Cecile Mcwilliams Murray (CENSUS/ERD CTR) (CC) -**is the "we" in the diagram here you? or PHMSA?

The Code of Federal Regulations (CFR)

Hazardous Materials Regulations (HMR): 49 CFR parts 171-180

Contains all PHMSA's rules and regulations for

Shipment of hazmat

Packaging instructions and standards

Modes of transit

Valuable information to support editing and imputation of survey results

However, there are many barriers to using the CFR in its raw form

4

Examples of hazmat regulated by the HMR

The CFR's Contributions to EHM's Survey Process

Generate realistic instrument test cases

Verification of respondent entries against regulation during survey editing

Standardizing free-response packaging code text

Imputing based on regulations where respondents do not answer

5

Reduced analyst burden

Improved data quality

**Carla B Medalia (CENSUS/ERD FED) (CF) -**i think title needs to be modified here. this is highlighting YOUR contribution not the survey process

**Cecile Mcwilliams Murray (CENSUS/ERD CTR) (CC) -**this slide is like "how this application helps PHMSA do its job," right? kind of a summary of what you've already described at the beginning about why the app is valuable

**Krista Cheung Chan (CENSUS/ERD CTR) (KCC(C) -**Kevin suggests moving this up front, show that it prevents people from delving into the CFR

**Krista Cheung Chan (CENSUS/ERD CTR) (KCC(C) -**how will you measure success?

The Problem

CFR text is highly unstructured

6

Key steps involved in understanding packaging regulations

7

1. Part 172.101 Hazmat Table

2. Part 173 Packaging Requirements

3. Part 178

Packaging Standards

Look up United Nations/North American (UN/NA) #

Bulk vs nonbulk requirements

Special provisions for types of transit

Find allowable packaging codes

Understand pressure requirements, exceptions, inner vs outer packaging, weight restrictions

Thorough definitions of each packaging code

How packaging need to be tested

**Cecile Mcwilliams Murray (CENSUS/ERD CTR) (CC) -**if you wanted to have less text here, you could just say what's in the bullets verbally and maybe add a verb to the text in boxes, e.g. "look up hazmat in table, identify packaging requirements, etc"

Code of Federal Regulations, Title 49 § 172.101 

Hazardous Materials Table

All hazmat have a corresponding United Nations/North American (UN/NA) number

Respondents are asked for UN/NA numbers in the EHM

e.g. Shippers of diesel fuel use UN1993

8

1. Part 172.101 Hazmat Table

UN1993 row of hazmat table

Code of Federal Regulations, Title 49 § 172.101 

Hazardous Materials Table

All hazmat have corresponding packaging instructions

The packaging instructions consist of dense, unstructured text

9

2. Part 173 Packaging Requirements

UN1993 row of hazmat table

10

2. Part 173 Packaging Requirements

Example of packaging requirements

Required label for the shipper includes UN/NA packaging code

11

3. Part 178 Packaging Standards

Where packaging codes are defined

Users must read the table of contents to find the corresponding section

Example of packaging standards

The Solution

Scraping the CFR and building a web app

12

Existing tools for navigating the CFR

eRegs

Built by 18F, part of GSA

Key terms defined

Cross references

Changes over time

New eCFR

Point in time

API to query parts of CFR and hierarchical relationships (chapters, subchapters, paragraphs, etc.)

Remaining gaps:

Relating UN/NA numbers and packaging codes

13

Our solution: scraping UN/NA and packaging codes

14

Scraping the CFR

Parsing codes using regular expressions (regex)

Loading into a relational database

Create a web app for UN/NA querying

Tool infrastructure

15

CFR

1. Part 172.101 Hazmat Table

2. Part 173 Packaging Requirements

3. Part 178 Packaging Standards

Hazmat UN/NAs

Packaging Codes

Packaging Standards

Database

Scrape, parse

Web App

UN/NA form entry

Packing instructions with codes highlighted

Immediate lookup of packaging standards

Query

Scraper

Regular expressions (regex) example
| Part    | Code | Description                           |
|---------|------|---------------------------------------|
| 178.33  | 2P   | Inner nonrefillable metal receptacles |
| 178.33a | 2Q   | Inner nonrefillable metal receptacles |

Regex utilizes patterns in text to extract and structure key information

Web App: UN/NA Lookup

17

Tooltips to define key terms

UN/NA search

**Krista Cheung Chan (CENSUS/ERD CTR) (KCC(C) -**Kevin says give an example of bulk or nonbulk to illuminate variety of packaging for people

Web App: UN/NA Lookup

18

Web App: Highlighted and clickable codes

19

Highlighted packaging codes with clickable packaging standards

Pop-up with corresponding packaging standard

20

Highlighted packaging codes with clickable packaging standards

Pop-up with corresponding packaging standard

Web App: Highlighted and clickable codes

Potential Applications beyond EHM

Parsing codes within regulations (NAICS, VIN #s, etc.)

Quick querying of the CFR by a certain topic or theme

Quantitative analysis of regulations

Generating a resource for understanding respondents

21

**Cecile Mcwilliams Murray (CENSUS/ERD CTR) (CC) -**small nit but I'd just say "potential applications beyond PHMSA" or something so it's clear this has extensions

Questions?

22

Email: Krista.c.chan@census.gov

Project Github: https://github.com/census-bds/usdot-phmsa-hazmat-parser

# image2.png

# image3.jpeg

# image4.jpeg

# image5.jpeg

# image6.png

# image7.png

# image8.png

# image9.png

# image10.png

# image11.png

# image12.png

# image13.png

# image14.png

# image15.png

# image16.jpeg

# image17.jpeg

# image18.png

# image19.png

# image20.png

# image21.png

# image22.png

# image23.png

# image24.png

# image25.png

# image1.png