A perceptron based text classification using bag of words as features extractor and applied on a sentiment analysis dataset. This article http://enigmater.blogspot.com/2018/01/perceptron-based-text-classifier-from.html explains how it works.
1 this is positive text
1 this another positive text
0 this a negative text
0 this another negative text
1 etc..
0 etc..
$ python train_and_test.py -t ../sentiement_analysis.txt -i 10 -r 0.1 -s 10000
$ python train_and_test.py -h
A very interesting dataset to test this classifier can be found at https://www.kaggle.com/c/si650winter11/data