Exploring the dataset objects

Let's look at the dataset objects, that is, trn, vld, and tst:

trn, vld, tst> (<torchtext.data.dataset.TabularDataset at 0x1d6c86f1320>,
 <torchtext.data.dataset.TabularDataset at 0x1d6c86f1908>,
 <torchtext.data.dataset.TabularDataset at 0x1d6c86f16d8>)

They are all objects from the same class. Our dataset objects can be indexed and iterated over like normal lists, so let's see what the first element looks like:

trn[0], vld[0], tst[0]> (<torchtext.data.example.Example at 0x1d6c86f1940>,
 <torchtext.data.example.Example at 0x1d6c86fed30>,
 <torchtext.data.example.Example at 0x1d6c86fecc0>)

All our elements are, in turn, objects of the example.Example class. Each example stores each column as ...

Get Natural Language Processing with Python Quick Start Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.