In America alone, people spent $170 billion on "direct marketing" — junk mail of both the physical and electronic varieties — last year. Yet of those who received unsolicited adverts through the post, only 3 percent bought anything as a result.

If the pitch arrived electronically, the take-up rate was 0.1 percent. And for online adverts the "conversion" into sales was a minuscule 0.01 percent. That means about $165 billion was spent not on drumming up business, but on annoying people, creating landfill and cluttering spam filters.

That might, in the modern, privacy-free world of sliced and diced Web-browsing analysis, come as something of a surprise. Marketing departments gather terabytes of data on potential customers, spend fortunes on software to analyze their spending habits, and painstakingly "segment" the data to calibrate their campaigns to appeal to specific groups. And still they get it almost completely wrong.

A group of researchers at IBM's Almaden Research Center in San Jose, Calif., however, is here to help. According to Eben Haber, the group's leader, the problem is that firms are trying to understand their customers by studying their "demographics" (age, sex, marital status, dwelling place, income and so on) and their existing buying habits. That approach, he believes, is flawed.

What they really need is a way to discover the "deep psychological profiles" of their customers, including their personalities, values and needs. And he and his team think they can provide it.

Modern psychology recognizes five dimensions of personality: extroversion, agreeableness, conscientiousness, neuroticism and openness to experience. Previous research has shown that people's scores on these traits can, indeed, predict what they purchase. Extroverts are more likely to respond to an ad for a mobile phone that promises excitement than one that promises convenience or security. They also prefer Coca-Cola to Pepsi and Maybelline cosmetics to Max Factor.People are, of course, unlikely to want to take personality tests so that marketing departments around the world can intrude even more on their lives than happens already. But Haber thinks he can get around that — at least for users of Twitter. He and his team have developed software that takes streams of "tweets" from this social medium and searches them for words that indicate a tweeter's personality, values and needs.

The personality-profiling part of the software is based on a study published in 2010 by Tal Yarkoni of the University of Colorado, Boulder. Yarkoni recruited a group of bloggers and correlated the frequencies of certain words and categories of word that they used in their blogs with their personality traits, as established by questionnaire.

Inspired by Yarkoni's findings, Haber and his team are conducting research of their own, matching word use with two sets of traits not directly related to personality.

In a test of the new system, Haber analyzed three months' worth of data from 90 million users of Twitter. His software was able to parse someone's presumptive personality reasonably well from just 50 tweets, and very well indeed from 200.