(self, path: str)
| 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 | |
| 1160 | class Sst2Processor(DataProcessor): |
no test coverage detected