Get contextual entropy of each word in a sentence
I am trying to get the contextual entropy of each word within sentences of a dataset.
I am following the definition of Contextual Entropy provided in this paper, so for each position within a sentence, I compute the probability of each word of the vocabulary given the sentence (left) context, and then I sum them. This process is being very time-consuming though, so I need advice on alternative ways of computing the CE.