The risk of a new mother suffering from post-natal depression could be predicted weeks before the birth of her child simply be monitoring her Twitter feed, computer scientists have found.

Microsoft labs has discovered that it is possible to spot which pregnant women will struggle with motherhood based on the language they use before the birth.

Intriguingly, the algorithm does not depend on the mother talking about the pregnancy or her baby, but picks up subtle verbal cues which reveal her underlying unhappiness or anxiety.

General negativity in language, with a rise in the number of words like 'hate' 'miserable' 'disappointed', increased use of the word 'I' and a jump in the number of expletives are all clues that a new mum will suffer post-natal depression.

Eric Horvitz, of Co-director of Microsoft Research in Washington, said: "We saw several patterns in the language of women with post-natal depression.

"Then we wondered if we could go back in time and see if this trend could be spotted before the birth. And we found we could.

"We found that two to three weeks before the birth the same clues were there in around 80 per cent of cases.

"It's very subtle. It's things like an increase in the word 'frustrated' and, for example, they curse more often.

"Psychologists have found in strong work that shifts to higher frequencies of the use of first-person pronoun can indicate onset of depression, as people become more self-focused.

"You really get a feeling of what is going on in the heads of those people who were struggling."

The study looked at the language of 2,929 women three months before their birth and three months afterwards.

They noticed that the 15 per cent of women who went on to be diagnosed with suffering post natal depression asked more questions, had lower levels of positivity and increased levels of anger and anxiety.

Horvitz believes an app could be designed which picks up on these clues and could direct new mothers towards help.

"Post natal depression is known to be under reported because of the stigma attached," he said.

"It's not one for Microsoft, but a welfare group could create an app that women could run on a smartphone which warns them of the onset of depression and points them to resources to help them deal with it."

Prof James Pennebaker of the Department of Psychology at the University of Texas has found that the content of what people say online is not as important as how they say it through their use of 'function words' such as pronouns, conjunctions and prepositions.

"Function words tell us how a person is analysing their world and about their mental state. We can get a sense of how psychologically well they are doing," said Prof Pennebaker.

He believes that in future the same algorithms could be applied to the work of historical characters to gain a greater insight into their mental state when they wrote diaries or letters.

Horvitz is one of several scientists who believe that 'big data' stores such as Twitter, Facebook and Google could all be used to spot general trends in the population.

Recently it was discovered that unknown side-effects of taking two drugs together could be predicted by looking at search terms related to the medication.

For example many people searched for allergy drug 'Claritan' and weight loss pill 'Adipex' alongside the word 'fainting', thereby exposing a problem in mixing the drugs which had not been picked up in clinical trials.

It is hoped that such data analysis could eventually complement drug databases.

A separate study showed that an increase in admissions to Washington hospitals for heart problems could be predicted by looking at how many people had Googled salty food recipes.

Therefore, monitoring online recipe trends could be a simple way for hospitals to improve staffing levels.

A team at Cornell University discovered that Twitter posts could be used to predict the general mood of the population, discovering that people are most happy when they wake up.

Michael Macy, professor of arts and sciences at the Department of Sociology at Cornell University said: "We found that people are happiest around breakfast time in the morning and it's downhill from there.

"But it wasn't about work because we found the same pattern on the weekend but delayed by an hour and a half and we think people are sleeping in.

"Baseline happiness was higher at the weekend and we think that being able to wake naturally rather than with an alarm clock was one of the key factors."

Prof Macy's team has also disproved the theory that the cyberspace is borderless.

He demonstrated that alliances on Twitter and Facebook are founded along the same lines as 8 traditional cultural and religious divides identified by Samuel Huntingdon, such as 'Western', 'Islamic' and 'Orthodox'.

"Looking at the digital records of social interactions really supports the idea that the world is aligned by these families of culture," said Prof Macy.

All the academics and scientists were speaking at the American Association for the Advancement of Science (AAAS) meeting in Chicago.