1. A computer-implemented method of measuring probabilities that phrases are relevant to a document, the method comprising: providing a similarity measure that can measure similarity between two arbitrary strings; applying the similarity measure to the phrase and the document to derive a similarity score scoring similarity between the phrase and the document; and mapping the similarity score to a corresponding probability using a sigmoid function.