Spaces:
Sleeping
Sleeping
bkb2135
commited on
Commit
·
05503d0
1
Parent(s):
b1a69de
Set Task to Dummy if task not found
Browse files
utils.py
CHANGED
|
@@ -141,12 +141,16 @@ def load_downloaded_runs(time, cols=KEYS):
|
|
| 141 |
'date-based question answering': 'date_qa',
|
| 142 |
'question-answering': 'qa',
|
| 143 |
}
|
| 144 |
-
df_all.task = df_all.task.apply(lambda x: task_mapping.get(x, x))
|
| 145 |
|
| 146 |
# Runs which do not have a turn field are imputed to be turn zero (single turn)
|
| 147 |
df_all.turn.fillna(0, inplace=True)
|
| 148 |
|
| 149 |
df_all.sort_values(by=['_timestamp'], inplace=True)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 150 |
|
| 151 |
return df_all
|
| 152 |
|
|
|
|
| 141 |
'date-based question answering': 'date_qa',
|
| 142 |
'question-answering': 'qa',
|
| 143 |
}
|
|
|
|
| 144 |
|
| 145 |
# Runs which do not have a turn field are imputed to be turn zero (single turn)
|
| 146 |
df_all.turn.fillna(0, inplace=True)
|
| 147 |
|
| 148 |
df_all.sort_values(by=['_timestamp'], inplace=True)
|
| 149 |
+
# Check if df_all has the task columns
|
| 150 |
+
if 'task' in df_all.columns:
|
| 151 |
+
df_all.task = df_all.task.apply(lambda x: task_mapping.get(x, x))
|
| 152 |
+
else:
|
| 153 |
+
df_all['task'] = "Task was not found"
|
| 154 |
|
| 155 |
return df_all
|
| 156 |
|