Quantifying the risk of financial events using kernel methods and information retrieval