yenming:

Should the words and labels for dataset be type Variable?


No, Tensor/numpy/int/float/etc would be ok, but string is not ok in this case---- you need to convert to num(e.g. word1->1 word2->2)



 yenming:

How to code the training part, if I want to have minibatch?


Actually this is not an issue about pytorch. For NLP problem like this, you need to process your data using tools like token2id(convert word to digit), pad sequence (to the same length) etc.
This may be helpful:

  
      
      GitHub
  
  
    

rguthrie3/DeepLearningForNLPInPytorch 73

DeepLearningForNLPInPytorch - An IPython Notebook tutorial on deep learning for natural language processing, including structure prediction.