MCPcopy Create free account
hub / github.com/PaddlePaddle/Research / InputExample

Class InputExample

NLP/NAACL2019-MPM/reader.py:309–327  ·  view source on GitHub ↗

A single training/test example for simple sequence classification.

Source from the content-addressed store, hash-verified

307
308
309class 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
330def _truncate_seq_pair(tokens_a, tokens_b, max_length):

Callers 4

get_train_examplesMethod · 0.70
get_dev_examplesMethod · 0.70
get_test_examplesMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected