Answers for "save a preprocess text"

0

save a preprocess text

import pickle

# saving
with open('tokenizer.pickle', 'wb') as handle:
    pickle.dump(tokenizer, handle, protocol=pickle.HIGHEST_PROTOCOL)

# loading
with open('tokenizer.pickle', 'rb') as handle:
    tokenizer = pickle.load(handle)
Posted by: Guest on August-24-2020

Python Answers by Framework

Browse Popular Code Answers by Language