NLP, Python, Spacy.
reuters.categories(fileid): cat_dict[cat] = 1 doc = nlp(get_text(fileid)) doc.cats = cat_dict db.add(doc) print(f'{time()}: finish processing {filename}') db.to_disk(filename) #convert(training, 'reuters_training.spacy') convert_multi_label(training, 'reuters_training_multi_label.spacy') #