NLP, Python, Spacy.
cat in reuters.categories()} doc1 = nlp.make_doc(reuters.raw(fileid)) for cat in reuters.categories(fileid): cat_dict[cat] = 1 doc1.cats = cat_dict print(doc1.cats) # {'acq': 0, 'alum': 0, 'barley': 0, 'bop': 0, ..., 'trade': 1, ...} In addition, the data need to be converted to the Spacy custom