Creates examples for the training and dev sets.
(self, df, set_type, text_col, label_col)
| 280 | return self.labels |
| 281 | |
| 282 | def _create_examples(self, df, set_type, text_col, label_col): |
| 283 | """Creates examples for the training and dev sets.""" |
| 284 | if label_col is None: |
| 285 | return list( |
| 286 | df.apply( |
| 287 | lambda row: InputExample( |
| 288 | guid=row.index, text_a=str(row[text_col]), label=None |
| 289 | ), |
| 290 | axis=1, |
| 291 | ) |
| 292 | ) |
| 293 | else: |
| 294 | return list( |
| 295 | df.apply( |
| 296 | lambda row: InputExample( |
| 297 | guid=row.index, |
| 298 | text_a=str(row[text_col]), |
| 299 | label=str(row[label_col]), |
| 300 | ), |
| 301 | axis=1, |
| 302 | ) |
| 303 | ) |
| 304 | |
| 305 | |
| 306 | class MultiLabelTextProcessor(TextProcessor): |
no test coverage detected