MCPcopy Index your code
hub / github.com/THUDM/GLM / _create_examples

Method _create_examples

tasks/superglue/dataset.py:1139–1157  ·  view source on GitHub ↗
(self, path: str)

Source from the content-addressed store, hash-verified

1137 return ["FAVOR", "AGAINST"]
1138
1139 def _create_examples(self, path: str) -> List[InputExample]:
1140 examples = []
1141
1142 with open(path, encoding='utf8') as f:
1143 for line in f:
1144 example_json = json.loads(line)
1145 label = example_json['label']
1146 id_ = example_json['id']
1147 text_a = punctuation_standardization(example_json['question'])
1148 text_b = punctuation_standardization(example_json['comment'])
1149 language = example_json['language']
1150
1151 if self.language is not None and language != self.language:
1152 continue
1153
1154 example = InputExample(guid=id_, text_a=text_a, text_b=text_b, label=label)
1155 examples.append(example)
1156
1157 return examples
1158
1159
1160class Sst2Processor(DataProcessor):

Callers 2

get_train_examplesMethod · 0.95
get_dev_examplesMethod · 0.95

Calls 3

InputExampleClass · 0.90
appendMethod · 0.80

Tested by

no test coverage detected