The odds of getting a bill through Congress are, in a word, brutal. In a typical two-year term, members will introduce about 11,000 pieces of legislation. Maybe a few hundred will come to a floor vote, and of those only about half will ever be signed into law. The most efficient Congress of the past two decades — by a long shot — was the 106th, which, from 1999 to 2000, pushed 6 percent of its creations to the finish line.

Companies and organizations spend millions each year attempting to forecast this process. Armies of lobbyists wine-and-dine for morsels of inside information while hordes of researchers keep tabs on bills not just in Washington but in statehouses and local governments across the country.

In 2013, Tim Hwang and his childhood buddies Jonathan Chen and Gerald Yao came up with what they believed was a better way. The result was a company called FiscalNote, which aims to use data to shed light on the hidden components that help a bill become a law. FiscalNote’s software crawls government websites to pull data from over 1.5 million active bills across Congress, 50 state legislatures and 9,000 city councils — and seeks to predict the likelihood of each of those bills passing.

Today, Hwang leads the Washington-based company, which has a roster of over 200 clients using its government-relations platform, including Toyota and Anthem. It has raised $30 million in funding from the likes of Mark Cuban and the Winklevoss twins, hired 140 employees, and counts former Washington Post publisher Katharine Weymouth and retired Gen. Stanley McChrystal on its boards.

Of course, what FiscalNote aims to do is far from easy. Even in less bizarre times, Washington politics contains a strong element of human capriciousness. And contemporary Washington feels more capricious than ever before. That doesn’t just apply to the reality-TV star leading the executive branch: From John McCain’s stunning “thumbs down” during the Obamacare repeal effort to the recent government shutdown, Congress is a font of volatility. Amid all this wild human drama, can a data-intensive, “Moneyball”-style approach really make sense of the legislative process?

Hwang looks a little embarrassed when I bring up the Advanced Placement tests. He shakes his head and smiles as I ask him how he got the wherewithal to take 22 of the notoriously difficult high school exams, from economics to art to music theory, and pass each one. This was, by the way, after he had already started two nonprofits, been elected to Montgomery County’s school board as a student member, and been named a regional youth field organizer for Barack Obama’s 2008 campaign. No wonder a 2014 profile of him in Bethesda Magazine was headlined, “Is This the Next Bill Gates?”

Now 25, Hwang explains his overstuffed teenage résumé with the jargon and detachment of a programmer, invoking the concept of “leveraged time” — that is, calculating the value of time by weighing the societal good it produces. “How do you take that leveraged time and find places where you can make the most impact?” he says, eyes cast downward. “Politics is an easy one. I grew up in Washington, and it seems obvious that the policymaking process is where one unit of effort and time can equal 10 units of societal impact. I think the reason I was drawn to technology is it’s very similar.”

With FiscalNote, Hwang is merging those two time-leveraging fields — politics and technology — to re-create how companies and organizations interact with Washington. “The government relations industry is really the last industry that has not been transformed by technology,” says Chris Lu, a White House Cabinet secretary under Obama, who joined FiscalNote as senior strategy adviser in December 2016. “How we do government relations now is essentially the same way we have always done it: people having drinks at the Monocle and chitchatting and exchanging paper.”

Instead of relying on those fallible humans to predict a law’s chances of passing, FiscalNote’s self-learning artificial intelligence reads through a bill for certain contextual keywords and phrases that, according to historical data, influence its chances of success. The company combines this with information about the bill’s sponsors and legislators’ voting records to spit out a percentage likelihood that it will pass.

For Mary Kusler, senior director of the National Education Association’s Center for Advocacy and a FiscalNote client, the algorithm is most helpful in distinguishing bills that could have a real impact on schools and teachers from “nonsense.” Some lawmakers, for instance, propose a lot of bills but rarely get them passed. And even if a lawmaker has a good record at passing, say, transportation bills, Kusler explains, that doesn’t mean he or she will be effective at passing an education bill. FiscalNote will delineate the difference for her. “Those nuances matter,” she says.

Logging onto FiscalNote’s sleek interface is a bit like looking into a crystal ball. Cue up any issue and one can view a map of the country with states shaded in various colors, representing where relevant bills are pending. Click on a specific bill, and you’ll see a timeline of its course through committees and chambers, bullet points of its strengths and weaknesses when it comes to survival, how it compares to similar bills and, of course, the percentage chance of it passing in bright colors — green for good, red for dead. There’s even a “whipboard” sorting where lawmakers are leaning, based on past votes. (Annual subscriptions to all of this can range from $8,000 for tracking data from a single state to upward of $500,000.)

The technology is, in many ways, a combination of the old and the new. Formal vote-counting can be traced back to at least 1897, when House Republicans named their first official whip. But using a computer program to do it probably started in 1983, when W. Mark Crain, then an economics professor at George Mason University, introduced Billcast. “Oh, all the skeptics!” recalls Crain, now at Lafayette College in Pennsylvania. A New York Times article about Crain’s little project quoted a New Hampshire senator’s doubtfulness: “I own a couple of small computers and know something about them and I don’t see how it could work.”

Yet Crain persisted and set up a small business. He recalls typing out the results and mailing paper copies to clients. “But it wasn’t really that valuable if it couldn’t be accessed quickly,” he says. Nevertheless, Billcast lives on today as part of LexisNexis — it’s now called Legislative Outlook — with Crain serving as a consultant.

Since then, a handful of others have tried to do the same. The open-government data site GovTrack — using an algorithm developed by New York-based Skopos Labs — serves up its predictions freely for anyone to access, part of a civic mission to help citizens better understand the inner workings of Congress. It has found that information about the person introducing the bill is crucial; if that legislator is a member of the chamber’s majority or the chair of the assigned committee, it’s more likely to pass. Other factors bode ill: “If the bill had been introduced in a previous Congress, that actually correlated negatively with making it out of Congress this time,” says GovTrack founder Joshua Tauberer. “Because if it didn’t make it out last time, it probably isn’t going to make it out this time either.”

Tauberer says that in his original algorithm, before Skopos came onboard, the phrase that indicated the highest likelihood of passage was “To designate the facility of the United States Postal ...,” when in the bill’s title. (Congress frequently renames post offices through individual controversy-free bills.)

John Wilkerson, a political science professor at the University of Washington, co-authored a 2012 paper about using a congressional bill’s text to predict its success. He came out of it unconvinced of the method’s effectiveness: Simple correlations in past data, he believes, aren’t necessarily meaningful insights into why a certain bill passed or failed. Moreover, he cites the myriad ways policies can sneak into bills — reauthorizations, omnibus bills, “hitchhiker legislation.” “Trying to predict whether an individual bill passes is kind of missing the point,” he says. “Because what you’re really interested in is a policy idea, and whether that policy idea moves forward. ... There’s lots of examples of bills that die, but the proposal that the bill contains ultimately becomes law anyway.”

Hwang concedes this point. He mentions same-sex marriage, legalized by the Supreme Court. Or how the Environmental Protection Agency is now rolling back Obama-era environmental protections. Along the same lines, John Nay, co-founder of Skopos Labs, who developed the prediction algorithm used by GovTrack, points to the previous two presidential administrations’ outsized reliance on executive orders. Says Hwang: “Policy comes from everywhere.”

To that end, Hwang tells me, FiscalNote has recently shifted its clients away from focusing on its prophecies about bills. For instance, the company is now applying its methods to the crucial phase of rulemaking that occurs after a bill has passed, when the executive branch puts together the nuts and bolts of how a law will be carried out. The platform runs a “sentiment analysis” on public comments that can be submitted during this phase, and sifts through statements and news releases by lawmakers, to determine which way the winds are blowing as the legislation settles into law.

Like mostly automated cars that require a driver in tricky situations, Hwang says, FiscalNote’s predictive algorithms still need a human touch. “We initially started off with the concept of fully predictive analytics — and we still believe that in the long term it will end up in that direction,” he says. But he doesn’t think customers should rely solely on that green-red bill score. One telling change: The percentage-chance predictions are now hidden in a drop-down menu, requiring an extra click to display.

Still, Tauberer, of GovTrack, believes that even though the numbers are imperfect, they can provide valuable context. If, say, a senator were to introduce an extreme bill that got people on the left or right freaking out about the state of their country, the data can easily illustrate that it’s probably just signaling — the senator trying to make a point — rather than something with a chance of passing. “I often would see my users tweeting about bills saying, ‘Oh my God, this is horrible’ — not realizing that it was one of these throwaway bills,” says Tauberer.

And Crain believes that even now, when Washington seems so unstable, politics still functions as intended. Strange, black-swan bills don’t get passed that often, and the number of bills under consideration each biennium in the states — some 150,000 — varies only about 1 percent from year to year. For its part, FiscalNote says the accuracy of its federal-bill predictions today hasn’t changed from previous Congresses and administrations.

Meanwhile, FiscalNote is on a mission of expansion. On one of my visits to its Thomas Circle offices, Hwang was dressed against type for a start-up techie — a slim black suit — in preparation for a visit from D.C. Mayor Muriel Bowser. She was there to promote the company as a local tech-jobs creator, and to announce its move to a bigger office space on Pennsylvania Avenue. Hwang has also moved FiscalNote into some 20 countries, with even bigger ambitions on the horizon. “Right now, within the next two years, our mission as a company is to try and create a repository of all of humanity’s laws and regulations across every country on the planet into one singular platform,” he says.

There's plenty of work left to do stateside, however. On my last visit to FiscalNote's offices, Senate Majority Leader Mitch McConnell (R-Ky.) had just introduced the latest version of his health-care-reform bill. The news was awash in stories speculating if there were enough votes to pass and which senators might jump ship to oppose. FiscalNote had its prediction pegged in green: 72 percent. We all know how that ended.

Michael J. Gaynor is a freelance writer based in Washington.