mirror of
https://github.com/wassname/Castor.git
synced 2026-09-09 11:13:20 +08:00
* initial commit of the updated bridge * moved bridge file to the root * after CR1 * after CR2
15 lines
638 B
Python
15 lines
638 B
Python
from torchtext import data
|
|
|
|
class WikiDataset(data.TabularDataset):
|
|
dirname = 'data'
|
|
@classmethod
|
|
|
|
def splits(cls, question_id, question_field, answer_field, external_field, label_field, root='.data',
|
|
train='wikiqa.train.tsv', validation='wikiqa.dev.tsv', test='wikiqa.test.tsv'):
|
|
path = './data'
|
|
return super(WikiDataset, cls).splits(
|
|
path, root, train, validation, test,
|
|
format='TSV', fields=[('qid', question_id), ('label', label_field), ('question', question_field),
|
|
('answer', answer_field), ('ext_feat', external_field)]
|
|
)
|