In one embodiment, when a user retrieves a document such as a web page, PDF document, etc., the theme information generated for the document according to embodiments herein can be used to identify a more appropriate advertisement for displaying along with the web page.