I have the code for generating n_gram as follow:
import nltk from nltk.util import ngrams def extract_ngrams(data, num): n_grams = ngrams(nltk.word_tokenize(