Hitachi's humanoid robot EMIEW2 has a conversation with an employee during a demonstration at the company's central laboratory in Tokyo on May 20, 2014

Japanese scientists unveiled a robot with a sense of humour Tuesday, and claimed it was capable of knowing when its jokes had fallen flat.

The pint-sized roller-skating EMIEW2—pronounced like the flightless bird—is able to have a short conversation with a human being, without being given a script.

The red and white robot picks key words from a sentence—for example, "how many"—to try to work out what question it is being asked, then confirms the inquiry before firing back an answer.

Engineers at Hitachi have programmed the android to understand a range of human responses, including non-verbal signals like nods.

It uses this comprehension to determine if its interlocutor has got the "joke" it has just told, said scientists.

At a demonstration in Tokyo on Tuesday, the 80 centimetre- (32 inch-) tall device answered a question on the number of people working at the Hitachi facility with the somewhat surreal: "We have two swans."

When its interlocutor appeared puzzled, the robot let on that it had been joshing.

"You got it? I'm kidding. We have about 800 people working here," it drolly revealed.

Hitachi's Hisashi Ikeda said while the robot's sense of humour may not be very refined at present, the ability to comprehend reactions was an important step forward.

"The new technology makes it possible for a robot to understand what a human means, even if they only gesture," he said.

EMIEW2—its name is a rather strained acronym for "excellent mobility and interactive existence as workmate"—is intended ultimately to provide company in some form, perhaps as a kind of house pet, or even as a receptionist, the company said.

© 2014 AFP