Efficient Linearization of Tree Kernel Functions