How to create a TabularDataset using the first 1000 instances from training set?

140 Views Asked by At

I am doing a text classification task using RNN in pytorch. I have a training dataset and testing dataset. For my task, I need to train my model using the first 1000 instances of the training dataset. Can I create a TabularDataset using the first 1000 training instances?

I want to create a tabularDataset for the first 1000 instances. Is there any way to do so?

Below, I have created a tabularDataset using the entire training and testing data.

train_data,  test_data = TabularDataset.splits(
   path='cola_public/for_torch_text', train='in_domain_train.tsv',
    path='/content/drive/MyDrive', train='/content/drive/MyDrive/axcs_train.csv',
    test='/content/drive/MyDrive/axcs_test.csv', format='csv',skip_header=True,
    fields=tv_datafields)
0

There are 0 best solutions below