MCPcopy Create free account
hub / github.com/CLUEbenchmark/CLUE / _create_examples

Method _create_examples

baselines/models/classifier_utils.py:427–437  ·  view source on GitHub ↗

Creates examples for the training and dev sets.

(self, lines, set_type)

Source from the content-addressed store, hash-verified

425 return ["0", "1"]
426
427 def _create_examples(self, lines, set_type):
428 """Creates examples for the training and dev sets."""
429 examples = []
430 for (i, line) in enumerate(lines):
431 guid = "%s-%s" % (set_type, i)
432 text_a = convert_to_unicode(" ".join(line['keyword']))
433 text_b = convert_to_unicode(line['abst'])
434 label = convert_to_unicode(line['label']) if set_type != 'test' else '0'
435 examples.append(
436 InputExample(guid=guid, text_a=text_a, text_b=text_b, label=label))
437 return examples
438
439
440# class InewsProcessor(DataProcessor):

Callers 3

get_train_examplesMethod · 0.95
get_dev_examplesMethod · 0.95
get_test_examplesMethod · 0.95

Calls 3

joinMethod · 0.80
convert_to_unicodeFunction · 0.70
InputExampleClass · 0.70

Tested by

no test coverage detected