def encode(self, word):
        '''
        Given a word, get corresponding index in vocabulary.
        '''
        if word not in self.word_to_index:
            word = self.unknown
        return self.word_to_index(word)

        Given a word, get corresponding index in vocabulary.
        
Model_fastText/old_code/utils.py