Extracting mentions and hashtags from tweets