You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

14 lines
488 B

  1. from dataset import Corpus, build_glove
  2. import pickle
  3. train_corpus = Corpus('snips', 'train', 50)
  4. pickle.dump(train_corpus.word2idx, open( "word2idx.pkl", "wb" ))
  5. wordvecs = build_glove(train_corpus.word2idx, train_corpus.idx2word)
  6. pickle.dump(wordvecs, open( "wordvecs.pkl", "wb" ))
  7. slots = [slot for slot in train_corpus.slot2idx]
  8. pickle.dump(slots, open( "slots.pkl", "wb" ))
  9. intent = [intent for intent in train_corpus.intent2idx]
  10. pickle.dump(intent, open( "intents.pkl", "wb" ))