(response, gt_label, language)
| 52 | |
| 53 | |
| 54 | def score_response(response, gt_label, language): |
| 55 | if language=='chinese' and ('抱歉' in response or '没有之前的对话' in response): |
| 56 | return 0 |
| 57 | if language=='english' and ('sorry' in response.lower() or 'no previous conversation' in response.lower()): |
| 58 | return 0 |
| 59 | gt_list = modify_gt(gt_label) |
| 60 | score = np.mean([1 if gt in response else 0 for gt in gt_list]) |
| 61 | return score |
| 62 | |
| 63 | def process_log(response_log): |
| 64 | gt_label = response_log['label'] |