# Embeddings from SNLI with transitions produce additional tensor

**URL:** <https://discuss.pytorch.org/t/embeddings-from-snli-with-transitions-produce-additional-tensor/50245>\
**Category:** nlp\
**Created:** [July 10, 2019, 11:28am UTC](https://discuss.pytorch.org/t/embeddings-from-snli-with-transitions-produce-additional-tensor/50245 "2019-07-10T11:28:37Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![pkhdipraja](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/pkhdipraja/32/46388_2.png) [@pkhdipraja](https://discuss.pytorch.org/u/pkhdipraja)\
**Post date:** [July 10, 2019, 11:28am UTC](https://discuss.pytorch.org/t/embeddings-from-snli-with-transitions-produce-additional-tensor/50245/1 "2019-07-10T11:28:37Z")

</div>

Hello all, I’m trying to create embeddings from SNLI datasets with shift-reduce parser, however it seems when creating the iterator using data.BucketIterator.splits() from torchtext, it created additional tensor compared to the ones without transitions in premise and hypothesis. What is this tensor for? Is it useful for creating embeddings?

Steps to reproduce:

```auto
import os 
import torch
from torchtext import data
from torchtext import datasets

# With transitions
inputs = datasets.nli.ParsedTextField(lower=True)
transitions = datasets.nli.ShiftReduceField()
answers = data.Field(sequential=False)

train, dev, test = datasets.SNLI.splits(inputs, answers, transitions)

# Without transitions
inputs = data.Field(lower=True, tokenize='spacy')
answers = data.Field(sequential=False)
train, dev, test = datasets.SNLI.splits(inputs, answers)

# =====================================================================
device = torch.device('cuda')

inputs.build_vocab(train, dev, test)
if os.path.isfile(os.path.join(os.getcwd(), '.vector_cache/input_vectors.pt')):
    inputs.vocab.vectors = torch.load(os.path.join(os.getcwd(), '.vector_cache/input_vectors.pt'))
else:
    inputs.vocab.load_vectors('glove.42B.300d')
    os.makedirs(os.path.dirname(os.path.join(os.getcwd(), '.vector_cache/input_vectors.pt')), exist_ok=True)
    torch.save(inputs.vocab.vectors, os.path.join(os.getcwd(), '.vector_cache/input_vectors.pt'))
answers.build_vocab(train)

train_iter, dev_iter, test_iter = data.BucketIterator.splits(
    (train, dev, test), batch_size=128, device=device)

batch = next(iter(train_iter))
print(batch)

```
