Thanks for the reply @albanD. I tried your suggestions but I am unable to convert a list of strings to a tensor.
So, I converted the list to a one-hot encoded list and then convert it to a contiguous array. However, the function encode defined in Infersent is taking only a list of strings. I get this error now:

TypeError: split() missing 1 required positional argument: ‘split_size’