This can be achieved by extending the decoding algorithm such that the chart cells also store the loss parameters (e.g., for precision, the number of true and false positives (Joachims, 2005)).
this extension leads to a considerably higher time and space complexity compared to decoding.