import nltk from nltk.tokenize import word_tokenize from nltk.util import ngrams from nltk.lm.preprocessing import pad_both_ends from nltk.util import bigrams input1 =