(sample)
| 260 | candidate_ranks = candidate_results["ranks"] |
| 261 | |
| 262 | def get_score(sample): |
| 263 | sample_id = f"{sample['annotation_id']}_{sample['action_uid']}" |
| 264 | for candidates in [sample["pos_candidates"], sample["neg_candidates"]]: |
| 265 | for candidate in candidates: |
| 266 | candidate_id = candidate["backend_node_id"] |
| 267 | candidate["score"] = candidate_scores[sample_id][candidate_id] |
| 268 | candidate["rank"] = candidate_ranks[sample_id][candidate_id] |
| 269 | return { |
| 270 | "pos_candidates": sample["pos_candidates"], |
| 271 | "neg_candidates": sample["neg_candidates"], |
| 272 | } |
| 273 | |
| 274 | flatten_dataset = flatten_dataset.map(get_score) |
| 275 | if is_train: |
nothing calls this directly
no outgoing calls
no test coverage detected