making all src_ids as target src_ids: [CLS] [SEP] [CLS] t1 t2 ... tn pos_ids: [0, 1, 0, 1, ..., n-1] seg_labels: [-1, -1, -1, 0, 0, ...,0] sent_ids: [0, 0, 0, 0, ..., 0] sent_b_starts: [2]
(sent_index, batch_del_pos, batch_src_ids, batch_pos_ids,
seg_labels, batch_sent_ids, sent_b_starts, mask_id, cls_id, sep_id)
| 263 | |
| 264 | |
| 265 | def _except(sent_index, batch_del_pos, batch_src_ids, batch_pos_ids, |
| 266 | seg_labels, batch_sent_ids, sent_b_starts, mask_id, cls_id, sep_id): |
| 267 | """making all src_ids as target |
| 268 | src_ids: [CLS] [SEP] [CLS] t1 t2 ... tn |
| 269 | pos_ids: [0, 1, 0, 1, ..., n-1] |
| 270 | seg_labels: [-1, -1, -1, 0, 0, ...,0] |
| 271 | sent_ids: [0, 0, 0, 0, ..., 0] |
| 272 | sent_b_starts: [2] |
| 273 | """ |
| 274 | batch_del_pos.append([]) |
| 275 | batch_src_ids[sent_index] = [cls_id, sep_id] + batch_src_ids[sent_index][:510] |
| 276 | batch_pos_ids[sent_index] = [0, 1] + list(range(0, len(batch_src_ids[sent_index]) - 2)) |
| 277 | seg_labels[sent_index] = [-1, -1] + seg_labels[sent_index][:510] |
| 278 | batch_sent_ids[sent_index] = [0] * len(seg_labels[sent_index]) |
| 279 | sent_b_starts.append(2) |
| 280 | |
| 281 | |
| 282 | def prepare_batch_data(insts, |
no test coverage detected