9. A system comprising: a processor configured to execute instructions; a non-transitory computer-readable medium containing instructions for execution on the processor, the instructions causing the processor to perform steps of: 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; generating a feature vector for the message including the hashtag phrase; training a computer model to predict an association of the hashtag with a test message, the training using the feature vector for the message that includes the hashtag phrase; and predicting a topic of the message based at least in part on the identified hashtag phrase.
11. The system of claim 9 , wherein the natural language model is trained on a corpus of messages in a social networking system.