Text Classification in C# with ML.NET 2.0

Using NAS-BERT transformers to classify Text to Labels in C#

Matt Eland
AccessibleAI
Published in
12 min readDec 10, 2022

--

Banner image by Matt Eland using Canva and MidJourney.

Recently ML.NET 2.0 was released, giving us a bevy of new features for the open-source machine learning library for dotnet applications.

The release improved ML.NET’s text processing capabilities and improved some aspects of the already fantastic automated machine learning capabilities it had. Moreover, the release seemed to reaffirm ML.NET’s determination to be relevant for advanced machine learning tasks, including deep learning and transformer-based architectures.

In this article we’ll explore ML.NET 2.0’s new text classification capabilities and see how you can use C# to analyze sentiment, match utterances to intents, or otherwise classify textual data without having to write a lot of custom code.

This content is also available in video form on YouTube

What is Text Classification?

Classification is a central task in machine learning applications. With…

--

--

Matt Eland
AccessibleAI

Microsoft MVP in AI, AI Specialist at Leading EDJE. Author of "Refactoring with C#".