A WPF/MVVM app that trains and runs either of two English sentiment classifiers:
- NAS-BERT: ML.NET's TorchSharp text-classification trainer fine-tunes the pretrained NAS-BERT RoBERTa architecture for ten epochs.
- ML.NET Binary (SGD):
FeaturizeTextwith calibrated stochastic-gradient logistic regression for a fast conventional binary classifier.
Select the model type in the combo box before training or loading a model for prediction. Model files are specific to the selected model type.
During training, three independent MVVM pages update side by side below the Training button:
- Polarity Map projects fixed text features to two dimensions and animates the model's live positive/negative probability field and decision boundary.
- Training Dynamics shows how the same representative samples move between negative and positive confidence over successive passes or epochs.
- Counterfactual Graph follows related phrases such as
good,not good, andvery goodso local changes in the learned classifier remain visible.
These views are produced from the actual intermediate SGD or NAS-BERT models; they are not elapsed-time progress indicators or post-training statistics.
Training accepts a headerless, tab-separated file with the review text in the
first column and its sentiment label in the second column (0 = negative,
1 = positive).
Wow... Loved this place.\t1
Crust is not good.\t0
The UCI Sentiment Labelled Sentences dataset
contains yelp_labelled.txt in this format.
NAS-BERT training uses the CPU runtime and is substantially slower than the ML.NET binary option. Its pretrained weights are downloaded automatically the first time it is trained.