File size: 786 Bytes
a6a875e |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
from configs.fs import FSConfig
class ArxivConfig(FSConfig):
def __init__(self, **kwargs):
super().__init__(**kwargs)
@property
def id_key(self):
return "article_id"
@property
def source_key(self):
return "article_text"
@property
def target_key(self):
return "abstract_text"
@property
def train_file(self):
return "train.txt"
@property
def validation_file(self):
return "val.txt"
@property
def test_file(self):
return "test.txt"
def process(self, example):
example[self.source_key] = " ".join(example[self.source_key])
example[self.target_key] = " ".join(example[self.target_key]).replace("<S>", "").replace("</S>", "")
del example["labels"] |