Nobody wants to confront the idea of their own obsolescence. Still, sitting across a desk from Kris Hammond, in his office overlooking the lake shore in Chicago, it is hard not to at least have a sense of the inevitable. Hammond is the co-founder and chief scientist of a company called Narrative Science, which, among other things, has worked out a way of teaching machines how to write journalism. At the moment, the computers’ output is limited to basic sports reports and business news. But Hammond is convinced this is only the beginning. It probably won’t be that long, he half-suggests, before they can bash out 2,500 word stories on innovations in machine learning for the Observer New Review. Worse, he is irrepressibly cheerful about the prospect.

“Look!” he says, “we are humanising the machine and giving it the ability not only to look at data but, based on general ideas of what is important and a close understanding of who the audience is, we are giving it the tools to know how to tell us stories.”

Terrific, I think.

Narrative Science is one of a number of companies that have married huge advances in pattern recognition software with the revolution in natural language generation to create algorithms that resemble a writer (minus the soul-searching and the procrastination and the deadline anxiety). They are at the stage where the machine can, given the statistics of a baseball game, do this, for example:

“Tuesday was a great day for W Roberts, as the junior pitcher threw a perfect game to carry Virginia to a 2-0 victory over George Washington at Davenport Field.

“Twenty-seven Colonials came to the plate and the Virginia pitcher vanquished them all, pitching a perfect game. He struck out 10 batters while recording his momentous feat.

“Tom Gately came up short on the rubber for the Colonials, recording a loss. He went three innings, walked two, struck out one and allowed two runs. The Cavaliers went up for good in the fourth, scoring two runs on a fielder’s choice and a balk.”

Or, without any “journalistic” intervention, this (by one of Narrative Science’s competitors, Automated Insights) for the newswire AP:

“Apple Inc (AAPL) on Tuesday reported fiscal first-quarter net income of $18.02bn.

“The Cupertino, California-based company said it had profit of $3.06 per share.

“The results surpassed Wall Street expectations. The maker of iPhones, iPads and other products posted revenue of $74.6bn in the period, also exceeding Street forecasts. Analysts expected $67.38bn…”

It’s not deathless prose – at least not yet; the machines are still “learning” day by day how to write effectively – but it’s already good enough to replace the jobs once done by wire reporters. Narrative Science’s computers provide daily market reports for Forbes as well sports reports for the Big Ten sports network. Automated Insights does all the data-based stock reports for AP.

Have readers noticed? Last year, a Swedish media professor, Christer Clerwall, conducted the first proper blind study into how sports reports written by computers and by humans compared. Readers taking part in the study suggested, on the whole, that the reports written by human sports journalists were slightly more accessible and enjoyable, but that those written by computer seemed a little more informative and trustworthy.

“Perhaps the most interesting result in the study is that there are [almost] no… significant differences in how the two texts are perceived,” Clerwall concluded. “An optimistic view would be that automated content will… allow reporters to focus on more qualified assignments, leaving the descriptive ‘recaps’ to the software.”

Kris Hammond at Narrative Science shares that optimism (although he also suggests, with an edge of mischief, that a computer will win a Pulitzer prize within five years, and that 90% of journalism will be written by computer by 2030). He sees the stories generated by Narrative Science’s programme, Quill, as a way of augmenting and personalising news, of making it relevant to individual needs.

Kris Hammond, Larry Birnbaum and Stuart Frankel of Narrative Science. Photograph: Peter Wynn Thompson/NYT

Sitting in his office, in which about 30 programmers and designers work to perfect Quill’s growing, irrepressible output, I have a copy of the Chicago Tribune on the desk in front of me, a paper produced only a few blocks away in one of those grand, art deco, American newspaper buildings like that of Clark Kent’s Daily Planet. The Tribune’s lead story is about a tornado that the previous day had ripped through towns in northern Illinois.

Could Quill have put that together?

Given access to social media sites and weather reports, it probably could have told the story, Hammond suggests, though this is not something they are interested in attempting right now. “The tornado is one story. We can do that. But we would rather use the technology to tell this story a million different ways that nails what is important about it to a particular group or even an individual. A natural disaster story might result, instead, in a report sent out to 10,000 companies showing how their supply chain is impacted, or, say, directly to people who the data suggests have relatives out there. That will not come very soon, but that is what news will become.”

How close are they to the first inklings of that kind of service?

“By the end of this year,” Hammond says, “I think you will be able to say to the machine: I want to tell this kind of story. It’s about, say, the budget numbers of this city department. I want to compare these numbers with other similar city departments and I want to analyse them retrospectively for anomalies, and you will point it in the direction of the data and off it will go. All the analysis and reasoning will be in there. The language will have a human feel to it. A traditional journalist might go to the phones and find a story. We will go to the data.”

In this sense, Hammond believes we are at the beginning of a new relationship with the digital world. The great mass of data that is being gathered second by second, collected by our cars, our homes, our search histories, our businesses, our governments, remains for the most part “raw”, unanalysed. In order to get what we need from it we have to build a query or work out how to do analytics. And then we have to know how to look at spreadsheets and dashboards and make some sense of them.

“Imagine as the CEO of a major company you go off and spend £100m on gathering data,” Hammond says. “In theory, you can get an idea of what is going on in every single aspect of your company. But when you have got it, what do you do? You ask a guy who knows about spreadsheets and powerpoints and tell him to make sense of it. It’s like: did you forget you spent all this money? We are that guy. We have built a system that looks at the data, figures out where the story lies in it, pulls that data out, analyses it in the right way and converts it into language the CEO will understand.”

Hammond fully intends to live to see the day when people look at spreadsheets and data sets as being as antiquated as computer punch cards.

What is the most sophisticated thing the machine can do in this respect now? “We can do an eight-page exegesis of one number,” Hammond says, “for example on how likely it is a company is going to default on its debt. The eight pages will be written in plain English, supported where appropriate by graphs and tables. It will show you how it got to its conclusion. It is fine to read. The most important bits of analysis are shoved to the top.”

Can it do that in different tones of voice, as it were? Can it do quirky?

“It probably could, but I resist it. We can inject some randomness. But I like to have a trail that says, this is why this is here. We will have quirky and we have had sarcastic. But it has to be the result of a decision; at some point in the system, it has to be as a result, dare I say it, of conscious reasoning. At every point there has to be – here’s why I said this.”

Like many human journalists, Quill began life by writing ad-hoc film reviews. About six years ago, working in the artificial intelligence labs at Northwestern University, Hammond and some students built a system called News at Seven, with the aim of presenting the results of a standard computer search query as a narrative argument. In this way, for example, it would build a conversational kind of film review, which was structured using conflicting observations from movie data sites – IMDB and Rotten Tomatoes and the rest. The conclusions of the review would reflect the consensus of opinion.

The News at Seven project also resulted in Hammond’s team collaborating with the august Medill School of Journalism at Northwestern, which has been training reporters for nearly a century. That was the beginning of Narrative Science, which, with the help of budding sports journalists who created its lexicon of natural baseball language, turned its attention to data-driven sports reporting. A year or so in, they gave a presentation to sports news organisations. A reporter from ESPN was “angry and appalled,” Hammond suggests, “but not because, he said, I am looking at a story and it seems to have been written by a machine, but because I am looking at a story and it appears to have been written by a human being and I have a real sense of this person’s voice.”

Quill quickly learned to frame stories to suit its audience. If the readers were the supporters of a particular baseball team, it gave the match report from that team’s vantage. Likewise, if it is creating two company reports based on the same data, the machine can produce a positive emphasis for clients and a must-try-harder tone for employees. It has learned the art of spin.

‘Like any decent hack, the machine is coming to learn that there are only five or six compelling tales .’ Photograph: iLexx/Getty Images/Vetta

Much of that comes from analysis of narrative arcs, of basic plotlines. Like any decent hack, the machine is coming to learn that there are only five or six compelling tales available: back from the brink, outrageous fortune, sudden catastrophe and so on. The machine is not about to write nuanced profiles or wisecracking think pieces. But within its data-rich limits, Hammond and his team are finding many of the same patterns of story. “Performance review – measuring against benchmarks – is 70% of what we do. The big question most people have about anything – sports, business, politics – is: how is it doing?”

Thinking about this, imagining measuring my performance as a writer against a machine’s infinite capacity for number crunching, I wonder how much human intuition about where stories lie, about what will move or interest or excite readers, can be replicated. Having done this for 20 years or so, I suggest that as soon as an idea for a story is presented now, I have a pretty clear idea of how it will go, where it will likely begin and end. Can such things be taught to a computer?

“In the longer run, I believe that machines will be as smart and eventually smarter than we are about everything,” Hammond says.

But will it ever be able to replicate great storytelling that, like a piece of music, takes us on an emotional journey? Or through an argument that unfolds in surprising ways?

“When I think about that I always remember an interview I once heard with Bob Dylan,” Hammond says. “He didn’t know a lot about a lot of things, but he knew better than almost anybody how to craft a song so that it would produce particular effects. When a great writer tells a story, he or she knows how to craft it to make readers believe something, through argument, a set of emotional dramas or a particular structure. You can make someone sad without being sad yourself. Or you can make someone angry and be completely calm and distanced from that anger. That is what journalism does. It is a craft. It is not that the machine will have its own emotional states but it will know that it is doing enough to produce that reaction. At the moment, we can probably make someone happy or sad about how something has turned out at a very coarse-grained level; that will become more subtle.”

Does he imagine that there will be a resistance to the idea that the interaction between writer and reader has been deconstructed and manipulated in that way?

“I don’t think it will take anything away from that interaction,” he says. “Storytelling is one of the great gifts we have. When you go home, what is the question your wife or husband asks? ‘How did your day go?’ That’s not going to stop. But what the machine will be able to do is to communicate with us about a lot of the other stuff that goes on in the world and explain how it relates to us. What would you rather have? A device that has control and access to an enormous amount of information, which you have to struggle to get to? Or would you rather the machine just told you in clear language what you wanted to know?”

That sounds like a question that is loaded in favour of the future, though it is already beginning to describe the present. It also instinctively fails the first test of journalism: it sounds way too good to be true.