def METHOD_NAME(self, word, include_oov=True):
    if include_oov:
        if self._word2idx.get(word, None) is None:
            raise ValueError(
                'Unknown word: %s. Vocabulary should include oovs here.'
                % word)
        return self._word2idx[word]
    else:
        word = '<unk>' if word not in self._word2idx else word
        return self._word2idx[word]