I personally don’t work with torchtext but do all the preprocessing myself; it’s not complicated and I can tweak it to my liking. I assume there are a bunch of tutorials out there.


Strictly speaking, I don’t think that 0 (representing padding <PAD>) has to be in the vocabulary (you probably also need an index to represent unknown <UNK>) – although, it would probably the cleaner solution. However

you have to make sure the 0 does not already reference a real word in your existing vocabulary
your word embedding layer has to be large enough to cover all words in your vocabulary and the padding (and <UNK>, <SOS>, <EOS>, if needed)



Since you do only classification, I don’t think you need <SOS> and/or <EOS>. Those are important particularly for the decoder in sequence-to-sequence models.


No idea what you mean by offset 


If it’s useful, here’s the code to my Vocabulary class 11 I use. Depending what extra indexes I need, I can create an initial one like:
vocabulary = Vocabulary(default_indexes={0: '<pad>', 1: '<unk>', 2: '<sos>', 3: '<eos>'})

or
vocabulary = Vocabulary(default_indexes={0: '<pad>', 1: '<unk>'})

if I just have a classifier and don’t need <sos> and <eos>. The first word I then add to the vocabulary then has index 4 or 2, respectively, and so on. Do you mean this with offset?
Anyway, I would assume torchtext can handle this smoothly as well. You might want to look for a sequence-to-sequence tutorial that uses torchtext, since there <sos> and <eos> are needed.