1. A method comprising: receiving a message in a social networking system, the message including a character string with a hashtag; identifying, a set of candidate phrases including one or more words or phrases that match one or more characters in the character string; scoring each of the candidate phrases based on a natural language model that applies a frequency-based table of words or phrases; selecting a hashtag phrase from the set of candidate phrases based on the scoring of the candidate phrases; and predicting a topic of the message based at least in part on the identified hashtag phrase.