Python, NLP, Spacy.
cat in categories_list } #print(categories_dict) count = 0 for _, row in df.iterrows(): count += 1 print(f'Processing {count}/{total}') doc = nlp(row['raw']) cats = copy(categories_dict) for cat in row['categories']: cats[cat] = 1 doc.cats = cats #print(doc.cats) db.add(doc) print(f'{time()}: