Marginal based learning of Conditional Random Field parameters