How informative is Twitter? (part 2)

January 26th, 2010 by Cliff Crawford No comments »

In my last post, I presented some research on the different content types we found in our corpus of 8.9 million Twitter messages. One surprising result we found is that Portuguese is apparently the second most common language on Twitter, beating out both Japanese and Spanish. Given the unreliability of TextCat on short pieces of text, I decided to verify our language statistics by looking at the location field in the user info for the unique set of users in our corpus. This was not a straightforward thing to do, however, because the location is a text field which people can write absolutely anything they want into. For example, the following all occurred more than once in our corpus:

  • “New York”
  • “NYC”
  • “everywhere!!!!”
  • “In ur computers, eating ur RAM”
  • “Earth”
  • “Mars”
  • “Utah :)”
  • “utah :(”

To get around this problem, I normalized the text by converting it to lowercase, removing punctuation, and changing things that looked like addresses to have just the city (so that “123 Fake St., Springfield, USA” becomes just “springfield”). I then looked at the top 500 locations in terms of number of twitterers. These are the most common countries represented in users’ locations:
Twitter User Locations (by Country)
And the top 10 cities are:

  1. New York
  2. São Paulo
  3. Los Angeles
  4. London
  5. Chicago
  6. San Francisco
  7. Rio de Janeiro
  8. Tokyo
  9. Atlanta
  10. Toronto

While the locations are dominated by English-speaking countries, Brazil does come in second in terms of number of users, and two Brazilian cities show up in the top 10, which suggests that our language stats aren’t too far off the mark.

Another question we considered in our study is whether there is any way to distinguish between twitterers who post broadly informative messages from those who post mainly personal messages or spam. Our first thought was that the number of followers a twitterer has would be a good indication of how informative their messages are to a wider audience. But we were quite surprised when we looked at the distribution of the number of followers in our sample:
Histogram of Log Number of Followers on Twitter
The x-axis here is the logarithm base 10 of the number of followers. While most twitterers in our corpus have between 15 to 60 followers (log=1.2 to 1.8), there is a long tail where we can find accounts with more than a thousand, 100,000, or even a million followers. We didn’t realize at first the number of celebrities currently using Twitter, as you can see in this list of the top 100 most-followed Twitter accounts. Of course, it’s a matter of opinion whether the latest funny video that Ashton Kutcher found on YouTube is more important than what Barack Obama has to say about health care, but for our purposes, we’d rather filter out celebrity ramblings from the more serious messages, and that is not easy to do based on the number of followers alone.

A more surprising fact we discovered is that spammer accounts can have relatively high numbers of followers as well, as you can see in the following boxplot:
Number of Followers on Twitter, by Message Type
This data is from the 1,000 tweet sample which was classified by message type that I discussed in my previous post. In this plot, messages about the user’s current status and private conversations are grouped together as “personal” messages, while all other messages (excluding spam) are “info” messages. The boxes show the middle 50% of the distribution for each type, while the whiskers extending from the boxes show where 99% of the data points lie. (There are a few outliers above 5,000 followers which are not shown here, to make the distributions easier to see.) While spam messages only made up a small fraction (4%) of our sample, the plot shows that within the set of spammer accounts there are quite a few which have more than 500-1000 followers, a number which would be pretty high for the other two message types. There is even one spam account in our sample which had over 10,000 followers at the time they posted.

But how could a spammer get so many followers, given that all they post is spam? Given that for nearly all of these accounts, the number of friends (accounts they are following) is greater than the number of followers, I suspect that what’s going on is that spammers go around following other twitterers at random, and at least some of these people are following them back out of courtesy, without realizing that they are actually a spam account. The only way a Twitter spammer could get someone to see their tweets is if they are followed by them, after all. There’s probably a high rate of turnover in a spammer’s followers list, but that wouldn’t matter much, as long as they can find more people to follow who will follow them in return without checking them out first.

All of this means that distinguishing spam from informative tweets will not be easy, even if there isn’t that much of it currently. But some good news for us is that twitterers who post lots of informative content do tend to have more followers than those who post mainly personal messages. This fact, combined with some semantic analysis of Twitter messages, should help us a great deal in mining the Twitter stream for useful content.

QA Team New Year’s Resolutions

January 14th, 2010 by Maurice Forrester No comments »

The end of 2009 provided the TextWise Quality Assurance team with an opportunity to create some New Year’s resolutions. The end of the year coincided with the conclusion of a testing cycle giving us the chance to review what worked and what needs improvement as we plan for the future. This is not necessarily a year end activity and it is certainly not a once a year activity. Reviewing what worked and what didn’t work should be done at the end of each test cycle. But timing enables us to call this our New Year’s resolutions at least this one time.

Our first resolution is to review and update test cases. No matter how much we want to have our formal test cases completely defined before testing begins, there will inevitably be improvements that can be made to the documentation. Exploratory and ad hoc tests need to be written up as formal test cases. New test cases need to be updated or fleshed out based on what was learned during the test cycle. Bug reports and test reports are a useful resource for identifying gaps in the formal test documentation.

Our second resolution is to review and update our existing processes. These processes include both our internal QA team processes as well as larger organizational processes that intersect with QA work. This is an opportunity to address process issues that were encountered during the test cycle and to add new processes that may be needed. Some of the areas we look at are the processes dealing with requirements, design, release, and bug triage. Because many of these processes cross groups, all stakeholder must be involved in making changes.

Our third resolution is to review the data we collect and report. We review the specific data we are collecting, how we collect that data, and the format in which we present the data. Process improvements may be needed to improve our collection of data. Other groups, and particularly the management team, need to be involved to ensure that we are providing the information they needed to continue to grow our organization.

Our final resolution is to look to the future. All of the previous resolutions are aimed at making improvements for the future but they are based on what has happened in the past. Now is the time to also look forward at the projects that are coming our way and ask what information we need and what planning we need to do. It’s also an opportunity to take the things that we’ve learned from the previous resolutions and apply them to our pending tasks. In this way, we seek to continually improve the QA team and contribute to the growth of the organization.

In With the New, Out With the Old

January 12th, 2010 by Clinton Mah 1 comment »

Happy 2010! It’s time to think about building the next generation of semantic dictionaries, much like rolling out next year’s models of automobiles from Detroit. We are not talking tail fins and rich Corinthian leather here, however. In the Age of the Web, any kind of dictionary will have a strictly limited life span.

Think of Susan Boyle, the Droid, and the Zhu Zhu hamster. You are not going to find any of these in a dictionary compiled just a year ago. And a year-old semantic dictionary would probably have few associations between Barack Obama and White House.

We have been at TextWise have been busy learning how to build new semantic dictionaries in a hurry and to make them better at the same time. With our statistical technology, we can now turn one out in about two weeks, including data collection time. Everyone will want them fresh and hot.

How informative is Twitter?

January 8th, 2010 by Cliff Crawford 57 comments »

Recently we’ve been looking at how well our Semantic Signatures technology works with messages posted to Twitter. These kinds of messages pose significant challenges for the semantic web in general, because their extremely short length (140 characters or less) means that there will be very little context available for understanding the content of the message. In addition, many of these messages feature “creative” spellings and grammar, and are of a personal nature (e.g. “Having sushi for lunch today”) that would not be of general interest. Extracting any meaningful information from these snippets of random conversation will be quite a difficult task indeed.

To see what exactly we’re up against, we undertook a small study to characterize the different types of messages that can be found on Twitter. » Read more: How informative is Twitter?

Learning

December 21st, 2009 by Clinton Mah No comments »

Consider how we humans learn language. Even with formal education, it takes a child about 15 years starting from infancy to be able to read and understand general news articles in the New York Times. Over this period, one would probably hear or read at least on the order of 10 billion words. Even so, most high schoolers will need many additional years of schooling to become able to comprehend technical material.

So, how can anyone expect a computer to understand something like medical text after training on only about 100 million words of data? A computer of course runs on nanosecond cycles while the human brain operates on millisecond cycles; but we have had about 50,000 generations to evolve our language software, while the electronic computer has had only about 10 generations.

The bottom line here is that language learning is difficult; and it requires sifting through immense amounts of data. There probably is no magic technological shortcut here, but we have reached now the stage where our systems can routinely handle the volumes of data that would support semantic capabilities equivalent to an 8th-grade education. Decent commercial language processing tools are also now available.

Consequently, we are making major progress on semantic dictionaries, but have to be realistic about the work still ahead of us. Expect no overnight miracles from us or anyone else, especially when these are based on measly samples of data. There is still no royal road to semantics.

Testing WordPress Plugins

December 17th, 2009 by Maurice Forrester 1 comment »

Testing our SemanticHacker WordPress plugin has some similarities to testing foof, our Firefox extension, in that we are testing within another application. As with testing Firefox extensions, WordPress plugin testing must include testing on multiple operating systems and multiple versions of Firefox, and it adds the need to test on additional browsers. Because WordPress has been releasing frequent updates we’ve had to focus attention on how to quickly verify our plugin on each WordPress upgrade. As a result, we have two major types of testing for our WordPress plugin: testing a new release of the plugin and verifying our plugin in a new WordPress release.

Regardless of which type of test sequence we’re on, there are some things that we always have to test. We need to validate all supported browser and OS combinations and we need to test all functionality of the SemanticHacker plugin. This functionality includes the ability to use text in a blog post to find relevant content links, tags, webpage links, and products.

When testing a new release of our WordPress plugin, we have two user paths we need to test: An update of an older plugin release and a fresh install of the new version of the plugin. We run our tests on all versions for WordPress that we are supporting following both paths. Of course, if there is new functionality or bug fixes, we need to add test cases to cover those cases.

When there is a new WordPress release, we also consider two paths in which our plugin can appear in that version of WordPress: One is an existing instance of WordPress with the Semantic Hacker plugin is upgraded to the new version. The other is that our plugin is installed fresh on the version being tested. All tests are run on the new version of WordPress following both possible paths. Assuming the new WordPress release passes our tests, we add that version to our list of supported WordPress releases. At the same time we determine if there are older versions on the list for which it is no longer worthwhile to continue testing because they are too little used.

ABC’s of Semantic Dictionaries

December 14th, 2009 by Clinton Mah No comments »

A semantic dictionary in essence consists of triples [ t , d , w ] , where t is a term, d is a semantic dimension, and w is a weight. Each triple says that the occurrence of a term t in a document constitutes a raw vote of w for dimension d being relevant to the document. For example, [ BRAD , Arts/People/Jolie,_Angelina , 0.12100 ] indicates that the occurrence of BRAD in a news story provides evidence that it might be about the movie celebrity Angelina Jolie. If it were conclusive evidence, the weight would be 1.00000, but we never expect any single term to be that definitive.

In building a dictionary for an application, we have to start with the dimensions. Do we have the kinds of dimensions to cover the target content, and are there enough dimensions to make the distinctions in content required by the application? For a patent information system, an Angelina dimension may not have much relevance, and even something more appropriate like Electrical Machinery may have to be divided up into multiple dimensions to support a reasonable level of granularity in indexing.

Given the dimensions, we next have to define the terms to go along with them. The target content we want to process will have a certain vocabulary, and our dictionary terms should try to encompass most of it. This can be tricky in a statistical approach because we need reasonably large samples of training data to make a particular term become associated with a particular dimension.

Weights are determined in large part by training data, but the distribution of those numbers are important. To begin with, not all weights should be the same, and generally, we want to see them spread out over the entire dynamic range available to us. Weights that are quite big or quite large have to be supported by more data that those in the middle range. Weights have to be balanced between dimensions, and there should be enough of them so that most terms are related to more than one dimension.

In theory, we could build a dictionary with just one weight in just one dimension for each term, but that would be in denial about the inherent ambiguity of language. So, we typically want a dictionary to be as big as possible, based on an appropriate amount of training data. To build the best possible dictionary requires much inspiration and much perspiration.

Join us for the Web 3.0 Conference in January

December 10th, 2009 by Rebecca Povio No comments »

Web 3.0 Conference – January 26-27, Santa Clara, CA
web30 logo

We are pleased to announce that our CEO Connie Kenneally, will be co-hosting the session “The Evolution of Semantic Search” on Day Two of the Web 3.0 Conference with Mark Johnson, Senior Program Manager at Bing. View Program. See below for a registration discount code.

About the Web 3.0 Conference
The emergence of a new era of technologies, collectively known as Web 3.0, provides a strategically significant opportunity to make businesses run better. Also known as the semantic web or linked data, web 3.0 is a web in which data is linked to allow for more meaningful, actionable insight to be extracted. At the conference, we will explore how companies are using these technologies today, and should be using them tomorrow, for significant bottom line impact in areas like marketing, corporate information management, publishing, search, customer service, and personal productivity. Use code W3SPKR and save 20%! register: www.web3event.com

SemanticHacker featured in a new book.

December 9th, 2009 by Rebecca Povio No comments »

A new book has been published by author and software developer Jose Sandoval (http://www.josesandoval.com) titled RESTful Java Web Services. A detailed overview of the book can be found on Javabeat.net.

TextWise is particularly excited about this book since Chapter 3 “shows you how to develop a mashup application that uses RESTful web services that connect to Google, Yahoo!, Twitter, and TextWise’s SemanticHacker API. It also covers in detail what it takes to consume JSON objects using JavaScript.”

We wish the best of luck to Jose on his new book! You can follow Jose on twitter @ http://twitter.com/josesandoval

How Many Semantic Dictionaries?

December 7th, 2009 by Clinton Mah 1 comment »

Even in the world of print, one dictionary is often not enough. Just for English, for example, we can go to standard references like Webster’s Third New International, The American Heritage Dictionary of the English Language, or the Oxford English Dictionary, as well as more specialized lexicons. So how many semantic dictionaries do we really need?

That of course depends on the application. If we are in the situation where our target text data is extremely stable and requires only a general vocabulary, then we might get away with a single semantic dictionary based on a large sample of data processed quite carefully. On the Web, however, we have nothing of the sort, if you haven’t noticed lately.

A sophisticated dictionary that took weeks to build with hairy mathematical algorithms on a reasonable sample of training text may become obsolete overnight. That is not to say that sophisticated dictionaries are unhelpful; but in the merciless competition of the information marketplace, we probably need to be able to pop out a new semantic dictionary based on a gigabyte or more of text in just hours.

Given this kind of turnaround, why would anyone want to rely on a single semantic dictionary with its limited vocabulary and somewhat dated concepts? A new dictionary will of course involve a nontrivial upfront investment, but once a reliable source of tagged data is developed, actual dictionary building can be largely automated. That is the advantage of relying on statistical methods.