A mind reading machine that turns thoughts into complete sentences in real time could revolutionise communication with people who cannot speak or move.

It has an accuracy rate of 97 per cent - more than twice as high as other brain-signal decoding devices.

An algorithm maps the activity of neurons to combinations of vowels, consonants and commands to parts of the mouth.

This enables it to type word sequences on a computer interface in real time, reports Nature Neuroscience.

It could help people who cannot speak or move. Currently they are limited to spelling words out very slowly using residual eye movements or muscle twitches.

But, in many cases, information needed to produce fluent speech is still there in their brains. It's hoped the technology will enable them to express it.

Corresponding author Dr Joseph Makin, of California University in San Francisco, said: "Average word error rates are as low as three percent."

The study was carried out on four epilepsy patients who had been fitted with brain implants to monitor their seizures.

An algorithm maps the activity of neurons to combinations of vowels, consonants and commands to parts of the mouth

Their neural activity was turned "word by word into an English sentence - in real time," said Dr Makin.

Previous techniques have had limited success - with efficiency far below that of natural speech.

They could only decode fragments of spoken words - or less than 40 percent of words in spoken phrases.

So Dr Makin and colleagues used AI (artificial intelligence), or machine learning, to link the behaviour of brain cells directly to sentences.

In the study the participants read up to 50 simple sentences aloud while the electrodes recorded their neural activity.

Examples included "Tina Turner is a pop singer", "the oasis was a mirage", "part of the cake was eaten by the dog", "how did the man get stuck in the tree" and "the ladder was used to rescue the cat and the man."

Video Loading

The brain signals were fed into a computer which created a representation of regularly occurring neural features.

Explained Dr Makin: "These are likely to be related to repeated features of speech such as vowels, consonants or commands to parts of the mouth."

Another deep learning technique, known as a recurrent neural network, then decoded them into sentences.

What's more, the network was able to identify individual words - suggesting learning novel sentences from expanded vocabularies is possible.

In the last decade brain-machine interfaces (BMIs) have enabled some amount of motor function to be restored to paralysed patients.

Dr Makin said: "Although this type of control can be used in conjunction with a virtual keyboard to produce text, even under ideal cursor control which is not currently achievable, the word rate would still be limited to that of typing with a single finger.

The technology can type word sequences on a computer interface in real time

"The alternative is the decoding of spoken, or attempted, speech, but up to now such BMIs have been limited either to isolated sounds or monosyllables - or, in the case of continuous speech on moderately sized vocabularies of about 100 words, to decoding correctly less than 40 per cent of words.

"In this study, we attempt to decode a single sentence at a time, as in most modern machine-translation algorithms, so in fact both tasks map to the same kind of output, a sequence of words corresponding to one sentence.

"The inputs of the two tasks, on the other hand, are very different - neural signals and text."

His team also found brain regions that strongly contributed to speech decoding were also involved in speech production and speech perception.

The approach decoded spoken sentences from one patient's neural activity with an error rate similar to that of professional-level speech transcription, said Dr Makin.

Additionally, when the AI networks were pre-trained on neural activity and speech from one person before training on another participant, decoding results improved.

This suggests the approach may be transferable across people. Further research is needed to fully investigate the potential and to increase decoding beyond the restricted language, Dr Makin added.

While mind reading technologies are primarily designed to help the sick, ethical concerns have been raised.

Some experts say they have the potential to be misused on the healthy and used to track people's thoughts - and relay them back to governments or companies.