Softmax-Margin CRFs: Training Log-Linear Models with Cost Functions