Python, NLP, Spacy.
article): name = article["title"] text = article["raw"] expected_cats = article["categories"] nlp = spacy.load(f'{model}/model-best') doc = nlp(text) estimated_cats = (sorted(doc.cats.items(), key=lambda i:float(i[1]), reverse=True)) print(f'Article {name} || model {model}"') print(expected_cats)