HAVE you heard the one about the speed-dating robot that had the last laugh?

Maybe not. But you may well in the future.

Or is it the boffins that are having a laugh? Scientists are developing an AI system that aims to recreate the subtleties of humour so that robots can laugh in the right way at the right time.

The team behind the laughing robot, which is called Erica, say that the system could improve natural conversations between people and AI systems.

Obviously honing the skills of robots to enable them to share a chuckle with a human has got to be top priority when the world’s going to hell in a handcart. Perhaps we could have a robot on hand to cheer us up when all the lights go out.

READ MORE: Tory messaging on national identity 'unlikely to end well'

Lead author of the research Dr Koji Inoue, of Kyoto University, said: “We think that one of the important functions of conversational AI is empathy. So we decided that one way a robot can empathise with users is to share their laughter.”

Inoue and his team have set out to teach their AI system the art of conversational laughter. They gathered training data from more than 80 speed-dating dialogues between male university students and the robot, who was initially teleoperated by four female amateur actors.

The dialogue data was annotated for solo laughs, social laughs (where humour isn’t involved, such as in polite or embarrassed laughter) and laughter of mirth. This data was then used to train a machine learning system to decide whether to laugh, and to choose the appropriate type.

The team tested out Erica’s “sense of humour” by creating four short dialogues to share with a person, integrating the new shared-laughter algorithm into existing conversation software. These were compared to scenarios where Erica didn’t laugh at all or emitted a social laugh every time she recognised laughter.

The clips were played to 130 volunteers who rated the shared-laughter algorithm most favourably for empathy, naturalness, human-likeness and understanding.

The team said laughter could help create robots with their own distinct character.

“We think that they can show this through their conversational behaviours, such as laughing, eye gaze, gestures and speaking style,” said Inoue, although he added that it could take more than 20 years before it would be possible to have a “casual chat with a robot like we would with a friend”.

However, Professor Sandra Wachter, of the Oxford Internet Institute at the University of Oxford sounded a note of caution.

She pointed out: “One of the things I’d keep in mind is that a robot or algorithm will never be able to understand you. It doesn’t know you, it doesn’t understand you and doesn’t understand the meaning of laughter.

“They’re not sentient, but they might get very good at making you believe they understand what’s going on.”

Sounds like the ideal candidate for Tory government.