A single training/test example for simple sequence classification.
| 307 | |
| 308 | |
| 309 | class InputExample(object): |
| 310 | """A single training/test example for simple sequence classification.""" |
| 311 | |
| 312 | def __init__(self, guid, text_a, text_b=None, label=None): |
| 313 | """Constructs a InputExample. |
| 314 | |
| 315 | Args: |
| 316 | guid: Unique id for the example. |
| 317 | text_a: string. The untokenized text of the first sequence. For single |
| 318 | sequence tasks, only this sequence must be specified. |
| 319 | text_b: (Optional) string. The untokenized text of the second sequence. |
| 320 | Only must be specified for sequence pair tasks. |
| 321 | label: (Optional) string. The label of the example. This should be |
| 322 | specified for train and dev examples, but not for test examples. |
| 323 | """ |
| 324 | self.guid = guid |
| 325 | self.text_a = text_a |
| 326 | self.text_b = text_b |
| 327 | self.label = label |
| 328 | |
| 329 | |
| 330 | def _truncate_seq_pair(tokens_a, tokens_b, max_length): |
no outgoing calls
no test coverage detected