MCPcopy Index your code
hub / github.com/RingBDStack/GDAP / decode_pred

Function decode_pred

seq2seq/constrained_seq2seq.py:53–54  ·  view source on GitHub ↗
(pred: EvalPrediction)

Source from the content-addressed store, hash-verified

51 return np.count_nonzero(tokens != tokenizer.pad_token_id)
52
53 def decode_pred(pred: EvalPrediction) -> Tuple[List[str], List[str]]:
54 return decode_tree_str(pred.predictions, tokenizer), decode_tree_str(pred.label_ids, tokenizer)
55
56 def extraction_metrics(pred: EvalPrediction) -> Dict:
57 pred_str, label_str = decode_pred(pred)

Callers 1

extraction_metricsFunction · 0.70

Calls 1

decode_tree_strFunction · 0.85

Tested by

no test coverage detected