Wednesday, July 14, 2021

Legislative Technology in 2021

When I tell people that I help Congress become more transparent and efficient, they invariably say: "Good luck with that." I'm happy to report that we have, actually, had some good luck with that.

I work with Xcential, a company that has deep expertise modernizing legislative systems, from building the drafting system that the California Legislature uses, to structuring the United States Code in a standard (XML) data format, United States Legislative Markup

More recently, the "Comparative Prints Project," which Xcential is working on for the House Office of the Clerk and the Office of Legislative Counsel, was highlighted by the House Modernization Committee (June 2020 report (pdf)) and is one of the few areas in Congress that has bipartisan support. 

For this work, we've put together experts in Natural Language Processing, Customer Experience design, and legislative data systems. As a lawyer who now builds software, I work to integrate the parts into a suite of software tools, to help answer the question: "What's going on as a bill becomes law?"

Bill language is often opaque and difficult to interpret, both for technical and political reasons. The words may be straightforward, but understanding their impact currently requires expertise and extensive research. A major change to the law may be written: In subsection 501(c)(3) of such Act, strike "religious,". Understanding this requires finding the earlier reference to 'such Act'; knowing what subsection 501(c)(3) says; and interpreting how the proposed change would affect the current law. It may also involve following a trail of such instructions earlier in the bill.

To make this information more accessible, we've built a tool that automatically processes bill language to show how a bill would change current law. We've also built a tool to compare two versions of a bill. This second tool is being used to track changes that are made to legislative drafts (like the Covid-19 relief bills) as they make their way through Congress. 

Both tools track changes in natural language documents. This, in itself, is not a new endeavor. Academics have worked for decades on algorithms to detect changes in documents. Change tracking has an even longer history in legislatures: the legislative drafter's art, developed over generations, is to 'patch' legislation with language that achieves its aims, and can still pass a divided House. We combine these two, algorithmic analysis and the art of drafting, to produce document comparisons that are both machine-readable and human-understandable.

One of the more interesting aspects of this project is the modeling of amendatory language by Sela Mador-Haim, on our team. He developed a formal grammar, Amendment Modeling and Processing Language (AMPL) after analyzing hundreds of thousands of amendment phrases. From these phrases, he identified a small set of building blocks ("strike", "insert"; "before", "after"; "and", "or", etc) and developed a recursively-defined syntax to combine them. The vast majority of Congressional amendments can be parsed and converted into a syntactically valid combination of these AMPL building blocks. The AMPL statements are then interpreted by our automated tools to show changes in the law:

An amendment from H.R. 1500 (116th Congress), is interpreted and automatically applied to the law

The system can handle a wide variety of amendment types

As with any legislative system, there are limits to what can be automated. We recognized this early on, and have worked with Charlotte Lee and her Customer Experience team at Monday Design to bring in drafters and other experts to the creation of the system. The goal is to provide tools that help these experts review changes in the law and to communicate the changes in a way that non-experts can better understand.

We owe our "luck" in recent years to some persistent people in government. Among them is Kirsten Gullicksen at the Clerk's Office, who manages the Comparative Prints Project. Kirsten won a 2021 Service to the Citizen Award, for her work on this and other initiatives to support and modernize systems in the House.

To see Kirsten present the Comparative Project, and to hear others who are working to help Congress become more transparent and efficient, tune in today at the virtual meeting of the Bulk Data Task Force on July 14 (RSVP required).

Over the coming months, I hope to discuss some of the other projects that were presented at the meeting and provide more detail about the technologies we are using.

Thursday, March 7, 2019

Converting Daily Temperature Data to Sound with TwoTone

I was distracted yesterday. I saw a tweet by Alberto Cairo (@albertocairo) about a new web-based tool to convert data to sound. I have thought a lot about 'visualization' in sound since my days doing electrophysiology of locust brains at Caltech (I was even acknowledged for 'helpful comments' in a Nature paper). The tool, 'Two Tone' was "made by Datavized Technologies with support from Google News Initiative".

My masterpiece is here: Chicago vs. Redwood City (temperatures, 2015, SoundCloud)

I wanted to try it, and the first thoughts I had were to use data from a fitness tracker (e.g. steps per day), but I don't have one. Next I thought to nerdily plot my Github contributions over time. But for now I've done something a little more conventional: plot the minimum temperature over a year in Chicago, and in the Bay Area.

I started by getting data from Google's BigQuery accessing NOAA's Global Historical Climate Network (GHCN). After a little trial and error based on Google's existing examples, I figured out that the daily minimum temperature in Chicago for 2015 can be found with:

  wx.value/10.0 AS min_temperature
  `bigquery-public-data.ghcn_d.ghcnd_2015` AS wx
  id = 'USW00094846'
  AND qflag IS NULL
  AND element = 'TMIN'

To do the same for Redwood City, CA (the nearest station to me), I used
id = 'USC00047339'
(found here).

Lots of caveats: TwoTone probably normalizes the dynamic range, so we don't get a fair comparison of the two cities. I'd also like more control over features of the audio: the maximum tempo is 300 bpm, but audio data can be processed much faster by the brain; I'd also like to be able to combine tracks with an eye to meaningfully comparing the data. I did this in Garage Band, but by then, the data had been converted to audio waves. One of the great features of TwoTone is to manipulate sound visualizations, while still looking at the source data. I look forward to the evolution of this tool, and generally to the field of audio 'visualizations' of data.

Monday, April 9, 2018

Pope Shows the Way to Modernity in "Call to Holiness"

Pope Francis published a remarkable document today, called the "Gaudete et exsultate", an exhortation to holiness. He says its goal is to "repropose the call to holiness in a practical way for our own time". The philosophy of the document is bold and modern.
Pope Francis, Call to Holiness

 Each of its 177 numbered paragraphs, in five named chapters, contains an expression of wisdom and a practical view on what it is to live a holy life. It is very much worth reading and meditating upon, whatever your faith.

The document resonates on many levels. It calls for acting with "Joy and a Sense of Humor", for "Going Against the Flow", and importantly, emphasizes that charity is the highest virtue. A summary in the New York Times highlights the teaching, found in paragraph 101, that caring for the poor and immigrant are as holy as the opposition to abortion:

...Our defence of the innocent unborn, for example, needs to be clear, firm and passionate, for at stake is the dignity of a human life, which is always sacred and demands love for each person, regardless of his or her stage of development. Equally sacred, however, are the lives of the poor, those already born, the destitute, the abandoned and the underprivileged, the vulnerable infirm and elderly exposed to covert euthanasia, the victims of human trafficking, new forms of slavery, and every form of rejection.[84] We cannot uphold an ideal of holiness that would ignore injustice in a world where some revel, spend with abandon and live only for the latest consumer goods, even as others look on from afar, living their entire lives in abject poverty.
It is also refreshingly modern in its form and format. It is published in HTML, with a clear and consistent structure (numbered paragraphs, chapters). Its references all have hyperlinks to the footnotes, and the footnotes themselves are hyperlinked to original sources!

At the top of the document is a list of social media links (FB, Twitter, Google +, email...), as well as a link to print and pdf for old-school applications. It also has been translated into many languages and has links to those versions at the top.

It even has breadcrumbs placing this document in context of the other documents on the website.

It comes in a mobile version, and the document redirects to the correct format for your device:

Each of these components was clearly well thought-out, and underscores, subtly, Pope Francis' call to modernity. While he warns us not to be "caught up in superficial information, instant communication and virtual reality", he does not reject technology itself, and indeed has published an (almost) thoroughly modern document. The one step that is missing is to provide a hyperlinkable structure for the document. If each numbered paragraph had an id, for example, it would be possible to link directly to the paragraph, like :

If the Vatican is interested in taking this additional step, I would be very happy to consult on how to convert this and other papal declarations into fully standardized Akoma Ntoso.

Tuesday, May 2, 2017

XML Editing is Hard

I was reminded this week that our best customers at Xcential are those who try to build a legislative data system themselves first. And today's XCKD perfectly sums up why: