Fast Kernels for String and Tree Matching