Structured Learning Algorithm