IT is not exactly the vision of talking computers beloved of sci-fi films, like HAL in 2001: A Space Odyssey.

And while the popularity of voice assistants such as Amazon’s Alexa is booming, trying to talk to them often involves steadily increasing levels of rage as the answer comes back ‘I’m sorry I can’t help you with that’.

But within the next few years it will be possible to have proper conversations with these kind of artificial intelligence systems.

Jon Oberlander, Professor of Epistemics [the scientific study of knowledge] at Edinburgh University, whose research involves trying to find out how to get computers to talk or write like people, said speech recognition systems such as Alexa and iPhone’s Siri had come on “leaps and bounds” in recent years.

But he pointed out they were still limited by being unable to recall what had happened just moments ago in conversations.

Oberlander, who will today receive Edinburgh University’s prestigious Tam Dalyell Prize for Excellence in Engaging the Public in Science, said one of the most exciting areas of research in the field at the moment was a focus on building more sophisticated dialogue machines.

He said: “There are certain kinds of dialogue which are well managed by computer systems now, particularly these transactional dialogues where you are booking a ticket for example.

“But as soon as you start having a chat about an item in the news, for example, it becomes incredibly open-ended. Getting to do that kind of flexible dialogue is really hard.

“There is no question that it is challenging, but I would say with the number of people who are working on this, and the level of attention to it both on the academic and commercial side, we will see moderately impressive conversational assistants within the next five years.”

Amazon, the creator of Alexa, is currently running a global competition to challenge university students to build a ‘socialbot’ which can hold a conversation with humans.

Two teams from Scotland are involved – from Edinburgh and Heriot-Watt University – and the winners of the $500,000 prize will be announced in November this year. If the socialbot can converse coherently for 20 minutes, another $1million will be awarded.

Oberlander said there had been acceleration in the development of artificial intelligence, with Google’s AlphaGo system – which can learn from its mistakes – making headlines last year after beating a top human player at the ancient board game Go.

However he said it was also important not to underestimate the challenge of trying to get robots to replicate behaviour which comes naturally to human beings.

He pointed to work being carried out by his Edinburgh University colleague Professor Sethu Vijayakumar which is focused on creating a robot which walks like a person.

“We take dialogue for granted and walking down the street also comes easily to people,” Oberlander said.

“But getting a robot to walk like a human being is incredibly challenging and you have to learn a huge amount about how human beings do it in order to emulate that on robot platforms.”

The development of artificial intelligence has triggered some dire predictions for the future, with warnings that if machines obtain sentience it could threaten the existence of people.

Professor Stephen Hawking has previously said full artificial intelligence could “spell the end of the human race”.

But Oberlander has a more optimistic vision of the years ahead, in which humans and machines will work together.

“If you think about a car that is driving itself most of the time, you can’t suddenly hand over to a human being who has not being paying attention when things are suddenly at crisis level,” he said.

“So you have to design for that human machine interaction and to not do things in a way that leaves humans exposed to risks in times of emergency.

“I think there are lots of design issues about how to get effective human machine collaboration – I don’t think we are going to be living in a world of completely autonomous systems.”

Oberlander will deliver a lecture this evening during the award ceremony, which is being held as part of Edinburgh International Science Festival. The prize is named after former Labour MP and rector of Edinburgh University Tam Dalyell, who died earlier this year.