from dataset import Corpus, build_glove import pickle train_corpus = Corpus('snips', 'train', 50) pickle.dump(train_corpus.word2idx, open( "word2idx.pkl", "wb" )) wordvecs = build_glove(train_corpus.word2idx, train_corpus.idx2word) pickle.dump(wordvecs, open( "wordvecs.pkl", "wb" )) slots = [slot for slot in train_corpus.slot2idx] pickle.dump(slots, open( "slots.pkl", "wb" )) intent = [intent for intent in train_corpus.intent2idx] pickle.dump(intent, open( "intents.pkl", "wb" ))