I wanted to implement NLP from scratch (collobert 2011 ). NLP from scratch has two training model :

word level log likelihood and
sentence level log likelihood.
Is there any package in pytorch getting sentence level log likelihood and its parameters updates?
or could anybody give some hints for such implementation.
Thanks in advance!