Smalltalk/X WebserverDocumentation of class 'BayesClassifier': | |
Class: BayesClassifierInheritance:Object | +--TextClassifier | +--BayesClassifier
Description:an initial experiment in bayes text classification. see BayesClassifierTest This is possibly unfinished and may need more work. Instance protocol:text handling
Examples:|b| b := BayesClassifier new. 'teach it positive phrases'. b classify:'amazing, awesome movie!! Yeah!!' asCategory: 'positive'. b classify:'Sweet, this is incredibly, amazing, perfect, great!!' asCategory: 'positive'. 'teach it a negative phrase'. b classify:'terrible, shitty thing. Damn. Sucks!!' asCategory: 'negative'. 'teach it a neutral phrase'. b classify:'I dont really know what to make of this.' asCategory: 'neutral'. 'now test it to see that it correctly categorizes a new document'. self assert:(b classify:'awesome, cool, amazing!! Yay.')= 'positive'. |
|
ST/X 7.7.0.0; WebServer 1.702 at 20f6060372b9.unknown:8081; Sat, 21 Dec 2024 16:26:25 GMT |