(self)
| 225 | ) |
| 226 | |
| 227 | def __post_init__(self): |
| 228 | if self.dataset_name is None and self.train_file is None and self.validation_file is None: |
| 229 | raise ValueError( |
| 230 | "Need either a dataset name or a training/validation file.") |
| 231 | else: |
| 232 | if self.train_file is not None: |
| 233 | extension = self.train_file.split(".")[-1] |
| 234 | assert extension in [ |
| 235 | "csv", "json"], "`train_file` should be a csv or a json file." |
| 236 | if self.validation_file is not None: |
| 237 | extension = self.validation_file.split(".")[-1] |
| 238 | assert extension in [ |
| 239 | "csv", "json"], "`validation_file` should be a csv or a json file." |
| 240 | if not self.task.startswith("summarization") and not self.task.startswith( |
| 241 | "translation") and not self.task.startswith('event'): |
| 242 | raise ValueError( |
| 243 | "`task` should be summarization, summarization_{dataset}, translation or translation_{xx}_to_{yy}." |
| 244 | ) |
| 245 | if self.val_max_target_length is None: |
| 246 | self.val_max_target_length = self.max_target_length |
| 247 | |
| 248 | # Start Code for Event Extraction |
| 249 | decoding_format: str = field( |
nothing calls this directly
no outgoing calls
no test coverage detected